17.2.10 Appendix C—Importing Simulation Libraries into Simulation Environment

The default simulator for RTL simulation with Libero SoC is ModelSim ME Pro. Pre-compiled libraries for the default simulator is available with Libero installation at directory<install_location>/Designer/lib/modelsimpro/precompiled/vlog for supported families.

Libero SoC also supports other third-party simulators editions of ModelSim, Questasim, VCS, Xcelium, Active HDL, and Riviera Pro. Download respective pre-compiled libraries from Libero SoC v12.0 and later based on the simulator and its version.

Similar to the Libero environment, run.do file must be created to run simulation outside Libero.

Create a simple run.do file that has commands to establish library for compilation results, library mapping, compilation, and simulation. Follow the steps to create a basic run.do file.
  1. Create a logical library to store compilation results using vlib command

    vlib presynth.

  2. Map the logical library name to pre-compiled library directory using vmap command vmap <logical_name> <pre-compiled directory path>.
  3. Compile source files—use language-specific compiler commands to compile design files into working directory.
    • vlog for .v/.sv
    • vcom for .vhd
  4. Load the design for simulation using the vsim command by specifying name of any top-level module.
  5. Simulate the design using run command.

After loading the design, simulation time is set to zero, and you can enter run command to begin simulation.

In the simulator transcript window, execute run.do file as do run.do to run the simulation. Sample run.do file as follows.

quietly set ACTELLIBNAME PolarFire quietly set PROJECT_DIR "W:/Test/basic_test" if {[file exists presynth/_info]} { echo "INFO: Simulation library presynth exists" } else { file delete -force presynth vlib presynth } vmap presynth presynth vmap PolarFire "X:/Libero/Designer/lib/modelsimpro/precompiled/vlog/PolarFire" vlog -sv -work presynth "${PROJECT_DIR}/hdl/top.v" vlog "+incdir+${PROJECT_DIR}/stimulus" -sv -work presynth "${PROJECT_DIR}/stimulus/tb.v" vsim -L PolarFire -L presynth -t 1ps presynth.tb add wave /tb/* run 1000ns log /tb/* exit