From d6da6c4145d4f7411004e0c8176f029cbe998c09 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 1 Mar 2012 18:33:49 -0800 Subject: fifo ctrl: added time compare for timed commands --- usrp2/control_lib/settings_readback_bus_fifo_ctrl.v | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usrp2/control_lib') diff --git a/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v b/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v index a83ac8e8c..89efd2203 100644 --- a/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v +++ b/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v @@ -117,7 +117,7 @@ module settings_readback_bus_fifo_ctrl assign in_command_ticks = in_ticks_reg; assign in_command_data = in_data_reg; assign in_command_hdr = in_hdr_reg; - assign in_command_has_time = has_tsf; + assign in_command_has_time = has_tsf_reg; always @(posedge clock) begin if (reset) begin @@ -229,6 +229,11 @@ module settings_readback_bus_fifo_ctrl assign out_command_ready = (out_state == LOAD_CMD); + wire now, early, late, too_early; + time_compare time_compare( + .time_now(vita_time), .trigger_time(out_ticks_reg), + .now(now), .early(early), .late(late), .too_early(too_early)); + always @(posedge clock) begin if (reset) begin out_state <= LOAD_CMD; @@ -246,8 +251,7 @@ module settings_readback_bus_fifo_ctrl end WAIT_CMD: begin - //TODO wait condition here - out_state <= ACTION_EVENT; + if (now || late) out_state <= ACTION_EVENT; end ACTION_EVENT: begin // poking and peeking happens here! -- cgit v1.2.3