Simulate
The IP Manager automatically generates a testbench and top-level file for simulation based on the settings you made in the wizard, including the top-level file generation, I/O connection to the testbench, simulation models, and stimulus such as clock and reset. The testbench bypasses the SPI flash data retrieval step to speed up simulation.
Note: If you manually assign addresses to the peripherals, the default simulation may not
function correctly.
- Open a terminal.
- Change to the Testbench directory for your SoC.
- Set up the Efinity environment:
- Linux:
source /<path to Efinity>/bin/setup.sh - Windows:
c:\<path to Efinity>\bin\setup.bat
- Linux:
- Run the simulation using the default application with the command
Python3 run.py.Note: The default application requires UART 0 to be turned on.Note: If you want to include the SPI flash retrieval step (requires SPI 0 to be turned on), run the simulation with the command:Python3 run.py -f
A successful simulation returns the following
messages
# 0 -----------------------------------------
# 0 [EFX_INFO]: Start executing helloWorld TEST
# 0 -----------------------------------------
# 51315 -----------------------------------------
# 51315 [EFX_INFO]: Receiving uart data from soc
# 51315 -----------------------------------------
# 2121065 -----------------------------------------
# 2121065 [EFX_INFO]: TEST PASSED
# 2121065 [EFX_INFO]: Hello World from Efinix!
# 2121065 ----------------------------------------- To simulate with a different application instead of the default, use the
command:
Python3 run.py -b <path to application>/app.binWhen you use a non-default application, the testbench bypasses the default driver and
monitor sequences and displays warning messages.
# 0 -----------------------------------------
# 0 [EFX_INFO]: Executing custom binary file...
# 0 [EFX_WARN]: Skipped testbench default driver and monitor sequences.
# 0 [EFX_INFO]: Running simulation...
# 0 -----------------------------------------You need to develop your own sequence for your application.
The default simulator is Modelsim or Questasim. To run the simulation with Aldec Riviera
simulator, look for
ALDEC_PATH on the top part of
run.py, uncomment the line, and set the path to your Aldec Riviera
simulator installation
path.#ALDEC_PATH=Path('PUT', 'YOUR', 'OWN', 'ALDEC', 'PATH')Then run the simulation command with “tool”
argument:
Python3 run.py --tool aldec