Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
18 years ago

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

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

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

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

    Regards,

    Rich
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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