Forum Discussion
Altera_Forum
Honored Contributor
13 years agoHello,
It's allready some time ago, but I found a solution for QSYS: In the xxx_hw.tcl:# # parameters#
add_parameter CLOCK_RATE POSITIVE 100000000 ""
set_parameter_property CLOCK_RATE DEFAULT_VALUE 100000000
set_parameter_property CLOCK_RATE DISPLAY_NAME CLOCK_RATE
set_parameter_property CLOCK_RATE WIDTH ""
set_parameter_property CLOCK_RATE TYPE POSITIVE
set_parameter_property CLOCK_RATE UNITS Hertz
set_parameter_property CLOCK_RATE DESCRIPTION ""
set_parameter_property CLOCK_RATE HDL_PARAMETER true
set_parameter_property CLOCK_RATE SYSTEM_INFO_TYPE CLOCK_RATE
set_parameter_property CLOCK_RATE SYSTEM_INFO_ARG clock
# # parameters for system.h# set in ELABORATION_CALLBACK because only then, the parameters are set...#
set_module_property ELABORATION_CALLBACK elaborate
proc elaborate {} {
set_module_assignment embeddedsw.CMacro.FREQ u
}
This gives the folowing line in system.h: #define MODULE_NAME_FREQ 100000000u This solution is not realy documented somewhere. But it looks like set_module_assignment embeddedsw.CMacro.XXX text defines #define MODULE_NAME_XXX text For the clock frequenty, this can only be done in the elaborate callback because the clock is not known at loading time. Regards, Hannes