#Create your graph (in 3 command lines):
# Create a new window in the VPA
viewpane .myWindow
# Create a graph using the BLT librray inside your new window
blt::graph .myWindow.myGraph -title "My Graph"
# Make your graph visible
pack .myWindow.myGraph
#Create your data vectors (another 3 lines):
# BLT vectors are a good choice when the to record large data sets
# Vector for the x data
blt::vector x
# Vector for the y data
blt::vector y
# Bind vectors to the graph
.myWindow.myGraph element create myGraph0 -xdata x -ydata y -pixels 1
#Populate your graph with data (another 3 lines):
# You can use breakpoints and callbacks to add data to your graphs
[i_SMC91C111/mReceiveFifoLen create_watchpoint] set_callback
"myTraceX;myTraceY"
# To add the current time in NS to the vector:
proc myTraceX {} { x append [expr [vpa::get_current_time] /1000] }
# To add e.g. the receive length of the Ethernet adaptor to the FIFO:
proc myTraceY {} { y append [i_SMC91C111/mReceiveFifoLen
get_value ] }
#Done.
# If you want to allow zooming just add another 2 lines:
Blt_ZoomStack .myWindow.myGraph
Blt_Crosshairs .myWindow.myGraph
Best regards,
Achim