Question about TCL command of modelsim

Hi,

I do not understand the .tcl command, which is issued by Matlab Simulink to run Modelsim in HDL Coder. More specifically, I do not understand the 'after' command below.

After I search some website, I guess 'after' may means after 100 nS. But when it runs, I do not see the 'after' effect. The input and output signals are there as usual. Could you explain that line meaning to me?

................ vsim('tclstart' , ... { 'cd hdlsrc_tb', ... 'vlib work', ... 'vcom Hc_stage1.vhd', ... 'vcom Hc_stage2.vhd', ... 'vcom Hc.vhd', ... 'vsimulink work.Hc', ... 'after 100 add wave -height 200 -radix decimal -format analog-step -scale

0.002 -offset 32000 sim:/Hc/filter_in', ... 'after 100 add wave -height 200 -radix decimal -format analog-step -scale 0.002 -offset 32000 sim:/Hc/filter_out ', ... 'after 100 add wave -height 200 -radix decimal -format analog-step -scale 0.002 -offset 32000 sim:/Hc/ce_out ', ... 'catch { wm geometry $vsimPriv(WaveWindows) 521x600+10+10 }', ... 'catch { wave zoomfull }'}) ................. In the Modelsim window, it shows: ,,,,,,,,,,,, # -- Loading entity hc_stage2 # vsim -foreign {simlinkserver {C:/Program Files/MATLAB/R2011a/toolbox/edalink/extensions/modelsim/windows32/liblfmhdls_tmwvs.dll} } work.Hc # Loading std.standard # Loading ieee.std_logic_1164(body) # Loading ieee.numeric_std(body) # Loading work.hc(rtl)#1 # Loading work.hc_stage1(rtl)#1 # Loading work.hc_stage2(rtl)#1 # Loading C:/Program Files/MATLAB/R2011a/toolbox/edalink/extensions/modelsim/windows32/liblfmhdls_tmwvs.dll # after#672 # after#675 # after#678 # 1 # 0 # ----------------------------------------- # Running Simulink Cosimulation block. # Fri Nov 16 2:22e 2012 # ** Warning: NUMERIC_STD."=": metavalue detected, returning FALSE # Time: 0 ps Iteration: 0 Instance: /hc/u_hc_stage1 # Fri Nov Time 2012 # Simulation halt requested by foreign interface. ................. The 'after' is followed #672 etc. Does this echo have relationship with the tcl 'after'?

Thanks,

Reply to
fl
Loading thread data ...

run Modelsim in HDL Coder. More specifically, I do not understand the 'after' command below.

it runs, I do not see the 'after' effect. The input and output signals are there as usual. Could you explain that line meaning to me?

It doesn't affect your simulation, it simply delays the "add wave command". I suspect vsimulink is using sockets and hence they need to delay the communication between Simulink and Modelsim. You can type the "after 100 add wave.." in the Modelsim transcript window and see the effect.

I am not sure what the number is after the "after" command, anybody?

Hans.

formatting link

0.002 -offset 32000 sim:/Hc/filter_in', ...
0.002 -offset 32000 sim:/Hc/filter_out ', ...
0.002 -offset 32000 sim:/Hc/ce_out ', ...

Files/MATLAB/R2011a/toolbox/edalink/extensions/modelsim/windows32/liblfmhdls_tmwvs.dll} } work.Hc

Files/MATLAB/R2011a/toolbox/edalink/extensions/modelsim/windows32/liblfmhdls_tmwvs.dll

tcl 'after'?

Reply to
HT-Lab

liblfmhdls_tmwvs.dll}

liblfmhdls_tmwvs.dll

formatting link

"after ms Ms must be an integer giving a time in milliseconds."

Regards, Allan

Reply to
Allan Herriman

..

..

Sorry I wasn't clear, I meant the number displayed by Modelsim after the "after" command:

For example:

after 100 echo "Hello World" # after#1668 # Hello World after 100 echo "Hello World" # after#1677 # Hello World after 100 echo "Hello World" # after#1685 # Hello World

Where does 1668,1677 etc come from? It doesn't seem to be related to any of the simstats values.

Not important, just curious,

Hans

formatting link

Reply to
HT-Lab

From the link I posted earlier:

"The after command returns an identifier that can be used to cancel the delayed command using after cancel. "

Regards, Allan

Reply to
Allan Herriman

On 20/11/2012 09:15, Allan Herriman wrote: ..

Ah, yes, I should have RTFWP :-)

Thanks, Hans

formatting link

Reply to
HT-Lab

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.