From 746cee64e1cd7428af98ac72111fb2ce7d23a184 Mon Sep 17 00:00:00 2001 From: Cyril Koenig Date: Wed, 6 Sep 2023 15:00:57 +0200 Subject: [PATCH] fpga: Corrected vivado sim script --- target/xilinx/sim/setup_simulation.tcl | 17 +++++++---------- target/xilinx/sim/simulate.mk | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/target/xilinx/sim/setup_simulation.tcl b/target/xilinx/sim/setup_simulation.tcl index d12549aea..a14d1b922 100644 --- a/target/xilinx/sim/setup_simulation.tcl +++ b/target/xilinx/sim/setup_simulation.tcl @@ -13,23 +13,20 @@ if { $argc == 1 } { puts "Running with SIMULATOR_PATH=$::env(SIMULATOR_PATH) ; GCC_PATH=$::env(GCC_PATH) ; XILINX_SIMLIB_PATH=$::env(XILINX_SIMLIB_PATH)" -# If you do this part from GUI : -# -simulator questa -# -simulator_exec_path {/usr/pack/questa-2022.3-bt/questasim/bin} -# -gcc_exec_path {/usr/pack/questa-2022.3-bt/questasim/gcc-7.4.0-linux_x86_64/bin} -# -family ... -# -library unisim -# -dir {~/xlib_questa-2022.3} +# Compile the vivado simlib to XILINX_SIMLIB_PATH if { $command == "compile_simlib" } { - compile_simlib -simulator questa -simulator_exec_path {$::env(SIMULATOR_PATH)} \ - -gcc_exec_path {$::env(GCC_PATH)} -family all \ - -language verilog -dir {$::env(XILINX_SIMLIB_PATH)} -verbose + set command "compile_simlib -simulator questa -simulator_exec_path {$::env(SIMULATOR_PATH)} \ + -gcc_exec_path {$::env(GCC_PATH)} -family all -language verilog -library all -dir {$::env(XILINX_SIMLIB_PATH)} -force" + # For some reason this command does not work well when not eval from the string + eval $command +# Export simulation scripts for each ip } elseif { $command == "export_simulation" } { open_project $::env(VIVADO_PROJECT) export_simulation -simulator questa -directory "./ips" -lib_map_path "$::env(XILINX_SIMLIB_PATH)" \ -absolute_path -force -of_objects [get_ips *] +# Unknown command } else { puts "[$argv0] Unknown command: $command" } diff --git a/target/xilinx/sim/simulate.mk b/target/xilinx/sim/simulate.mk index 1005fe307..72449d836 100644 --- a/target/xilinx/sim/simulate.mk +++ b/target/xilinx/sim/simulate.mk @@ -6,7 +6,7 @@ CHS_XIL_SIM_DIR ?= $(CHS_XIL_DIR)/sim -XILINX_SIMLIB_PATH ?= ~/xlib_questa-2022.3_vivado-2022.1 +XILINX_SIMLIB_PATH ?= /home/$(USER)/xlib_questa-2022.3_vivado-2022.1 SIMULATOR_PATH ?= /usr/pack/questa-2022.3-bt/questasim/bin GCC_PATH ?= /usr/pack/questa-2022.3-bt/questasim/gcc-7.4.0-linux_x86_64/bin