Changeset 90 for trunk/MultiChannelUSB/i2c_fifo.v
- Timestamp:
- Feb 27, 2010, 10:10:19 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/i2c_fifo.v
r84 r90 1 1 module i2c_fifo 2 2 ( 3 input wire clk, aclr, 4 input wire wrreq, 5 input wire [15:0] data, 6 output wire full, 3 input wire clock, reset, 4 5 input wire bus_ssel, bus_wren, 6 input wire [15:0] bus_mosi, 7 8 output wire bus_busy, 7 9 8 10 inout wire i2c_sda, … … 10 12 ); 11 13 12 wire int_rdempty, i 2c_clk, start, stop;14 wire int_rdempty, int_wrfull, i2c_clk, start, stop; 13 15 wire [15:0] int_q; 14 16 15 reg int_rdreq, int_clken, int_sdo, int_scl, int_ack; 17 reg int_bus_busy; 18 reg int_rdreq, int_wrreq, int_clken, int_sdo, int_scl, int_ack; 19 reg [15:0] int_bus_mosi; 16 20 reg [15:0] int_data; 17 21 reg [9:0] counter; … … 34 38 .overflow_checking("ON"), 35 39 .underflow_checking("ON"), 36 .use_eab("O N")) fifo_tx (40 .use_eab("OFF")) fifo_tx ( 37 41 .rdreq((~int_rdempty) & (int_rdreq) & (&counter)), 38 .aclr( aclr),39 .clock(cl k),40 .wrreq( wrreq),41 .data( data),42 .aclr(1'b0), 43 .clock(clock), 44 .wrreq(int_wrreq), 45 .data(int_bus_mosi), 42 46 .empty(int_rdempty), 43 47 .q(int_q), 44 .full( full),48 .full(int_wrfull), 45 49 .almost_empty(), 46 50 .almost_full(), … … 48 52 .usedw()); 49 53 50 always @ (posedge clk) 54 always @ (posedge clock) 55 begin 56 int_bus_busy <= int_wrfull; 57 58 if (bus_ssel) 59 begin 60 if (~int_wrfull & bus_wren) 61 begin 62 int_bus_mosi <= bus_mosi; 63 int_wrreq <= 1'b1; 64 end 65 end 66 67 if (~int_wrfull & int_wrreq) 68 begin 69 int_wrreq <= 1'b0; 70 end 71 72 end 73 74 always @ (posedge clock) 51 75 begin 52 76 counter <= counter + 10'd1; … … 190 214 end 191 215 216 // output logic 217 assign bus_busy = int_bus_busy; 218 192 219 endmodule
Note:
See TracChangeset
for help on using the changeset viewer.