summaryrefslogtreecommitdiffstats
path: root/vrt/vita_tx_control.v
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2009-12-14 21:09:29 -0800
committerMatt Ettus <matt@ettus.com>2009-12-14 21:09:29 -0800
commitf238468d299312ed562c6f711150f04b070818ed (patch)
tree4ee2d4cb79688c9fae4796f1b46188db97e4a585 /vrt/vita_tx_control.v
parentc64129bf5dcd9970fd6f70254ef3b93b662ca12f (diff)
downloaduhd-f238468d299312ed562c6f711150f04b070818ed.tar.gz
uhd-f238468d299312ed562c6f711150f04b070818ed.tar.bz2
uhd-f238468d299312ed562c6f711150f04b070818ed.zip
cleaned up the main ibs state machine
Diffstat (limited to 'vrt/vita_tx_control.v')
-rw-r--r--vrt/vita_tx_control.v31
1 files changed, 22 insertions, 9 deletions
diff --git a/vrt/vita_tx_control.v b/vrt/vita_tx_control.v
index 919ded4df..6776e26e5 100644
--- a/vrt/vita_tx_control.v
+++ b/vrt/vita_tx_control.v
@@ -35,10 +35,11 @@ module vita_tx_control
.late(late), .too_early(too_early));
localparam IBS_IDLE = 0;
- localparam IBS_WAIT = 1; // FIXME do we need this?
- localparam IBS_RUN = 2;
+ localparam IBS_RUN = 1; // FIXME do we need this?
+ localparam IBS_CONT_BURST = 2;
localparam IBS_UNDERRUN = 3;
-
+ localparam IBS_UNDERRUN_DONE = 4;
+
reg [2:0] ibs_state;
wire clear_state;
@@ -62,17 +63,29 @@ module vita_tx_control
if(strobe)
if(~sample_fifo_src_rdy_i)
ibs_state <= IBS_UNDERRUN;
- else if(eop & eob)
- ibs_state <= IBS_IDLE;
- // else if(eop) FIXME do we care if the packet ends?
+ else if(eop)
+ if(eob)
+ ibs_state <= IBS_IDLE;
+ else
+ ibs_state <= IBS_CONT_BURST;
+ IBS_CONT_BURST :
+ if(strobe)
+ ibs_state <= IBS_UNDERRUN_DONE;
+ else if(sample_fifo_src_rdy_i)
+ ibs_state <= IBS_RUN;
+
IBS_UNDERRUN :
+ if(sample_fifo_src_rdy_i & eop)
+ ibs_state <= IBS_UNDERRUN_DONE;
+
+ IBS_UNDERRUN_DONE :
;
endcase // case (ibs_state)
- assign sample_fifo_dst_rdy_o = (strobe & (ibs_state == IBS_RUN)); // FIXME also cleanout
- assign run = (ibs_state == IBS_RUN);
- assign underrun = (ibs_state == IBS_UNDERRUN);
+ assign sample_fifo_dst_rdy_o = (ibs_state == IBS_UNDERRUN) | (strobe & (ibs_state == IBS_RUN)); // FIXME also cleanout
+ assign run = (ibs_state == IBS_RUN) | (ibs_state == IBS_CONT_BURST);
+ assign underrun = (ibs_state == IBS_UNDERRUN_DONE);
assign debug = { { now,early,late,too_early,eop,eob,sob,send_at },
{ sample_fifo_src_rdy_i, sample_fifo_dst_rdy_o, strobe, run, underrun, ibs_state[2:0] },