Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16911 Discussions

Query clock frequency in Platform Designer component

c-thaler
New Contributor I
612 Views

My platform designer component requires the frequency of the connected clock to derive some values from it.

Is there a way to query the clock frequency from the TCL script?

 

I've already tried with "get_interface_property "clock" "clockRate"" for my component's clock interface. But it is always returning 0. The clock port is connected to a IOPLL Intel FPGA IP.

Labels (1)
0 Kudos
1 Solution
c-thaler
New Contributor I
579 Views

It turns out that a "package require -exact qsys 16.1" statement breaks the "clockRate" property of the clock interface. Probably a bug.

Fortunately, I found a simple workaround. One can use the CLOCK_RATE SYSTEM_INFO function for a parameter:

add_parameter CLOCK_FREQ INTEGER
set_parameter_property CLOCK_FREQ DISPLAY_NAME "CLOCK_FREQ"
set_parameter_property CLOCK_FREQ TYPE INTEGER
set_parameter_property CLOCK_FREQ UNITS Hertz
set_parameter_property CLOCK_FREQ DESCRIPTION "Frequency of the clock connected to the component in Hz."
set_parameter_property CLOCK_FREQ SYSTEM_INFO CLOCK_RATE
set_parameter_property CLOCK_FREQ SYSTEM_INFO_ARG clk

Note that "clk" is the name of the clock interface of the component.

The parameter can then be read by "get_parameter_value CLOCK_FREQ" and will contain the actual frequency of the connected clock in Hz.

View solution in original post

0 Kudos
1 Reply
c-thaler
New Contributor I
580 Views

It turns out that a "package require -exact qsys 16.1" statement breaks the "clockRate" property of the clock interface. Probably a bug.

Fortunately, I found a simple workaround. One can use the CLOCK_RATE SYSTEM_INFO function for a parameter:

add_parameter CLOCK_FREQ INTEGER
set_parameter_property CLOCK_FREQ DISPLAY_NAME "CLOCK_FREQ"
set_parameter_property CLOCK_FREQ TYPE INTEGER
set_parameter_property CLOCK_FREQ UNITS Hertz
set_parameter_property CLOCK_FREQ DESCRIPTION "Frequency of the clock connected to the component in Hz."
set_parameter_property CLOCK_FREQ SYSTEM_INFO CLOCK_RATE
set_parameter_property CLOCK_FREQ SYSTEM_INFO_ARG clk

Note that "clk" is the name of the clock interface of the component.

The parameter can then be read by "get_parameter_value CLOCK_FREQ" and will contain the actual frequency of the connected clock in Hz.

0 Kudos
Reply