Mini-TLU Simulation Environment
This is some documentation explaining how to build the simulation environment from scratch and start it running.
Assumes Modelsim/ Questasim on Linux
To build simulation:
# Set up firmware directory structure using the setup_workspace.sh script ( see FirmwareBuild )
# Change working directory to the directory where you executed setup_workspace.sh ( N.B. the setup_workspace.sh should have created a sub-directory "workspace" )
# Create a link to the script that sets up the simulation:
ln -s fmc-mtlu/firmware/scripts/setup_simulation.sh .
# Execute the script:
sh setup_simulation.sh
# If everything has worked correctly, there should be a Modelsim Project file created at
workspace/simulation/fmc_tlu_sim.mpf
# Set up a virtual network interface following the instructions in
${FW_WORKSPACE}/IPBus2/firmware/ethernet/sim/readme.txt
( N.B. By default the simulated firmware has an address of
192.168.200.32
# Start the simulator:
vsim -64
# Open the project file created by setup_simulation.sh
# Compile all the files ( "compile all" command )
# Load the simulation by typing into the transcript window:
vsim -64 -t 1ps work.fmctlu_v0_1_testbench(behavior)
# Start the simulation:
run 1ms
# Test that the simulated network interface is working, e.g. by
ping -c 1 192.168.200.32
- the ping command should execute correctly and the Modelsim/Questa transcript window should indicate FLI activity.
- Run the same uHAL/Pychips/Pycohal scripts/programs as you would with the real hardware
Hints
* You will need to edit setup_workspace.sh and change MODELSIM_ROOT ( Location of Modelsim/Questa) , ISE_VHDL_MTI ( Location of Xilinx libraries compiled by Modelsim/Questa ) , ISE_VLOG_MTI to suit your environment.
* You will need to match the 32/64 bit setting of the compiled FLI module with the 32/64 bit mode of Modelsim/Questa. Almost all systems are 64 bit these days, so start the simulator with
vsim -64
- You will need to set up a TAP virtual Ethernet adaptor ( see the write up from IPBus-firmware/ethernet/sim/readme.txt ) in order for the simulation to work.