Centralize compiler macros in a top-level package
There is at least one instance of a compiler macro in CORE-V-MCU that is defined and used in disjointed parts of the RTL. The macro in question is USE_FPU
. It is used in fc_subsystem.sv to set the FPU parameter for the CV32E40P core. The macro is defined in pulp_soc_defines.sv. This is a dangerous situation because the value of USE_FPU
passed to the core is dependent on compile order:
- if
pulp_soc_defines.sv
is compiled beforefc_subsystem.sv
then USE_FPU is 1. - if
fc_subsystem.sv
is compiled beforepulp_soc_defines.sv
then USE_FPU is undefined.
At a minimum, the above situation must be resolved. It would also be a great idea to review all macros in the MCU and ensure that either the macros are defined in a top-level package or define in the module in which they are used.
@gmartin102
, I am assigning this to you as you are the default RTL engineer on this project. Feel free to delegate.