Changeset 154
- Timestamp:
- Jun 26, 2011, 11:06:30 PM (14 years ago)
- Location:
- sandbox/MultiChannelUSB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/MultiChannelUSB/Paella.v
r149 r154 93 93 wire [4*12-1:0] int_mux_data [N-1:0]; 94 94 95 wire amp_flag1 [N-1:0]; 96 wire [11:0] amp_data1 [N-1:0]; 97 98 wire amp_flag2 [N-1:0]; 99 wire [11:0] amp_data2 [N-1:0]; 95 wire amp_flag [N-1:0]; 96 wire [11:0] amp_data [N-1:0]; 100 97 101 98 wire cnt_good [N-1:0]; … … 160 157 adc_data[3], adc_data[2], adc_data[1], adc_data[0]})); 161 158 162 wire [15:0] cfg_bits [31:0];163 wire [ 511:0] int_cfg_bits;159 wire [15:0] cfg_bits [63:0]; 160 wire [1023:0] int_cfg_bits; 164 161 165 162 wire [39:0] cfg_mux_selector; … … 182 179 183 180 generate 184 for (j = 0; j < 32; j = j + 1)181 for (j = 0; j < 64; j = j + 1) 185 182 begin : CONFIGURATION_OUTPUT 186 183 assign cfg_bits[j] = int_cfg_bits[j*16+15:j*16]; … … 193 190 .bus_ssel(bus_ssel[0]), 194 191 .bus_wren(bus_wren), 195 .bus_addr(bus_addr[ 4:0]),192 .bus_addr(bus_addr[5:0]), 196 193 .bus_mosi(bus_mosi), 197 194 .bus_miso(bus_miso[0]), … … 203 200 begin : MUX_DATA 204 201 assign int_mux_data[j] = { 205 amp_data 2[j],202 amp_data[j], 206 203 clp_data[j], 207 204 cic_data[j][19:8], … … 283 280 for (j = 0; j < 3; j = j + 1) 284 281 begin : DECONV_CHAIN 285 /* 286 deconv #(.shift(22), .width(20), .widthr(12)) deconv_unit ( 287 .clock(sys_clock), 288 .frame(sys_frame), 289 .reset(1'b0), 290 .del_data({6'd14, 6'd14, 6'd14, 6'd14}), 291 .amp_data({6'd17, 6'd17, 6'd17, 6'd17}), 292 .tau_data({16'd16320, 16'd16320, 16'd16320, 16'd16320}), 293 // .del_data({cfg_bits[16][5:0], cfg_bits[15][13:8], cfg_bits[15][5:0]}), 294 // .amp_data({cfg_bits[18][7:0], cfg_bits[17][15:8], cfg_bits[17][7:0]}), 295 // .tau_data({cfg_bits[21], cfg_bits[20], cfg_bits[19]}), 296 .inp_data({ 297 cic_data[j*4+3][19:0], cic_data[j*4+2][19:0], 298 cic_data[j*4+1][19:0], cic_data[j*4+0][19:0]}), 299 .out_data({ 300 dec_data[j*4+3], dec_data[j*4+2], 301 dec_data[j*4+1], dec_data[j*4+0]})); 302 */ 282 303 283 clip #(.shift(22), .width(20), .widthr(12)) clip_unit ( 304 284 .clock(sys_clock), 305 285 .frame(sys_frame), 306 286 .reset(1'b0), 307 .del_data({6'd12, 6'd12, 6'd12, 6'd12}), 287 // .del_data({6'd14, 6'd14, 6'd14, 6'd14}), 288 .del_data({cfg_bits[39+8*j][5:0], cfg_bits[37+8*j][5:0], cfg_bits[35+8*j][5:0], cfg_bits[33+8*j][5:0]}), 308 289 .amp_data({6'd17, 6'd17, 6'd17, 6'd17}), 309 .tau_data({16'd16560, 16'd16560, 16'd16560, 16'd16560}), // exp(-12/240)*1024*17 290 // .tau_data({16'd17193, 16'd17193, 16'd17193, 16'd17193}), /* exp(-14/1125)*1024*17 */ 291 .tau_data({cfg_bits[38+8*j], cfg_bits[36+8*j], cfg_bits[34+8*j], cfg_bits[32+8*j]}), 310 292 .inp_data({ 311 293 cic_data[j*4+3][19:0], cic_data[j*4+2][19:0], … … 315 297 clp_data[j*4+1], clp_data[j*4+0]})); 316 298 317 /*318 clip #(.shift(22), .width(22), .widthr(12)) clip_unit (319 .clock(sys_clock),320 .frame(sys_frame),321 .reset(1'b0),322 .del_data({6'd18, 6'd18, 6'd18, 6'd18}),323 .amp_data({6'd5, 6'd5, 6'd5, 6'd5}),324 .tau_data({16'd4932, 16'd4932, 16'd4932, 16'd4932}), // exp(-18/480)*1024*5325 .inp_data({326 cic_data[j*4+3][21:0], cic_data[j*4+2][21:0],327 cic_data[j*4+1][21:0], cic_data[j*4+0][21:0]}),328 .out_data({329 clp_data[j*4+3], clp_data[j*4+2],330 clp_data[j*4+1], clp_data[j*4+0]}));331 */332 299 end 333 300 endgenerate … … 338 305 339 306 assign sys_data[j] = (cfg_bits[1][j]) ? (adc_data[j] ^ 12'hfff) : (adc_data[j]); 340 /* 341 amplitude #(.width(12)) amplitude_unit_1 ( 342 .clock(sys_clock), 343 .frame(sys_frame), 344 .reset(cfg_bits[0][2+j]), 345 .cfg_data({1'b0, 12'd0, 12'd5}), 346 // .cfg_data({cfg_bits[7+2*j][12:0], cfg_bits[6+2*j][11:0]}), 347 .inp_data(dec_data[j]), 348 .out_flag(amp_flag1[j]), 349 .out_data(amp_data1[j])); 350 */ 307 351 308 amplitude #(.width(12)) amplitude_unit_2 ( 352 309 .clock(sys_clock), … … 357 314 // .inp_data(dec_data[j]), 358 315 .inp_data(clp_data[j]), 359 .out_flag(amp_flag 2[j]),360 .out_data(amp_data 2[j]));316 .out_flag(amp_flag[j]), 317 .out_data(amp_data[j])); 361 318 end 362 319 endgenerate … … 366 323 .frame(sys_frame), 367 324 .reset(cfg_bits[0][5]), 368 .hst_good((amp_flag 1[0]) & (cnt_good[0]) & (cfg_bits[13][1])),369 .hst_data(amp_data 1[0]),325 .hst_good((amp_flag[0]) & (cnt_good[0]) & (cfg_bits[13][1])), 326 .hst_data(amp_data[0]), 370 327 /* 371 328 .hst_good((amp_flag[j]) & (cnt_good[j]) & (cfg_bits[13][1])), -
sandbox/MultiChannelUSB/clip.v
r144 r154 104 104 - {2'b0, mul_data_wire1}; 105 105 106 assign out_data_wire = 106 assign out_data_wire = add_data_wire[width3-1] ? {(widthr){1'b0}} : 107 107 add_data_wire[shift+widthr-1:shift] 108 108 + {{(widthr-1){add_data_wire[width3-1]}}, add_data_wire[shift-1]}; -
sandbox/MultiChannelUSB/configuration.v
r99 r154 4 4 5 5 input wire bus_ssel, bus_wren, 6 input wire [ 4:0] bus_addr,6 input wire [5:0] bus_addr, 7 7 input wire [15:0] bus_mosi, 8 8 … … 10 10 output wire bus_busy, 11 11 12 output wire [ 511:0] cfg_bits12 output wire [1023:0] cfg_bits 13 13 ); 14 14 15 wire [ 31:0] int_ssel_wire;15 wire [63:0] int_ssel_wire; 16 16 wire [15:0] int_miso_wire; 17 17 reg [15:0] int_miso_reg; 18 18 19 wire [ 511:0] int_bits_wire;19 wire [1023:0] int_bits_wire; 20 20 21 21 integer i; … … 23 23 24 24 generate 25 for (j = 0; j < 32; j = j + 1)25 for (j = 0; j < 64; j = j + 1) 26 26 begin : BUS_OUTPUT 27 27 lpm_ff #( … … 43 43 44 44 lpm_mux #( 45 .lpm_size( 32),45 .lpm_size(64), 46 46 .lpm_type("LPM_MUX"), 47 47 .lpm_width(16), 48 .lpm_widths( 5)) bus_miso_mux_unit (48 .lpm_widths(6)) bus_miso_mux_unit ( 49 49 .sel(bus_addr), 50 50 .data(int_bits_wire), … … 53 53 54 54 lpm_decode #( 55 .lpm_decodes( 32),55 .lpm_decodes(64), 56 56 .lpm_type("LPM_DECODE"), 57 .lpm_width( 5)) lpm_decode_unit (57 .lpm_width(6)) lpm_decode_unit ( 58 58 .data(bus_addr), 59 59 .eq(int_ssel_wire),
Note:
See TracChangeset
for help on using the changeset viewer.