LudwigCRON / reflow

Analog/Digital/Mixed Signal Simulation Flow
6 stars 0 forks source link

C/C++ file and VPI #5

Open LudwigCRON opened 4 years ago

LudwigCRON commented 4 years ago

Nice to have features in Sources.list if found C/C++ files:

LudwigCRON commented 4 years ago

A *.c file can either be a program to compile and load in a ram or a VPI, DPI, PLI extension.

Therefore the proposition is to set a tag on the *.c file in the Sources.list

application.c@PGRM
/models/vpi/tasks.c@VPI

VPI_CFLAGS=...
VPI_LDFLAGS=...
PGRM_CFLAGS=...
PGRM_LDFLAGS=...

The difficulty concerns the compilation of c code as one could decide to include an external library for which a custom compilation is mandatory. So CFLAGS and LDFLAGS parameters should be given.

To load an existing VPI file, could load directly the file

/models/vpi/tasks.vpi

Before these changes are done, iverilog already support vpi loading with -m.

SIM_FLAGS+=-m/home/lcr/projects/models/vpi/tasks.vpi

This is a workaround which make the project not portable as the path is absolute.