Rebuilding the Software Driver - Rebuilding the Software Driver - 5.1 English - PG319

Semi-Ternary CAM Search v5.1 LogiCORE IP Product Guide (PG319)

Document ID
PG319
Release Date
2026-07-08
Version
5.1 English

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

Important: A common issue when activating the rebuilt driver is if you run the simulation without updating the driver reference, the simulation fails because it continues to use the old driver from the imports directory. To activate the newly rebuilt driver, choose one of the following options:
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 imports

Then 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_dpi

To

elaborate.sh: xelab -sv_root ../../../../cam_0_ex.gen/sources_1/ip/cam_0/sw/dpi -sv_lib cam_dpi

Then run the simulation:

cd cam_0_ex.sim/sim_1/behav/xsim/
./compile.sh
./elaborate.sh
./simulate.sh