Question about TCL command of modelsim

F

fl

Guest
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,
 
On 16/11/2012 19:31, fl wrote:
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?
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.
www.ht-lab.com




................
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,
 
On Sat, 17 Nov 2012 09:05:22 +0000, HT-Lab wrote:

On 16/11/2012 19:31, fl wrote:
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?

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.
www.ht-lab.com




................
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'?

http://www.tcl.tk/man/tcl/TclCmd/after.htm

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

Regards,
Allan
 
On 18/11/2012 11:04, Allan Herriman wrote:
On Sat, 17 Nov 2012 09:05:22 +0000, HT-Lab wrote:

On 16/11/2012 19:31, fl wrote:
Hi,

...

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

Hans.
www.ht-lab.com

...

http://www.tcl.tk/man/tcl/TclCmd/after.htm

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

Regards,
Allan

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
www.ht-lab.com
 
On Mon, 19 Nov 2012 15:55:06 +0000, HT-Lab wrote:

On 18/11/2012 11:04, Allan Herriman wrote:
On Sat, 17 Nov 2012 09:05:22 +0000, HT-Lab wrote:

On 16/11/2012 19:31, fl wrote:
Hi,

..

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

Hans.
www.ht-lab.com

..

http://www.tcl.tk/man/tcl/TclCmd/after.htm

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

Regards,
Allan

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,

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
 
On 20/11/2012 09:15, Allan Herriman wrote:
...
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,


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
Ah, yes, I should have RTFWP :)

Thanks,
Hans
www.ht-lab.com
 

Welcome to EDABoard.com

Sponsor

Back
Top