Changeset 44 for trunk/MultiChannelUSB/adc_fifo.v
- Timestamp:
- Sep 14, 2009, 12:55:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/adc_fifo.v
r27 r44 6 6 input wire aclr, 7 7 input wire rdclk, 8 input wire rdreq, 9 output wire r dempty,8 9 output wire ready, 10 10 output wire [11:0] raw_data, 11 11 output wire [13:0] uwt_data … … 18 18 19 19 wire [1:0] wrfull; 20 21 reg state; 22 reg int_rdreq, int_ready; 23 wire int_rdempty; 20 24 21 25 uwt_bior31 #(.L(1)) uwt_1_unit ( 22 26 .clk(adc_clk), 23 .x( adc_data),27 .x({20'h00000, adc_data}), 24 28 .d(uwt_d1), 25 29 .a(uwt_a1), … … 48 52 .data(adc_data), 49 53 .rdclk(rdclk), 50 .rdreq( rdreq),54 .rdreq(int_rdreq), 51 55 .wrclk(adc_clk), 52 56 .wrreq(~wrfull[0]), 53 57 .q(raw_data), 54 .rdempty( rdempty),58 .rdempty(int_rdempty), 55 59 .wrfull(wrfull[0])); 56 60 … … 59 63 .data({uwt_flag3, uwt_peak3[11:0]}), 60 64 .rdclk(rdclk), 61 .rdreq( rdreq),65 .rdreq(int_rdreq), 62 66 .wrclk(adc_clk), 63 67 .wrreq(~wrfull[1]), … … 66 70 .wrfull(wrfull[1])); 67 71 72 always @ (posedge rdclk) 73 begin 74 case (state) 75 1'b0: 76 begin 77 if (~int_rdempty) 78 begin 79 int_rdreq <= 1'b1; 80 int_ready <= 1'b1; 81 state <= 1'b1; 82 end 83 end 84 85 1'b1: 86 begin 87 int_rdreq <= 1'b0; 88 int_ready <= 1'b0; 89 state <= 1'b0; 90 end 91 92 default: 93 begin 94 int_rdreq <= 1'b0; 95 int_ready <= 1'b0; 96 state <= 1'b0; 97 end 98 endcase 99 end 100 101 assign ready = int_ready; 102 68 103 endmodule
Note:
See TracChangeset
for help on using the changeset viewer.