Forum Discussion
The Simulation Option has difficulty at handling the \ and " because it's not a Tcl interpreter—it’s just a text field that Quartus (NativeLink) concatenates into a command line. Also nested quoting/escaping in a GUI field is fragile.
I would suggest using another .do script to set path and call the s2p_bram_run_msim_rtl_vhdl.do. For example like below:
parent.do: set FLI_LIB {"cocotb_init [exec cocotb-config --lib-name-path fli questa]\"} do s2p_bram_run_msim_rtl_vhdl.do $FLI_LIB
s2p_bram_run_msim_rtl_vhdl.do: eval "vsim -t 1ps $pd_libs -L work -L rtl_work -voptargs=\"+acc\" -foreign \$1 $ELAB_OPTIONS $DPI_LIBRARIES_ELAB s2p_bram_showahead"
In GUI, you set like this questa=-foreign $1 then it'll become like this questa=-foreign \$1 in .qsf
Then you run parent.do to call the auto-generated s2p_bram_run_msim_rtl_vhdl.do
- MOliv453 days ago
New Contributor
Hi ShengN_altera ,
Thanks for the suggestion, I find it a bit cumbersome to add an extra file in a folder that is automatically generated and cleaned by Quartus. But based on your insights, I found an alternative. Perhaps it is not yet the best solution, but it avoids creating an extra file.
1) First, set an environment variable as follows:export FLI_LIB='\"cocotb_init [exec cocotb-config --lib-name-path fli questa]\"'2) Then, set the simulation option as you suggested, `questa=-foreign $1 `
3) The first simulation attempt will fail, but then one restarts with the following argument parameter:
do user2mon_run_msim_rtl_vhdl.do {$::env(FLI_LIB)}4) Then it works
It is not ideal, because it is hard to make it work with Continuous integration.
Based on this feedback, can you imagine a way that it could already work without restarting the simulation?- ShengN_altera3 days ago
Super Contributor
export as env variable is a way as well.
If you run from nativelink, it'll definitely fail. If the do script s2p_bram_run_msim_rtl_vhdl.do had been generated, not need to run from the nativelink just straight run the do script will do unless there's changes to the path in the do script.