aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/usrp2/simple_gemac/ll8_to_txmac.v
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-15 11:24:24 -0700
committerJosh Blum <josh@joshknows.com>2010-04-15 11:24:24 -0700
commit05d77f772317de5d925301aa11bb9a880656dd05 (patch)
tree0910bfb9265fab1644a3d3a1706719f1b038d193 /fpga/usrp2/simple_gemac/ll8_to_txmac.v
parent16818dc98e97b69a028c47e66ebfb16e32565533 (diff)
downloaduhd-05d77f772317de5d925301aa11bb9a880656dd05.tar.gz
uhd-05d77f772317de5d925301aa11bb9a880656dd05.tar.bz2
uhd-05d77f772317de5d925301aa11bb9a880656dd05.zip
moved usrp1 and usrp2 fpga dirs into fpga subdirectory
Diffstat (limited to 'fpga/usrp2/simple_gemac/ll8_to_txmac.v')
-rw-r--r--fpga/usrp2/simple_gemac/ll8_to_txmac.v43
1 files changed, 43 insertions, 0 deletions
diff --git a/fpga/usrp2/simple_gemac/ll8_to_txmac.v b/fpga/usrp2/simple_gemac/ll8_to_txmac.v
new file mode 100644
index 000000000..3530a0c59
--- /dev/null
+++ b/fpga/usrp2/simple_gemac/ll8_to_txmac.v
@@ -0,0 +1,43 @@
+
+module ll8_to_txmac
+ (input clk, input reset, input clear,
+ input [7:0] ll_data, input ll_sof, input ll_eof, input ll_src_rdy, output ll_dst_rdy,
+ output [7:0] tx_data, output tx_valid, output tx_error, input tx_ack );
+
+ reg [2:0] xfer_state;
+
+ localparam XFER_IDLE = 0;
+ localparam XFER_ACTIVE = 1;
+ localparam XFER_WAIT1 = 2;
+ localparam XFER_UNDERRUN = 3;
+ localparam XFER_DROP = 4;
+
+ always @(posedge clk)
+ if(reset | clear)
+ xfer_state <= XFER_IDLE;
+ else
+ case(xfer_state)
+ XFER_IDLE :
+ if(tx_ack)
+ xfer_state <= XFER_ACTIVE;
+ XFER_ACTIVE :
+ if(~ll_src_rdy)
+ xfer_state <= XFER_UNDERRUN;
+ else if(ll_eof)
+ xfer_state <= XFER_WAIT1;
+ XFER_WAIT1 :
+ xfer_state <= XFER_IDLE;
+ XFER_UNDERRUN :
+ xfer_state <= XFER_DROP;
+ XFER_DROP :
+ if(ll_eof)
+ xfer_state <= XFER_IDLE;
+ endcase // case (xfer_state)
+
+ assign ll_dst_rdy = (xfer_state == XFER_ACTIVE) | tx_ack | (xfer_state == XFER_DROP);
+ assign tx_valid = (ll_src_rdy & (xfer_state == XFER_IDLE))|(xfer_state == XFER_ACTIVE);
+ assign tx_data = ll_data;
+ assign tx_error = (xfer_state == XFER_UNDERRUN);
+
+endmodule // ll8_to_txmac
+