An I2C verification environment, which uses
memories and VPI (c code) to
drive and monitor data to/from DUT, will be described in this work.
-
In this site many verification environments have been presented, using,
specman
,
VHDL
etc....
The main page of this work is accessed with the following
link.
This page describes the simple script, which is used in this project.
-
First all output files, generated by this script are deleted.
Second comes compilation of c first and verilog second.
If all goes well, simulation is started.
-
Two options are suggested for c compilation. If the gcc option is
selected, then -MD
can be used to instruct the compiler to generate a dependency
file (.d), which is useful debug feature.
#!/bin/bash
rm *.vvp *.vcd *.o *.vpi
#iverilog-vpi tb_vpi.c || exit
gcc -MD -c -fpic tb_vpi.c
gcc -shared -o tb_vpi.vpi tb_vpi.o -lvpi
iverilog -otb_vpi.vvp -ctb.f || exit
vvp -M. -mtb_vpi tb_vpi.vvp || echo fail
The tb_vpi.d file looks like:
tb_vpi.o: tb_vpi.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
...
/usr/include/vpi_user.h /usr/include/_pli_types.h \
/usr/include/inttypes.h /usr/include/stdint.h /usr/include/bits/wchar.h
-
The c code of this project is described at:
c code
|