Line 112... |
Line 112... |
set addr_sim_len [expr $addr_sim_len+40]
|
set addr_sim_len [expr $addr_sim_len+40]
|
return 0
|
return 0
|
}
|
}
|
}
|
}
|
|
|
proc config_trig {{jtag_index_2 2} {trig 00000000000000}} {
|
proc config_trig {{jtag_index_2 2} {trig 00000000000000} {pnum 0}} {
|
global log
|
global log
|
set trig_leng [string length $trig]
|
set trig_leng [string length $trig]
|
if {$trig_leng!=14} {
|
if {$trig_leng!=14} {
|
$log insert end "\nError: Wrong trigger condition length: [expr $trig_leng-2]. Expects: 4+8.\n"
|
$log insert end "\nError: Wrong trigger condition length: [expr $trig_leng-2]. Expects: 4+8.\n"
|
} else {
|
} else {
|
#device_lock -timeout 5
|
#device_lock -timeout 5
|
#device_virtual_ir_shift -instance_index $jtag_index_2 -ir_value 1 -no_captured_ir_value
|
#device_virtual_ir_shift -instance_index $jtag_index_2 -ir_value 1 -no_captured_ir_value
|
#set addr_trig [device_virtual_dr_shift -instance_index $jtag_index_2 -dr_value $trig -length 56 -value_in_hex]
|
#set addr_trig [device_virtual_dr_shift -instance_index $jtag_index_2 -dr_value $trig -length 56 -value_in_hex]
|
|
#device_virtual_ir_shift -instance_index $jtag_index_2 -ir_value 2 -no_captured_ir_value
|
|
#set addr_trig [device_virtual_dr_shift -instance_index $jtag_index_2 -dr_value $pnum -length 10]
|
#device_unlock
|
#device_unlock
|
global trig_sim_act
|
global trig_sim_act
|
global trig_sim_num
|
global trig_sim_num
|
global trig_sim_len
|
global trig_sim_len
|
append trig_sim_act (0,1,1,[format "%X" 2]),
|
append trig_sim_act (0,1,1,[format "%X" 2]),
|
set trig_sim_num [expr $trig_sim_num+1]
|
set trig_sim_num [expr $trig_sim_num+1]
|
set trig_sim_len [expr $trig_sim_len+2]
|
set trig_sim_len [expr $trig_sim_len+2]
|
append trig_sim_act (0,2,$trig,[format "%X" 56]),
|
append trig_sim_act (0,2,$trig,[format "%X" 56]),
|
set trig_sim_num [expr $trig_sim_num+1]
|
set trig_sim_num [expr $trig_sim_num+1]
|
set trig_sim_len [expr $trig_sim_len+56]
|
set trig_sim_len [expr $trig_sim_len+56]
|
|
append trig_sim_act (0,1,2,[format "%X" 2]),
|
|
set trig_sim_num [expr $trig_sim_num+1]
|
|
set trig_sim_len [expr $trig_sim_len+2]
|
|
append trig_sim_act (0,2,[format "%X" $pnum],[format "%X" 10]),
|
|
set trig_sim_num [expr $trig_sim_num+1]
|
|
set trig_sim_len [expr $trig_sim_len+10]
|
return 0
|
return 0
|
}
|
}
|
}
|
}
|
|
|
proc open_jtag_device {{test_cable "USB-Blaster [USB-0]"} {test_device "@2: EP2SGX90 (0x020E30DD)"}} {
|
proc open_jtag_device {{test_cable "USB-Blaster [USB-0]"} {test_device "@2: EP2SGX90 (0x020E30DD)"}} {
|
Line 267... |
Line 275... |
}
|
}
|
|
|
proc initTrigConfig {} {
|
proc initTrigConfig {} {
|
global triggerAddr
|
global triggerAddr
|
global triggerData
|
global triggerData
|
|
global triggerPnum
|
if {[set triggerAddr]==""} {
|
if {[set triggerAddr]==""} {
|
set triggerAddr ffff
|
set triggerAddr ffff
|
}
|
}
|
if {[set triggerData]==""} {
|
if {[set triggerData]==""} {
|
set triggerData a5a5a5a5
|
set triggerData a5a5a5a5
|
}
|
}
|
|
if {[set triggerPnum]==""} {
|
|
set triggerPnum 0
|
|
}
|
}
|
}
|
|
|
proc updateTrigger {{trigCmd 0}} {
|
proc updateTrigger {{trigCmd 0}} {
|
global triggerAddr
|
global triggerAddr
|
global triggerData
|
global triggerData
|
|
global triggerPnum
|
global trig_wren
|
global trig_wren
|
global trig_rden
|
global trig_rden
|
global trig_aden
|
global trig_aden
|
global trig_daen
|
global trig_daen
|
set triggerValue [format "%1X" [expr $trig_aden*8+$trig_daen*4+0]]
|
set triggerValue [format "%1X" [expr $trig_aden*8+$trig_daen*4+0]]
|
append triggerValue [format "%1X" [expr $trig_wren*8+$trig_rden*4+$trigCmd]]
|
append triggerValue [format "%1X" [expr $trig_wren*8+$trig_rden*4+$trigCmd]]
|
append triggerValue $triggerAddr
|
append triggerValue $triggerAddr
|
append triggerValue $triggerData
|
append triggerValue $triggerData
|
config_trig 2 $triggerValue
|
config_trig 2 $triggerValue $triggerPnum
|
}
|
}
|
|
|
proc startTrigger {} {
|
proc startTrigger {} {
|
global trig_wren
|
global trig_wren
|
global trig_rden
|
global trig_rden
|
global trig_aden
|
global trig_aden
|
global trig_daen
|
global trig_daen
|
set trigEnable [expr $trig_wren+$trig_rden+$trig_aden+$trig_daen]
|
set trigEnable [expr $trig_wren+$trig_rden+$trig_aden+$trig_daen]
|
if {$trigEnable>0} {
|
if {$trigEnable>0} {
|
updateTrigger 2
|
updateTrigger 2
|
#reset_fifo 0
|
reset_fifo 0
|
#query_usedw 0
|
query_usedw 0
|
updateTrigger 3
|
updateTrigger 3
|
} else {
|
} else {
|
updateTrigger 0
|
updateTrigger 0
|
}
|
}
|
}
|
}
|
Line 317... |
Line 330... |
}
|
}
|
|
|
proc read_fifo_content {} {
|
proc read_fifo_content {} {
|
global log
|
global log
|
global fifoUsedw
|
global fifoUsedw
|
#$log insert end "\n****************************************\n"
|
$log insert end "\n****************************************\n"
|
for {set i 0} {$i<$fifoUsedw} {incr i} {
|
for {set i 0} {$i<$fifoUsedw} {incr i} {
|
set fifoContent [read_fifo 0]
|
set fifoContent [read_fifo 0]
|
set ok_trig [expr [format "%d" 0x[string index $fifoContent 0]]/2]
|
set ok_trig [expr [format "%d" 0x[string index $fifoContent 0]]/2]
|
set wr_cptr [expr [format "%d" 0x[string index $fifoContent 0]]%2]
|
set wr_cptr [expr [format "%d" 0x[string index $fifoContent 0]]%2]
|
set ad_cptr [string range $fifoContent 1 4]
|
set ad_cptr [string range $fifoContent 1 4]
|
Line 513... |
Line 526... |
entry .console.trig.trigvalue_data -textvar triggerData -width 8
|
entry .console.trig.trigvalue_data -textvar triggerData -width 8
|
checkbutton .console.trig.trigaddr -text {@Addr:} -variable trig_aden
|
checkbutton .console.trig.trigaddr -text {@Addr:} -variable trig_aden
|
checkbutton .console.trig.trigdata -text {@Data:} -variable trig_daen
|
checkbutton .console.trig.trigdata -text {@Data:} -variable trig_daen
|
checkbutton .console.trig.wren -text {@WR} -variable trig_wren
|
checkbutton .console.trig.wren -text {@WR} -variable trig_wren
|
checkbutton .console.trig.rden -text {@RD} -variable trig_rden
|
checkbutton .console.trig.rden -text {@RD} -variable trig_rden
|
pack .console.trig.wren .console.trig.rden \
|
label .console.trig.pnum -text {Pre-Capture:}
|
|
entry .console.trig.trigvalue_pnum -textvar triggerPnum -width 4
|
|
pack .console.trig.pnum .console.trig.trigvalue_pnum \
|
|
.console.trig.wren .console.trig.rden \
|
.console.trig.trigaddr .console.trig.trigvalue_addr \
|
.console.trig.trigaddr .console.trig.trigvalue_addr \
|
.console.trig.trigdata .console.trig.trigvalue_data \
|
.console.trig.trigdata .console.trig.trigvalue_data \
|
.console.trig.starttrig \
|
.console.trig.starttrig \
|
-side left -ipadx 0
|
-side left -ipadx 0
|
initTrigConfig
|
initTrigConfig
|