The CAM IP example design includes a pre-built DPI library
(cam_dpi.so) for simulation. However, you might need to rebuild
this driver for your target platform or when making modifications.
Understanding the Default Flow
By default, the simulation uses the DPI library from the imports directory. The elaborate script is configured as:
cd cam_0_ex.sim/sim_1/behav/xsim/
elaborate.sh: xelab -sv_root ../../../../imports -sv_lib cam_dpi
For a cam instance cam_0 the driver is
available in the directory: cam_0_ex.gen/sources_1/ip/cam_0/sw/dpi/
Follow the instructions in the README file to rebuild the driver for the target platform, and then use the following command to update the driver binary:
cd cam_0_ex.gen/sources_1/ip/cam_0/sw/dpi
make DPI_PATH="top_cam_tb.AXM"
The driver binary is now up to date: cam_0_ex.gen/sources_1/ip/cam_0/sw/dpi/cam_dpi.so
- Option 1
- Copy the updated driver to the imports
directory.
cp cam_0_ex.gen/sources_1/ip/cam_0/sw/dpi.cam_dpi.so importsThen run the simulation normally:
cd cam_0_ex.sim/sim_1/behav/xsim/ ./compile.sh ./elaborate.sh ./simulate.sh - Option 2
- Modify the elaborate script to point to the new location to edit the
elaborate.sh script
in:
cam_0_ex.sim/sim_1/behav/xsim/From
elaborate.sh: xelab -sv_root ../../../../imports -sv_lib cam_dpiTo
elaborate.sh: xelab -sv_root ../../../../cam_0_ex.gen/sources_1/ip/cam_0/sw/dpi -sv_lib cam_dpiThen run the simulation:
cd cam_0_ex.sim/sim_1/behav/xsim/ ./compile.sh ./elaborate.sh ./simulate.sh