diff options
author | matt <matt@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-04-02 06:33:16 +0000 |
---|---|---|
committer | matt <matt@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-04-02 06:33:16 +0000 |
commit | dca0d04278c24301fede72e9ad2b1d6154bfc029 (patch) | |
tree | 9ecc64de35c59c2bce9c491a2a7c3e0f660d0153 /simple_gemac/ll8_to_txmac.v | |
parent | b7be986ad6825a60686df7f697706205ba839cb8 (diff) | |
download | uhd-dca0d04278c24301fede72e9ad2b1d6154bfc029.tar.gz uhd-dca0d04278c24301fede72e9ad2b1d6154bfc029.tar.bz2 uhd-dca0d04278c24301fede72e9ad2b1d6154bfc029.zip |
logic to interface locallink fifos to our mac
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10739 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'simple_gemac/ll8_to_txmac.v')
-rw-r--r-- | simple_gemac/ll8_to_txmac.v | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/simple_gemac/ll8_to_txmac.v b/simple_gemac/ll8_to_txmac.v new file mode 100644 index 000000000..3530a0c59 --- /dev/null +++ b/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 + |