Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

VHDL-Generics appeareing as "#define" in system.h

Altera_Forum
Honored Contributor II
1,732 Views

Hello, 

 

is there a way to propagate hardwareparameters of Avalon-Components to system.h 

 

SOPC-Builder provides possibility to set values of generics, used in component's top level VHDL-files during instantiation of compoents. 

How can the value, chosen within SOPC-Builder be propagated to e.g. system.h? 

 

For my current projects i always have to make sure, that chosen generics match '#defines' for software projects. 

 

 

THX 

Josef
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
837 Views

Did you ever get this to work? I would like to be able to do this. 

Regards, 

Rich
0 Kudos
Altera_Forum
Honored Contributor II
837 Views

I realised I was trying to do something a bit different to the just getting a generic because my generic was set-able by the user. 

The answer to my problem was to edit the hw.tcl file with the following 

 

set_module_assignment embeddedsw.CMacro.TX_ARBITERLOCK [get_parameter_property allow_tx_arbiterlock HDL_PARAMETER] 

set_module_assignment embeddedsw.CMacro.RX_ARBITERLOCK [get_parameter_property allow_rx_arbiterlock HDL_PARAMETER] 

 

Hope this helps someone one day, 

Rich
0 Kudos
Altera_Forum
Honored Contributor II
837 Views

ok, all that did was say whether the items were HDL parameters. I needed to add a validation callback in the tcl file e.g.  

 

set_module_property VALIDATION_CALLBACK validate 

 

then at the bottom define the function 

 

proc validate {} {  

set_module_assignment embeddedsw.CMacro.TX_ARBITERLOCK [get_parameter_value allow_tx_arbiterlock] 

set_module_assignment embeddedsw.CMacro.RX_ARBITERLOCK [get_parameter_value allow_rx_arbiterlock] 

which does seem to work
0 Kudos
Reply