Changeset 107 for sandbox/MultiChannelUSB/counter.v
- Timestamp:
- Jan 17, 2011, 5:56:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/MultiChannelUSB/counter.v
r94 r107 1 1 module counter 2 2 ( 3 input wire clock, frame, reset,3 input wire clock, frame, 4 4 5 input wire [15:0] cfg_data,5 input wire reset, setup, count, 6 6 7 7 input wire bus_ssel, bus_wren, … … 23 23 wire [63:0] reg_bits_wire; 24 24 wire [63:0] cnt_bits_wire; 25 26 reg int_load_reg; 25 27 26 28 integer i; … … 32 34 .lpm_type("LPM_COUNTER"), 33 35 .lpm_width(64)) lpm_counter_component ( 34 .sload( cfg_data[0]),36 .sload(int_load_reg | setup), 35 37 .sclr(reset), 36 38 .clock(clock), 37 39 .data(reg_bits_wire), 38 // .cnt_en(frame & cfg_data[1]), 39 .cnt_en((frame) & (|cnt_bits_wire) & (cfg_data[1])), 40 .q(cnt_bits_wire), 41 .aclr(1'b0), 42 .aload(1'b0), 43 .aset(1'b0), 44 .cin(1'b1), 45 .clk_en(1'b1), 46 .cout(), 47 .eq(), 48 .sset(1'b0), 49 .updown(1'b1)); 40 .cnt_en((frame) & (count) & (|cnt_bits_wire)), 41 .q(cnt_bits_wire)); 50 42 51 43 generate … … 60 52 .clock(clock), 61 53 .data(bus_mosi), 62 .q(reg_bits_wire[j*16+15:j*16]), 63 .aclr(), 64 .aload(), 65 .aset(), 66 .sload(), 67 .sset()); 54 .q(reg_bits_wire[j*16+15:j*16])); 68 55 end 69 56 endgenerate … … 84 71 .lpm_width(2)) lpm_decode_unit ( 85 72 .data(bus_addr), 86 .eq(int_ssel_wire), 87 .aclr(), 88 .clken(), 89 .clock(), 90 .enable()); 73 .eq(int_ssel_wire)); 91 74 92 75 always @(posedge clock) … … 96 79 int_miso_reg <= 16'd0; 97 80 cnt_good_reg <= 1'b0; 81 int_load_reg <= 1'b0; 98 82 end 99 83 else 100 84 begin 101 85 int_miso_reg <= int_miso_wire; 102 cnt_good_reg <= (|cnt_bits_wire) & (cfg_data[1]); 86 cnt_good_reg <= |cnt_bits_wire; 87 int_load_reg <= bus_ssel & bus_wren; 103 88 end 104 89 end
Note:
See TracChangeset
for help on using the changeset viewer.