17.1.5 Simulating Your Design
(Ask a Question)To simulate your design outside of Libero (that is, using your own simulation environment and simulator), perform the following steps:
- Design Files:
- Pre-Synthesis simulation:
- Import your RTL into your simulation project.
- For each Component Manifests Report.
- Import each file under HDL source files for all Synthesis and Simulation tools into your simulation project.
- Compile these files as per your simulator's instructions.
- Post-synthesis simulation:
- Import your post-synthesis *.vm netlist (generated in Synthesizing Your Design) into your simulation project and compile it.
- Post-layout simulation:
- First, complete implementing your design (see Implementing Your Design). Ensure that your final Libero project is in post-layout state.
- Double-click Generate
BackAnnotated Files in the Libero Design Flow
window. It generates two
files:
<project directory>/designer/<root>/<root>_ba.v/vhd <project directory>/designer/<root>/<root>_ba.sdf
- Import both of these files into your simulation tool.
- Pre-Synthesis simulation:
- Stimulus and Configuration files:
- For each Component Manifests Report:
- Copy all files under the Stimulus Files for all Simulation Tools sections to the root directory of your Simulation project.
- Ensure that any Tcl files in the preceding lists (in step 2.a) are executed first, before the start of simulation.
UPROM.mem
: If you use the UPROM core in your design with the option Use content for simulation enabled for one or more data storage clients that you wish to simulate, you must use the executable pa4rtupromgen (pa4rtupromgen.exe on windows) to generate the UPROM.mem file. Thepa4rtupromgen
executable takes the UPROM.cfg file as inputs through a Tcl script file and outputs the UPROM.mem file required for simulations. This UPROM.mem file must be copied to the simulation folder prior to the simulation run. An example showing thepa4rtupromgen
executable usage is provided in the following steps. The UPROM.cfg file is available in the directory <Project>/component/work/<uPROM component name>/<uPROM instance name> in the Libero project that you used to generate the UPROM component.snvm.mem
: If you use the System Services core in your design and configured the sNVM tab in the core with the option Use content for simulation enabled for one or more clients that you wish to simulate, a snvm.mem file is automatically generated to the directory <Project>/component/work/<PolarFire System Services component name>/<uPROM instance name> in the Libero project that you used to generate the System Services component. This snvm.mem file must be copied to the simulation folder prior to the simulation run.
- For each Component Manifests Report:
- Create a working folder and a sub-folder named
simulation under the working folder.
The
pa4rtupromgen
executable expect the presence of the simulation sub folder in the working folder and the*.tcl
script is placed in the simulation sub folder. - Copy the
UPROM.cfg
file from the first Libero project created for component generation into the working folder. - Paste the following commands in a
*.tcl script and place it in the simulation folder created in step
3.
Sample *.tcl for PolarFire and PolarFire Soc Family devices to generate URPOM.mem file from UPROM.cfg set_device -fam <family> -die <internal_die_name> -pkg <internal_pkg_name> set_input_cfg -path <path_to_UPROM.cfg> set_sim_mem -path <path_to_UPROM_Initialization_File/UPROM.mem> gen_sim -use_init false
For the proper internal name to use for the die and package, see the *.prjx file of the first Libero project (used for component generation).
The argument use_init must be set to false.
Use the set_sim_mem command to specify the path to the output file UPROM.mem that is generated upon execution of the script file with the
pa4rtupromgen
executable. - At the command prompt or
cygwin terminal, go to the working directory created in step 3. Execute the
pa4rtupromgen
command with the--script option and pass to it the *.tcl script created in the previous step.For Windows®:<Libero_SoC_release_installation>/designer/bin/pa4rtupromgen.exe \ --script./simulation/<Tcl_script_name>.tcl
For Linux®:<Libero_SoC_release_installation>/bin/pa4rtupromgen --script./simulation/<tcl_script_name>.tcl
- After successful execution of the
pa4rtupromgen
executable, check that theUPROM.mem
file is generated in the location specified in the set_sim_mem command in the *.tcl script. - To simulate the sNVM, copy the snvm.mem file from your first Libero project (used for component configuration) into the top level simulation folder of your simulation project to run simulation (outside of Libero SoC). To simulate UPROM contents, copy the generated UPROM.mem file into the top level simulation folder of your simulation project to run simulation (outside of Libero SoC).
Important: To simulate the functionality of SoC Components, download the pre-compiled PolarFire simulation libraries and import them into your simulation environment as described here. For more details, see Appendix B—Importing Simulation Libraries into
Simulation Environment.