Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- that tutorial has nothing about how to save the master_read_32 <adress> to a variable to present that value saved into a label in GUI interface! Do you know how to do it? --- Quote End --- As I commented, the Tcl code for the client GUI has everything you need. The code for the GUI shows how to control the content of a label or hex entry box by mapping that entry to a text variable, eg., here's the code for the response for a read
# A hex entry box with the default data
set jtag(data) 0
entry $win.f1.e2 -textvariable jtag(data)
-width 12 -justify right
-relief sunken -validate key
-validatecommand {validate_isxdigit %d %P}
and for the corresponding read command
# Pressing the read/write buttons will automatically connect
# to the client if needed. The trace on jtag(socket) will
# cause the connection status GUI elements to update
#
proc read_button {} {
global jtag
# The address and data entry boxes contain only digits,
# so add the leading 0x to the address
set data
# and then strip the response 0x
set jtag(data)
}
Every time read is called, it updates jtag(data), which in turn updates the GUI. Then if you look at jtag_read on the server in jtag_read_cmds.tcl, you will see
# Read 32-bits
puts "SERVER: jtag_read $addr"
if {} {
if {} {
# JTAG connection lost?
jtag_close
error "Error: Check the JTAG interface\n -> '$result'"
}
} else {
if {} {
# JTAG connection lost?
jtag_close
error "Error: Check the JTAG interface\n -> '$result'"
}
}
return $result
which uses master_read_32 to implement the read procedure. You can lump all of this into a single Tcl procedure if you want. Cheers, Dave