copied over from other project
[debian/gnuradio] / usrp2 / fpga / serdes / serdes_fc_tx.v
1
2
3 module serdes_fc_tx
4   (input clk, input rst,
5    input xon_rcvd, input xoff_rcvd, output reg inhibit_tx);
6
7    // XOFF means stop sending, XON means start sending
8    // clock domain stuff happens elsewhere, everything here is on main clk
9
10    reg [15:0] state;
11    always @(posedge clk)
12      if(rst)
13        state <= 0;
14      else if(xoff_rcvd)
15        state <= 255;
16      else if(xon_rcvd)
17        state <= 0;
18      else if(state !=0)
19        state <= state - 1;
20
21    always @(posedge clk)
22      inhibit_tx <= (state != 0);
23    
24 endmodule // serdes_fc_tx