Forum Discussion

Luigi_Boy's avatar
Luigi_Boy
Icon for New Contributor rankNew Contributor
3 years ago

Pass a generic or make generic/constant available via qsys

Hi guys

I wanted to ask if there's a possibility to either pass a generic/constant argument to qsys IP or make the defined generic/constant available.

The idea is to define the value of an SPI clock speed only at one place and everything else follows suit. Right now we just instantiate a standard IP block and set the value manually and there's another VHDL file that also utilises the SPI but doesn't know the SPI clock speed resp. we need to manually define it which could be theoretically forgotten if someone changes the value in qsys.

I appreciate any replies and wish a nice time.

Kinda regards

Luigi

9 Replies

    • Luigi_Boy's avatar
      Luigi_Boy
      Icon for New Contributor rankNew Contributor

      Hi,

      Sry for late response. I tried it out. However, I don't see how I can pass this parameter from .qsf file to the IP module or take the value from the IP module. Maybe, I'm missing the connection here somewhat.

      Kinda regards

      Luigi

      • ShengN_altera's avatar
        ShengN_altera
        Icon for Super Contributor rankSuper Contributor

        Hi Luigi,

        Just notice that this SPI Intel FPGA IP originally don't have any HDL Parameter so you can't pass this parameter from .qsf file to the IP module or take the value from the IP module.

        Possible way is to manually create parameter for the slowcount in spi_spi_0_altera_avalon_spi_1923_przinoa.v check screenshot below and link that parameter all the way to top level wrapper. 128000 Hz having 196 clock pulses while 100000 Hz having 250 clock pulses. However, you probably can only pass this parameter to IP module but can't take value from IP module because that module will be getting changed back to original version when IP being regenerated. So may be you can export system as .tcl and read IP value from .tcl.

  • sstrell's avatar
    sstrell
    Icon for Super Contributor rankSuper Contributor

    Are you saying this is a parameter set in a standalone IP that you want to transfer into a lower-level (instantiated) Platform Designer system?

    Or are you saying this is a component already in a PD system that you want to want to pass its parameter value elsewhere in the system (hierarchical system design)?

  • FvM's avatar
    FvM
    Icon for Super Contributor rankSuper Contributor

    set parameter -entity xxx -name yyy zz works for me to set VHDL generics.

  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi,


    Sure, let me know if you still have any further update or concern.


    Thanks,

    Regards,

    Sheng