The TCL components allows you to have a component who's behavior is defined by a TCL script.
![]() |
REDS console |
![]() |
TCL generic |
The TCL script is launched by a Logisim into a wrapper.
The wrapper serves an API that is compatible with the Questasim/Modelsim API to run simulations. Only a few functions are proposed :
examine <signal>
/top_sim/component2/Signal_2_i
will become Signal_2_i
.examine Signal_2_i(3)
) is not supported.force <signal> <value>
/top_sim/component2/Signal_2_i
will become Signal_2_i
.run
At each simulation step, the wrapper calls a refresh {}
callback. You may usually put the code necessary to read the inputs, compute the output, refresh the GUI and set the outputs in this wrapper.
The refresh callback is not allowed to contain the run
function call. If you do so, you will create en infinite loop, as the run
function makes a simulation step that will call the refresh callback.
refresh {} {
# Read inputs with examine function
# Compute some values
# Refresh the UI
# Set the outputs with force function
}