Changeset 84 for trunk/MultiChannelUSB/Paella.v
- Timestamp:
- Dec 21, 2009, 5:09:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/Paella.v
r81 r84 8 8 inout wire I2C_SCL, 9 9 inout wire [4:0] CON_A, 10 in out wire [15:0] CON_B,10 input wire [15:0] CON_B, 11 11 input wire [12:0] CON_C, 12 12 input wire [1:0] CON_BCLK, … … 52 52 assign RAM_ADDR = 20'h00000; 53 53 */ 54 assign RAM_CLK = CLK_50MHz;54 assign RAM_CLK = sys_clk; 55 55 assign RAM_CE1 = 1'b0; 56 56 … … 58 58 assign TRG = 4'bz; 59 59 assign CON_A = 5'bz; 60 assign CON_B = 16'bz;61 60 assign USB_PA0 = 1'bz; 62 61 assign USB_PA1 = 1'bz; … … 95 94 .usb_addr(usb_addr), 96 95 97 .clk( CLK_50MHz),96 .clk(sys_clk), 98 97 .aclr(usb_aclr), 99 98 … … 106 105 .rx_q(usb_rx_data) 107 106 ); 108 107 109 108 reg bln_reset [N-1:0]; 110 109 wire [11:0] baseline [N-1:0]; … … 113 112 reg ana_reset [N-1:0]; 114 113 wire ana_peak_ready [N-1:0]; 114 wire ana_peak_debug [N-1:0]; 115 115 116 116 reg osc_reset [N-1:0]; … … 155 155 wire [11:0] data [N-1:0]; 156 156 wire [11:0] int_data [N-1:0]; 157 158 wire cmp_data_ready; 159 wire [11:0] cmp_data; 160 161 wire ept_data_ready; 162 wire [47:0] ept_data; 157 163 164 wire [11:0] nowhere; 165 166 wire sys_clk; 167 168 158 169 /* 159 170 assign osc_thrs[0] = 16'd40; … … 176 187 wire [1:0] uwt_flag3 [N-1:0]; 177 188 178 179 180 189 assign adc_clk[0] = ADC_FCO; 190 assign adc_clk[1] = ADC_FCO; 191 assign adc_clk[2] = ADC_FCO; 181 192 182 193 /* … … 199 210 .c0(adc_pll_clk)); 200 211 */ 201 /* 202 wire tst_adc_clk; 203 wire [11:0] tst_adc_data; 212 213 sys_pll sys_pll_unit( 214 .inclk0(CLK_50MHz), 215 .c0(sys_clk)); 204 216 205 217 test test_unit( 206 .clk(CLK_50MHz), 207 .tst_clk(tst_adc_clk), 208 .tst_data(tst_adc_data)); 209 210 assign adc_clk[2] = tst_adc_clk; 211 assign adc_data[2] = tst_adc_data; 212 */ 213 /* 214 altserial_flash_loader #( 215 .enable_shared_access("OFF"), 216 .enhanced_mode(1), 217 .intended_device_family("Cyclone III")) sfl_unit ( 218 .noe(1'b0), 219 .asmi_access_granted(), 220 .asmi_access_request(), 221 .data0out(), 222 .dclkin(), 223 .scein(), 224 .sdoin()); 225 */ 218 .clk(ADC_FCO), 219 .data(adc_data[2])); 220 // .data(nowhere); 221 226 222 227 223 adc_lvds #( … … 232 228 .lvds_fco(ADC_FCO), 233 229 .lvds_d(ADC_D[2:0]), 234 .adc_data({ adc_data[2], 230 // .adc_data({ adc_data[2], 231 .adc_data({ nowhere, 235 232 adc_data[1], 236 233 adc_data[0] })); … … 250 247 integer j; 251 248 252 always @(posedge CLK_50MHz)249 always @(posedge sys_clk) 253 250 begin 254 251 if (cfg_reset) … … 265 262 end 266 263 264 assign ept_data_ready = cmp_data_ready & data_ready[2] & data_ready[1] & data_ready[0]; 265 assign ept_data = {cmp_data, int_data[2], int_data[1], int_data[0]}; 266 267 adc_fifo cmp_fifo_unit ( 268 .adc_clk(ADC_FCO), 269 .adc_data(CON_B[11:0]), 270 .clk(sys_clk), 271 .data_ready(cmp_data_ready), 272 .data(cmp_data)); 273 267 274 genvar i; 268 275 … … 285 292 .adc_clk(adc_clk[i]), 286 293 .adc_data(adc_data[i]), 287 .clk( CLK_50MHz),294 .clk(sys_clk), 288 295 .data_ready(data_ready[i]), 289 296 .data(int_data[i])); … … 292 299 293 300 uwt_bior31 #(.L(1)) uwt_1_unit ( 294 .clk( CLK_50MHz),301 .clk(sys_clk), 295 302 .data_ready(data_ready[i]), 296 303 .x({20'h00000, data[i]}), … … 301 308 302 309 uwt_bior31 #(.L(2)) uwt_2_unit ( 303 .clk( CLK_50MHz),310 .clk(sys_clk), 304 311 .data_ready(data_ready[i]), 305 312 .x(uwt_a1[i]), … … 310 317 311 318 uwt_bior31 #(.L(3)) uwt_3_unit ( 312 .clk( CLK_50MHz),319 .clk(sys_clk), 313 320 .data_ready(data_ready[i]), 314 321 .x(uwt_a2[i]), … … 319 326 320 327 lpm_mux #( 321 .lpm_size( 5),328 .lpm_size(7), 322 329 .lpm_type("LPM_MUX"), 323 330 .lpm_width(12), 324 331 .lpm_widths(3)) osc_mux_unit ( 325 332 .sel(osc_mux_sel[i][2:0]), 326 .data({ bln_baseline[i], 333 .data({ {ana_peak_debug[i], 11'd0}, 334 hst_data[i], 335 // uwt_d3[i][11:0], 336 bln_baseline[i], 327 337 uwt_a3[i][20:9], 328 338 uwt_a2[i][17:6], … … 332 342 333 343 lpm_mux #( 334 .lpm_size( 5),344 .lpm_size(7), 335 345 .lpm_type("LPM_MUX"), 336 346 .lpm_width(12), 337 347 .lpm_widths(3)) trg_mux_unit ( 338 348 .sel(trg_mux_sel[i][2:0]), 339 .data({ bln_baseline[i], 349 .data({ {ana_peak_ready[i], 11'd0}, 350 hst_data[i], 351 // uwt_d3[i][11:0], 352 bln_baseline[i], 340 353 uwt_a3[i][20:9], 341 354 uwt_a2[i][17:6], … … 364 377 365 378 baseline baseline_unit ( 366 .clk( CLK_50MHz),379 .clk(sys_clk), 367 380 .reset(bln_reset[i]), 368 381 .data_ready(data_ready[i]), … … 372 385 373 386 analyser analyser_unit ( 374 .clk( CLK_50MHz),387 .clk(sys_clk), 375 388 .reset(ana_reset[i]), 376 389 .data_ready(data_ready[i]), 377 390 .uwt_flag(uwt_flag3[i]), 378 .peak_ready(ana_peak_ready[i])); 379 380 assign hst_data[i] = (hst_mux_data[i][12:1] > bln_mux_data[i]) ? (hst_mux_data[i][12:1] - bln_mux_data[i]) : 12'd0; 391 .peak_ready(ana_peak_ready[i]), 392 .peak_debug(ana_peak_debug[i])); 393 394 suppression suppression_unit ( 395 .clk(sys_clk), 396 .data(hst_mux_data[i][12:1]), 397 .baseline(bln_mux_data[i]), 398 .result(hst_data[i])); 399 381 400 assign hst_data_ready[i] = (hst_mux_data[i][0]) & (hst_data[i] >= cfg_hst_threshold[i]); 382 401 383 402 histogram #(.W(32)) histogram_unit ( 384 .clk( CLK_50MHz),403 .clk(sys_clk), 385 404 .reset(hst_reset[i]), 386 405 .data_ready(hst_data_ready[i]), … … 390 409 391 410 trigger trigger_unit ( 392 .clk( CLK_50MHz),411 .clk(sys_clk), 393 412 .reset(trg_reset[i]), 394 413 .data_ready(data_ready[i]), … … 399 418 400 419 oscilloscope oscilloscope_unit ( 401 .clk( CLK_50MHz),420 .clk(sys_clk), 402 421 .reset(osc_reset[i]), 403 422 .data_ready(data_ready[i]), … … 465 484 466 485 i2c_fifo i2c_unit( 467 .clk( CLK_50MHz),486 .clk(sys_clk), 468 487 .aclr(i2c_aclr), 469 488 .wrreq(i2c_wrreq), … … 481 500 482 501 control control_unit ( 483 .clk( CLK_50MHz),502 .clk(sys_clk), 484 503 .cfg_reset(cfg_reset), 485 504 .cfg_src_data(cfg_memory[cfg_src_addr[4:0]]), … … 505 524 .ram_addr(RAM_ADDR), 506 525 .ram_data({RAM_DQA, RAM_DQAP, RAM_DQB, RAM_DQBP}), 526 .ept_data_ready(ept_data_ready), 527 .ept_data(ept_data), 507 528 .i2c_wrreq(i2c_wrreq), 508 529 .i2c_data(i2c_data), … … 510 531 .led(LED)); 511 532 533 /* 534 altserial_flash_loader #( 535 .enable_shared_access("OFF"), 536 .enhanced_mode(1), 537 .intended_device_family("Cyclone III")) sfl_unit ( 538 .noe(1'b0), 539 .asmi_access_granted(), 540 .asmi_access_request(), 541 .data0out(), 542 .dclkin(), 543 .scein(), 544 .sdoin()); 545 */ 546 512 547 endmodule
Note:
See TracChangeset
for help on using the changeset viewer.