aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/usrp2/vrt/vita_tx_control.v
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-23 13:36:42 -0800
committerJosh Blum <josh@joshknows.com>2010-11-23 13:36:42 -0800
commitbb0572a960edf54486a4be746c681adaac0fa398 (patch)
tree7afb46e99eaf799a478fcde841eb78d7698e9c39 /fpga/usrp2/vrt/vita_tx_control.v
parent8ce75a3ca7a51f4bdee87d78a610a0f2519473ae (diff)
downloaduhd-bb0572a960edf54486a4be746c681adaac0fa398.tar.gz
uhd-bb0572a960edf54486a4be746c681adaac0fa398.tar.bz2
uhd-bb0572a960edf54486a4be746c681adaac0fa398.zip
fpga: performed a forceful checkout of fpga to overwrite with current fpga code
Diffstat (limited to 'fpga/usrp2/vrt/vita_tx_control.v')
-rw-r--r--fpga/usrp2/vrt/vita_tx_control.v26
1 files changed, 12 insertions, 14 deletions
diff --git a/fpga/usrp2/vrt/vita_tx_control.v b/fpga/usrp2/vrt/vita_tx_control.v
index 936762212..20ad6b995 100644
--- a/fpga/usrp2/vrt/vita_tx_control.v
+++ b/fpga/usrp2/vrt/vita_tx_control.v
@@ -6,7 +6,7 @@ module vita_tx_control
input set_stb, input [7:0] set_addr, input [31:0] set_data,
input [63:0] vita_time,
- output error,
+ output error, output ack,
output reg [31:0] error_code,
output reg packet_consumed,
@@ -38,9 +38,8 @@ module vita_tx_control
// FIXME ignore too_early for now for timing reasons
assign too_early = 0;
time_compare
- time_compare (.time_now(vita_time), .trigger_time(send_time), .now(now), .early(early),
- .late(late), .too_early());
-// .late(late), .too_early(too_early));
+ time_compare (.time_now(vita_time), .trigger_time(send_time),
+ .now(now), .early(early), .late(late), .too_early());
localparam IBS_IDLE = 0;
localparam IBS_RUN = 1; // FIXME do we need this?
@@ -58,11 +57,6 @@ module vita_tx_control
reg [2:0] ibs_state;
- wire clear_state;
- setting_reg #(.my_addr(BASE+1)) sr
- (.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
- .in(set_data),.out(),.changed(clear_state));
-
wire [31:0] error_policy;
setting_reg #(.my_addr(BASE+3)) sr_error_policy
(.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
@@ -71,13 +65,15 @@ module vita_tx_control
wire policy_wait = error_policy[0];
wire policy_next_packet = error_policy[1];
wire policy_next_burst = error_policy[2];
- reg send_error;
+ reg send_error, send_ack;
always @(posedge clk)
- if(reset | clear_state)
+ if(reset | clear)
begin
ibs_state <= IBS_IDLE;
send_error <= 0;
+ send_ack <= 0;
+ error_code <= 0;
end
else
case(ibs_state)
@@ -111,7 +107,7 @@ module vita_tx_control
begin
ibs_state <= IBS_ERROR_DONE; // Not really an error
error_code <= CODE_EOB_ACK;
- send_error <= 1;
+ send_ack <= 1;
end
else
ibs_state <= IBS_CONT_BURST;
@@ -151,6 +147,7 @@ module vita_tx_control
IBS_ERROR_DONE :
begin
send_error <= 0;
+ send_ack <= 0;
ibs_state <= IBS_IDLE;
end
@@ -161,14 +158,15 @@ module vita_tx_control
assign sample_fifo_dst_rdy_o = (ibs_state == IBS_ERROR) | (strobe & (ibs_state == IBS_RUN)); // FIXME also cleanout
assign run = (ibs_state == IBS_RUN) | (ibs_state == IBS_CONT_BURST);
assign error = send_error;
+ assign ack = send_ack;
always @(posedge clk)
- if(reset)
+ if(reset | clear)
packet_consumed <= 0;
else
packet_consumed <= eop & sample_fifo_src_rdy_i & sample_fifo_dst_rdy_o;
- assign debug = { { now,early,late,too_early,eop,eob,sob,send_at },
+ assign debug = { { now,early,late,ack,eop,eob,sob,send_at },
{ sample_fifo_src_rdy_i, sample_fifo_dst_rdy_o, strobe, run, error, ibs_state[2:0] },
{ 8'b0 },
{ 8'b0 } };