cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
254 Views
Registered: ‎11-11-2008

Stand alone xsim relaunch from scripts

I've been attempting to replace my script driven Modelsim environment with xsim.

Calling xvlog / xvhdl with generated project files works well while editing code.

The scripts will also call xelab and xsim to bring up the GUI (which is remarkably slow to invoke).

 

One the simulator has run, a code change might be required.

 

The scripts can call xvlog/xvhdl again, but unlike Modelsim a restart will not pick up the changes.

Ahha, so I need to call xelab as well. :

Simulator compilation completed in 6.98 seconds.
VHDL files 62, Verilog files 4.
Invoking: xelab a_loader_tb -timescale 1ns/1ps -debug typical -s a_loader_tb
Vivado Simulator 2019.2
Copyright 1986-1999, 2001-2019 Xilinx, Inc. All Rights Reserved.
Running: C:/Xilinx/Vivado/2019.2/bin/unwrapped/win64.o/xelab.exe a_loader_tb -timescale 1ns/1p
Multi-threading is on. Using 2 slave threads.
Starting static elaboration
Completed static elaboration
Starting simulation data flow analysis
Completed simulation data flow analysis
ERROR: [XSIM 43-3356] Could not open file xsim.dir/a_loader_tb/xsim.type for writing.
ERROR: [XSIM 43-3915] Encountered a fatal error. Cannot continue. Exiting...

 

So while the GUI is running, it's locked the database even though the simulation has stopped.

Do you have any suggests to inprove the turnaround time while debugging ?

Otherwise I need to save the waveform config. Close the simulator and rerun the whole process.

This is extrememly painful compared to any 3rd party simulator.

 

Thanks,

Mike

 

0 Kudos
6 Replies
Highlighted
Xilinx Employee
Xilinx Employee
158 Views
Registered: ‎07-16-2008

回复: Stand alone xsim relaunch from scripts

Did you try to add -incr to xvlog/xvhdl/xelab to enable incremental mode and rerun the script after coding change?

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Observer
Observer
140 Views
Registered: ‎11-11-2008

回复: Stand alone xsim relaunch from scripts

Thanks graces, I hadn't thought of trying to add this to xelab.

The first run works fine as expected and brings up this simulator gui

..

Built simulation snapshot a_loader_tb
Invoking: xsim a_loader_tb -gui

 

Running the script again while the simulator is up fails as xelab cannot access the files,the simulator must be locking them (it's not running)

 

Invoking: xvlog -incr -v 0 -L work=work -prj C:\dev_replay\_r2\replay_common\cores\loader\tb\sim\v_files.txt -i C:\dev_replay\_r2\replay_common\replay_targets\
R1\tb
Invoking: xvhdl -incr -v 0 -L work=work -prj C:\dev_replay\_r2\replay_common\cores\loader\tb\sim\vhdl_files.txt
Simulator compilation completed in 2.39 seconds.
VHDL files 62, Verilog files 4.
Invoking: xelab -incr a_loader_tb -timescale 1ns/1ps -debug typical -s a_loader_tb
Vivado Simulator 2019.2
Copyright 1986-1999, 2001-2019 Xilinx, Inc. All Rights Reserved.
Running: D:/Xilinx/Vivado/2019.2/bin/unwrapped/win64.o/xelab.exe -incr a_loader_tb -timescale 1ns/1ps -debug typical -s a_loader_tb
Multi-threading is on. Using 6 slave threads.
Starting static elaboration
Completed static elaboration
INFO: [XSIM 43-4323] No Change in HDL. Linking previously generated obj files to create kernel
D:/Xilinx/Vivado/2019.2/tps/mingw/6.2.0/win64.o/nt/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file xs
im.dir/a_loader_tb/xsimk.exe: Permission denied
collect2.exe: error: ld returned 1 exit status

 

Any other ideas? Clearly within your gui framework this works, and it's the invoke and re-setting up for the gui I'm keen to avoid.

At the moment people are using the competitors version of Modelsim and this woks flawlessly, but it would save me some work to use xsim.

Best,

Mike 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
124 Views
Registered: ‎07-16-2008

回复: Stand alone xsim relaunch from scripts

Yes, xsimk.exe needs to be quit for launching the same simulation snapshot again.

You mentioned "within gui framework it works", do you mean "Relaunch" operation from GUI? 

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Observer
Observer
105 Views
Registered: ‎11-11-2008

回复: Stand alone xsim relaunch from scripts

Hi graces

"Yes, xsimk.exe needs to be quit for launching the same simulation snapshot again."

Well, that kinda breaks the whole workflow. Could you ask the developers how this is achievable from a script ?

"do you mean "Relaunch" operation from GUI?"

Yes, however this is not available in script mode :

relaunch_sim
ERROR: [Simtcl 6-182] Missing project settings. It appears that the current simulation was not started from a Vivado project. This command does not function with the stand-alone xsim command.

The fact it can be done however within a project gives me hope I can script it up in the same way.

 

If you run xelab from with the simulator window, you get the same issue (cannot open output file xsim.dir/a_loader_tb/xsimk.exe: Permission denied)

For a laugh, I killed off the xsimk kernel from task manager, and re-ran xelab. Vivado crashed.

It's a real shame as a full function simulator is a real advantage you have over the competition. The inability to rerun the simulator after code changes without tearing down the gui makes it unusable however for design work. Running my script in -incr mode with no code changes takes around 40S on my (fast) workstation to bring the gui up again. Modelsim is petty much instantaneous from a restart.

Even the Cadence simulator we use for ASIC work can do a quick re-elaboration and restart on huge designs.

If you email me I can explain more about the requirements and issues with the toolchain.

/MikeJ

 

#--------------------------------------------------------------------------
# Xilinx xsim v2019.2 (64-bit)
# SW Build: 2700185 on Thu Oct 24 18:46:05 MDT 2019
# IP Build: 2699827 on Thu Oct 24 21:16:38 MDT 2019
# Current time: Thu Mar 05 10:15:42 CET 2020
# Process ID (PID): 12156
# User: Mike
# OS: Windows 7
#
# This report is an indication that an internal application error occurred.
# This information is useful for debugging. Please open a case with Xilinx.
# Technical Support with this file and a testcase attached.
#--------------------------------------------------------------------------
ui.utils.e: ui.frmwork.CommandFailedException: Unknown exception occurred ui.frmwork.CommandFailedException: Unknown exception occurred
at ui.views.simulator.executive.simulationi.SimulationExecutive_getCallStacksData(Native Method)
at ui.views.O.c.a.gzr(SourceFile:1302)

0 Kudos
Highlighted
Observer
Observer
85 Views
Registered: ‎11-11-2008

回复: Stand alone xsim relaunch from scripts

I had a quick play with an example in the gui (Relaunch Simulation)

The relaunch command (which is not available in stand-alone mode) appears to kill off the xsimk.exe file before re-elab

relaunch_sim
Command: launch_simulation -simset sim_1 -mode behavioral

Can you find out what commmands relaunch_sim executes, perhaps I can run part of them?

I note the undocumented -wto flag is used  - but this doesn't seem to help me.

 

INFO: [USF-XSim-61] Executing 'ELABORATE' step in 'C:/dev_replay/zynq/project_2/project_2.sim/sim_1/behav/xsim'
"xelab -wto 62864380e7da4349ab7195b18683d24a --incr --debug typical --relax --mt 2 -L fifo_generator_v13_2_5 -L xil_defaultlib -L unisims_ver -L unimacro_ver -L secureip -L xpm --snapshot tb_wave_gen_behav xil_defaultlib.tb_wave_gen xil_defaultlib.glbl -log elaborate.log"
Vivado Simulator 2019.2
Copyright 1986-1999, 2001-2019 Xilinx, Inc. All Rights Reserved.
Running: C:/Xilinx/Vivado/2019.2/bin/unwrapped/win64.o/xelab.exe -wto 62864380e7da4349ab7195b18683d24a --incr --debug typical --relax --mt 2 -L fifo_generator_v13_2_5 -L xil_defaultlib -L unisims_ver -L unimacro_ver -L secureip -L xpm --snapshot tb_wave_gen_behav xil_defaultlib.tb_wave_gen xil_defaultlib.glbl -log elaborate.log
Using 2 slave threads.
Starting static elaboration
Pass Through NonSizing Optimizer
Completed static elaboration
INFO: [XSIM 43-4323] No Change in HDL. Linking previously generated obj files to create kernel
INFO: [USF-XSim-69] 'elaborate' step finished in '5' seconds
launch_simulation: Time (s): cpu = 00:00:00 ; elapsed = 00:00:05 . Memory (MB): peak = 1058.828 ; gain = 0.000
Vivado Simulator 2019.2

/Mike

0 Kudos
Highlighted
Observer
Observer
77 Views
Registered: ‎11-11-2008

回复: Stand alone xsim relaunch from scripts

I've found a partial work-around.

Once the simulation has run, execute in the tcl command:

>>save_wave_config wave.x

>> close_sim

rerun my scripts which calls xvlog/xhdl/xelab but not xsim this time

in the gui

>> xsim <design_name>

>>open_wave_config wave.x

This gives a reasonable, but not great, turn around time. It does save the 1/2 hour it takes for the gui to launch, so that's progress.

 

I should be able to write a tcl script which I can execute from the GUI to achieve this. Any comments?

Thanks

Mike

 

0 Kudos