Forum Discussion

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

export custom SOPC component generics to system.h

I have written a custom SOPC builder component in VHDL. I have also written a <sopc_component>_hw.tcl file to allow it to be instantiated in SOPC builder.

Is there a way to export some of the settings that I set in SOPC builder for the component to my system.h file which is used for the NIOS II IDE?

For instance, lets say my custom SOPC component is a video processing block and I can set the input video frame's rows and columns as parameters in my custom SOPC builder component. Is there a way to get whatever values I set for rows and columns so that I can read it in my C program running on the NIOS (without having to set it by hand)? In other words, I want there to be an entry in my system.h file with something like:

# define SOPC_COMPONENT_0_COLUMNS 640# define SOPC_COMPONENT_0_ROWS 480

that would be generated automatically when I build my system library files.

Do I need to build a <sopc_component>_sw.tcl file in order to do this? I have not found any clear examples in the manuals about how to do what I want to do.

3 Replies

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

    I would contact your FAE. There has been intermittent support for this through versions for those who knew the commands. The current TCL method does not define any way of doing this. I recall recently that Altera had a special hidden script for doing this with some indication that there would be support in SoPC builder in the future. I'll dig through my old stuff and see what I can find.

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

    jake... thanks this works!!

    just like this:

    set_module_assignment embeddedsw.CMacro.COLS_IN \ [get_parameter_value COLS_IN]

    set_module_assignment embeddedsw.CMacro.ROWS_IN \ [get_parameter_value ROWS_IN]

    yields the following output in my system.h file:

    # define AVALON_COMPONENT_0_COLS_IN 640# define AVALON_COMPONENT_0_ROWS_IN 480

    thanks!