aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/usrp3/lib/axi/axi_chdr_header_trigger.v
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2014-02-14 12:05:07 -0800
committerBen Hilburn <ben.hilburn@ettus.com>2014-02-14 12:05:07 -0800
commitff1546f8137f7f92bb250f685561b0c34cc0e053 (patch)
tree7fa6fd05c8828df256a1b20e2935bd3ba9899e2c /fpga/usrp3/lib/axi/axi_chdr_header_trigger.v
parent4f691d88123784c2b405816925f1a1aef69d18c1 (diff)
downloaduhd-ff1546f8137f7f92bb250f685561b0c34cc0e053.tar.gz
uhd-ff1546f8137f7f92bb250f685561b0c34cc0e053.tar.bz2
uhd-ff1546f8137f7f92bb250f685561b0c34cc0e053.zip
Pushing the bulk of UHD-3.7.0 code.
Diffstat (limited to 'fpga/usrp3/lib/axi/axi_chdr_header_trigger.v')
-rw-r--r--fpga/usrp3/lib/axi/axi_chdr_header_trigger.v40
1 files changed, 40 insertions, 0 deletions
diff --git a/fpga/usrp3/lib/axi/axi_chdr_header_trigger.v b/fpga/usrp3/lib/axi/axi_chdr_header_trigger.v
new file mode 100644
index 000000000..e8dee3675
--- /dev/null
+++ b/fpga/usrp3/lib/axi/axi_chdr_header_trigger.v
@@ -0,0 +1,40 @@
+
+// Copyright 2014 Ettus Research LLC
+
+
+module axi_chdr_header_trigger
+ #(
+ parameter WIDTH=64,
+ parameter SID=0
+ )
+ (input clk, input reset, input clear,
+ input [WIDTH-1:0] i_tdata, input i_tlast, input i_tvalid, input i_tready,
+ output trigger
+ );
+
+
+ reg state;
+ localparam IDLE = 0;
+ localparam RUN = 1;
+
+
+ always @(posedge clk)
+ if(reset | clear)
+ state <= IDLE;
+ else
+ case (state)
+ IDLE :
+ if(i_tvalid && i_tready)
+ state <= RUN;
+
+ RUN :
+ if(i_tready && i_tvalid && i_tlast)
+ state <= IDLE;
+
+ default :
+ state <= IDLE;
+ endcase // case (state)
+
+ assign trigger = i_tvalid && i_tready && (state == IDLE) && (i_tdata[15:0] != SID);
+
+endmodule // axi_chdr_header_trigger