Line 1... |
Line 1... |
##**************************************************************
|
##**************************************************************
|
## Module : virtual_jtag_console.tcl
|
## Module : virtual_jtag_console.tcl
|
## Platform : Windows xp sp2
|
## Platform : Windows xp sp2
|
## Author : Bibo Yang (ash_riple@hotmail.com)
|
## Author : Bibo Yang (ash_riple@hotmail.com)
|
## Organization : www.opencores.org
|
## Organization : www.opencores.org
|
## Revision : 2.1
|
## Revision : 2.2
|
## Date : 2012/03/15
|
## Date : 2012/03/28
|
## Description : Tcl/Tk GUI for the up_monitor
|
## Description : Tcl/Tk GUI for the up_monitor
|
##**************************************************************
|
##**************************************************************
|
|
|
proc reset_fifo {{jtag_index_0 0}} {
|
proc reset_fifo {{jtag_index_0 0}} {
|
device_lock -timeout 5
|
device_lock -timeout 5
|
Line 60... |
Line 60... |
$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_unlock
|
|
}
|
|
if {[format "%d" 0x$pnum]>=511} {
|
|
$log insert end "\nError: Wrong trigger pre-capture value: [format "%d" 0x$pnum]. Expects: 0~510.\n"
|
|
} else {
|
|
device_lock -timeout 5
|
device_virtual_ir_shift -instance_index $jtag_index_2 -ir_value 2 -no_captured_ir_value
|
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 -value_in_hex]
|
set pnum_trig [device_virtual_dr_shift -instance_index $jtag_index_2 -dr_value $pnum -length 10 -value_in_hex]
|
device_unlock
|
device_unlock
|
return $addr_trig
|
|
}
|
}
|
|
return $addr_trig
|
}
|
}
|
|
|
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)"}} {
|
open_device -hardware_name $test_cable -device_name $test_device
|
open_device -hardware_name $test_cable -device_name $test_device
|
# Retrieve device id code.
|
# Retrieve device id code.
|
Line 223... |
Line 229... |
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 [format "%1X" $triggerPnum]
|
config_trig 2 $triggerValue [format "%03X" $triggerPnum]
|
}
|
}
|
|
|
proc startTrigger {} {
|
proc startTrigger {} {
|
global trig_wren
|
global trig_wren
|
global trig_rden
|
global trig_rden
|