Changeset 161 for trunk/MultiChannelUSB
- Timestamp:
- Jan 24, 2012, 11:16:15 AM (13 years ago)
- Location:
- trunk/MultiChannelUSB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/Paella.v
r159 r161 119 119 wire [11:0] amp_data [2*N-1:0]; 120 120 121 wire [1:0] amp_mux_flag [1:0]; 122 wire [11:0] amp_mux_data [1:0]; 123 121 124 wire cnt_good [N-1:0]; 122 125 wire [15:0] cnt_bits_wire; … … 219 222 .data({int_mux_data[2], int_mux_data[1], int_mux_data[0]}), 220 223 .result(trg_mux_data)); 224 225 lpm_mux #( 226 .lpm_size(3), 227 .lpm_type("LPM_MUX"), 228 .lpm_width(14), 229 .lpm_widths(2)) amp_mux_unit_1 ( 230 .sel(cfg_bits[8][1:0]), 231 .data({ 232 {amp_flag[4], amp_data[4]}, 233 {amp_flag[2], amp_data[2]}, 234 {amp_flag[0], amp_data[0]}}), 235 .result({amp_mux_flag[0], amp_mux_data[0]})); 236 237 lpm_mux #( 238 .lpm_size(3), 239 .lpm_type("LPM_MUX"), 240 .lpm_width(14), 241 .lpm_widths(2)) amp_mux_unit_2 ( 242 .sel(cfg_bits[8][5:4]), 243 .data({ 244 {amp_flag[5], amp_data[5]}, 245 {amp_flag[3], amp_data[3]}, 246 {amp_flag[1], amp_data[1]}}), 247 .result({amp_mux_flag[1], amp_mux_data[1]})); 221 248 222 249 generate … … 302 329 .frame(sys_frame), 303 330 .reset(1'b0), 304 .cfg_data(cfg_bits[6+2*j][11:0]), 331 .cfg_data(cfg_bits[6][11:0]), 332 // .cfg_data(cfg_bits[6+2*j][11:0]), 305 333 .inp_data(clp_data[j]), 306 334 .out_flag(amp_flag[0+2*j]), … … 311 339 .frame(sys_frame), 312 340 .reset(1'b0), 313 .cfg_data(cfg_bits[7+2*j][11:0]), 341 .cfg_data(cfg_bits[7][11:0]), 342 // .cfg_data(cfg_bits[7+2*j][11:0]), 314 343 .inp_data(clp_data[j]), 315 344 .out_flag(amp_flag[1+2*j]), … … 323 352 .frame(sys_frame), 324 353 .reset(cfg_bits[0][5]), 325 .hst_good((amp_flag[0][0]) & (cnt_good[0]) & (cfg_bits[13][1])), 326 .hst_data(amp_data[0]), 327 /* 328 .hst_good((amp_flag[j]) & (cnt_good[j]) & (cfg_bits[13][1])), 329 .hst_data(amp_data[j]), 330 */ 354 .hst_good((amp_mux_flag[0][0]) & (cnt_good[0]) & (cfg_bits[13][1])), 355 .hst_data(amp_mux_data[0]), 331 356 .bus_ssel(bus_ssel[2]), 332 357 .bus_wren(bus_wren), … … 338 363 counter hst_counter_unit ( 339 364 .clock(sys_clock), 340 .frame((sys_frame) & (~amp_ flag[0][1])),365 .frame((sys_frame) & (~amp_mux_flag[0][1])), 341 366 // .frame(sys_frame), 342 367 .reset(cfg_bits[0][8]), … … 366 391 counter rmt_counter_1 ( 367 392 .clock(sys_clock), 368 .frame((sys_frame) & (~amp_ flag[1][1])),393 .frame((sys_frame) & (~amp_mux_flag[1][1])), 369 394 // .frame(sys_frame), 370 395 .reset(cfg_bits[0][12]), … … 400 425 .sclr(((sys_frame) & (cnt_good[2]) & (~cnt_good[1])) | (cfg_bits[0][11])), 401 426 .clock(sys_clock), 402 .cnt_en((sys_frame) & (amp_ flag[1][0]) & (cnt_good[1]) & (cnt_good[2]) & (cfg_bits[16][1])),427 .cnt_en((sys_frame) & (amp_mux_flag[1][0]) & (cnt_good[1]) & (cnt_good[2]) & (cfg_bits[16][1])), 403 428 .q(cnt_bits_wire)); 404 429 -
trunk/MultiChannelUSB/UserInterface.tcl
r159 r161 7 7 package require zlib 8 8 9 wm minsize . 1000 7009 wm minsize . 990 660 10 10 11 11 namespace eval ::mca { … … 237 237 238 238 MuxDisplay instproc start {} { 239 my instvar config chan_val 239 my instvar config chan_val hstmux 240 240 241 241 set chan_val(1) 0 … … 246 246 set chan_val(6) 0 247 247 248 set hstmux(1) 0 249 set hstmux(2) 0 250 248 251 trace add variable [myvar chan_val] write [myproc chan_val_update] 249 252 trace add variable [myvar polar] write [myproc polar_update] 253 trace add variable [myvar hstmux] write [myproc hstmux_update] 250 254 251 255 $config(1).chan_1_1 select … … 257 261 258 262 for {set i 1} {$i <= 3} {incr i} { 259 $config(7).polar$i select 260 } 263 $config(7).polar_$i select 264 } 265 266 $config(8).hstmux_1_1 select 267 $config(9).hstmux_2_1 select 261 268 } 262 269 … … 276 283 277 284 foreach {osc title} $oscList { 278 set config($osc) [labelframe ${master}.mux_$osc -borderwidth 1 -relief sunken -text $title ]285 set config($osc) [labelframe ${master}.mux_$osc -borderwidth 1 -relief sunken -text $title -font {-weight bold}] 279 286 280 287 foreach {ch dummy} $adcList { … … 294 301 } 295 302 set column [expr {($osc - 1) % 3}] 296 set row [expr {($osc - 1) / 3 * 2 + 1}] 297 grid $config($osc) -row $row -column $column -sticky news -padx 10 298 } 299 300 set config(7) [labelframe ${master}.mux_8 -borderwidth 1 -relief sunken -text {polarity inversion}] 303 set row [expr {($osc - 1) / 3 + 1}] 304 grid $config($osc) -row $row -column $column -sticky news -padx 10 -pady 10 305 } 306 307 set config(7) [labelframe ${master}.mux_7 -borderwidth 1 -relief sunken -text {Polarity inversion} -font {-weight bold}] 308 set config(8) [labelframe ${master}.mux_8 -borderwidth 1 -relief sunken -text {Spectrum histogram} -font {-weight bold}] 309 set config(9) [labelframe ${master}.mux_9 -borderwidth 1 -relief sunken -text {Rate histogram} -font {-weight bold}] 301 310 for {set i 1} {$i <= 3} {incr i} { 302 checkbutton $config(7).polar$i -text "ADC $i" -variable [myvar polar($i)] 303 grid ${config(7)}.polar$i 304 } 305 grid $config(7) -row 2 -column 3 -sticky news -padx 10 311 set value [expr {$i - 1}] 312 313 checkbutton $config(7).polar_$i -text "ADC $i" -variable [myvar polar($i)] 314 grid ${config(7)}.polar_$i 315 316 radiobutton $config(8).hstmux_1_$i -text "ADC $i" -variable [myvar hstmux(1)] -value $value 317 grid ${config(8)}.hstmux_1_$i 318 319 radiobutton $config(9).hstmux_2_$i -text "ADC $i" -variable [myvar hstmux(2)] -value $value 320 grid ${config(9)}.hstmux_2_$i 321 } 322 grid $config(7) -row 3 -column 0 -sticky news -padx 10 -pady 50 323 grid $config(8) -row 3 -column 1 -sticky news -padx 10 -pady 50 324 grid $config(9) -row 3 -column 2 -sticky news -padx 10 -pady 50 306 325 307 326 grid columnconfigure ${master} 0 -weight 1 308 327 grid columnconfigure ${master} 1 -weight 1 309 328 grid columnconfigure ${master} 2 -weight 1 310 grid columnconfigure ${master} 3 -weight 1311 329 312 330 grid rowconfigure ${master} 0 -weight 1 … … 339 357 340 358 $controller usbCmd 0002000100040${value} 359 } 360 361 # ------------------------------------------------------------------------- 362 363 MuxDisplay instproc hstmux_update args { 364 my instvar controller hstmux 365 366 set value [format {%x%x} $hstmux(2) $hstmux(1)] 367 368 $controller usbCmd 00020008000400${value} 341 369 } 342 370
Note:
See TracChangeset
for help on using the changeset viewer.