Next: , Previous: VPI Debugging, Up: Co-simulation


6.4 VPI Example

Several examples are installed in the /prefix/share/hackt/doc/example/ARCH/vpiprsim-inverters directory, where ARCH is the host-triplet of the machine you are running on, as determined by configure (See hackt version). This example demonstrates several inverters communicating across the hacprsim and VPI boundary, in a shoelace connection.

Copy the contents of the directory to a temporary directory, and rename Makefile.copy (created from template example.mk) to Makefile. The Makefile is already setup to include hackt.mk and provides some basic rules for compiling and running the Verilog simulation. The shoelace.v file is compiled to an executable shoelace.vx which runs the simulation. shoelace.v references inverters.haco-a, which is a prerequisite for running (but not compiling) the simulation executable.

make check will run all the necessary steps in order and print the result of running the executable to stdout. Note that the invocation of the executable is prefixed with an environment extension for LD_LIBRARY_PATH. This is not necessary if you have already included /prefix/lib/hackt (a.k.a. pkglibdir) in your environment.