Set defines of modules
#1
Hello,

throughout the code you can find things like:

Code:
`ifdef QUENTIN_SCM
...
`endif

or

Code:
`ifndef PULP_FPGA_EMUL
...                              
`else
...
`endif

and there are two things about this that i just couldn't figure out.

First: Where are those defines? Let's say i want to use Quentin, where would i put `define QUENTIN_SCM (assuming this is the correct syntax).

Second: Assume i am having three different modules for multiplication mul1, mul2, mul3.
Every module has additional inputs if you want to do floating point multiplication.
This is handled by:
Code:
`ifdef FP_ENABLE
... (additional inputs)
`endif


I tested all three modules with Questasim using a testbench and created a .do file for them.
Now inside my .do file i have the following command:
Code:
set ms [concat mul1 mul2 mul3]
foreach m ${ms} {
  vlog -64 +define+FP_ENABLE ../multis/${m}/rtl/${m}.sv
}


If i now try to use my modules somewhere in PULPissimo i get some errors from my makefile that tell me some ports of the module are missing.
Basically the above command tells the modules mul1, mul2, mul3 that FP_ENABLE is defined and therefore the additional ports are instantiated.
Unfortunately i don't know how to use the same idea when trying to instantiate a mul-module in PULPissimo.
It is important to note that i don't want to change any line of code in the mul-modules!
Does anyone know a way how to tell the modules its defines just like the above command does?

Thank you.
LPLA
Reply


Messages In This Thread
Set defines of modules - by LPLA - 11-12-2019, 04:12 PM
RE: Set defines of modules - by pschiavo - 11-13-2019, 08:51 AM
RE: Set defines of modules - by LPLA - 11-14-2019, 02:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)