Changeset 72 for trunk/MultiChannelUSB/control.v
- Timestamp:
- Nov 25, 2009, 11:02:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/control.v
r69 r72 2 2 ( 3 3 input wire clk, 4 5 output wire cfg_reset, 6 input wire [15:0] cfg_src_data, 7 output wire [15:0] cfg_src_addr, cfg_dst_data, cfg_dst_addr, 8 4 9 input wire rx_empty, tx_full, 5 10 input wire [7:0] rx_data, … … 44 49 reg int_i2c_wrreq; 45 50 51 reg int_cfg_reset; 52 reg [15:0] int_dst_data, int_dst_addr; 46 53 47 54 wire crc_error = 1'b0; … … 54 61 wire [15:0] src, dst; 55 62 56 reg [15:0] memory [15:0];57 63 reg [7:0] buffer [7:0]; 58 64 59 assign src = (buffer[0][7]) ? memory[buffer[3][3:0]]: {buffer[2], buffer[3]};65 assign src = (buffer[0][7]) ? cfg_src_data : {buffer[2], buffer[3]}; 60 66 assign dst = {1'b0, buffer[0][6:0], buffer[1]}; 61 67 … … 113 119 idle_counter <= 5'd0; 114 120 byte_counter <= 3'd0; 121 int_cfg_reset <= 1'b0; 115 122 state <= 5'd1; 116 123 end … … 147 154 if (~crc_error) 148 155 begin 149 memory[dst[3:0]] <= src; 156 int_dst_addr <= dst; 157 int_dst_data <= src; 158 // memory[dst[3:0]] <= src; 150 159 151 160 case (dst) 152 161 16'h0000: 153 162 begin 163 int_cfg_reset <= 1'b1; 154 164 state <= 5'd0; 155 165 end … … 187 197 int_i2c_wrreq <= 1'b1; 188 198 state <= 5'd15; 199 end 200 201 default: 202 begin 203 state <= 5'd0; 189 204 end 190 205 endcase … … 339 354 end 340 355 356 assign cfg_reset = int_cfg_reset; 357 assign cfg_src_addr = {buffer[2], buffer[3]}; 358 assign cfg_dst_data = int_dst_data; 359 assign cfg_dst_addr = int_dst_addr; 341 360 assign mux_reset = int_reset; 342 361 assign mux_type = int_type;
Note:
See TracChangeset
for help on using the changeset viewer.