copied over old one which works with icarus
[debian/gnuradio] / usrp2 / fpga / control_lib / fifo_reader.v
1
2 module fifo_reader
3   #(parameter rate=4)
4     (input clk,
5      input [31:0] data_in,
6      output read_o
7      input ready_i,
8      input done_i
9      );
10
11    reg [7:0] state = 0;
12    
13    always @(posedge clk)
14      if(ready)
15        if(state == rate)
16          state <= 0;
17        else
18          state <= state + 1;
19      else
20        state <= 0;
21
22    assign    read = (state == rate);
23
24    initial $monitor(data_in);
25    
26 endmodule // fifo_reader
27
28