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
#2
Hello,

We usually put our define in these files: https://github.com/pulp-platform/pulpiss...l/includes

Please, note that we are updating PULPissimo and its IPs during these days and something may be currently not aligned. If you see any issues, please report them to the corresponding GitHub repository in the ISSUE tab.

For what concerns the FP_ENABLE, which IP are you talking about?
I do not understand which is the MUL module in PULPissimo.

Can you help me?
thanks
Davide
Reply
#3
(11-13-2019, 08:51 AM)pschiavo Wrote: Hello,

We usually put our define in these files: https://github.com/pulp-platform/pulpiss...l/includes

Please, note that we are updating PULPissimo and its IPs during these days and something may be currently not aligned. If you see any issues, please report them to the corresponding GitHub repository in the ISSUE tab.

Thank you. I suspected that those are the correct files but i made a mistake somewhere else which messed up my includes.
I usually don't update the IPs but you are right of course so thanks for reminding me.
The only thing i changed was the HWPE event ID as mentioned here so i have to be careful when updating.

(11-13-2019, 08:51 AM)pschiavo Wrote: For what concerns the FP_ENABLE, which IP are you talking about?
I do not understand which is the MUL module in PULPissimo.

Can you help me?
thanks
Davide

I should have been clearer about what i mean, my mistake.
The module i was talking about is not part of PULPissimo.

I was talking about a new module, let's say a custom accelerator.
If that module uses a line like:
Code:
`ifdef FP_ENABLE
... (additional inputs)
`endif
Then how are those defines delivered to that module.
Your solution worked wonderfully. I had to set the defines in one of the files you mentioned.
It didn't work before because i made a mistake somewhere else which kept my defines from reaching the module.

Thanks again for the quick help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)