Forum Discussion
Stop_at_clocks substitute in Quartus Standard
- 4 years ago
Hi Pawel,
Got some ideas from software experts. Please try them and let me know if things work for you.
The following procedures take a node or a pin, and return the list of all clock targets feeding it. You should be able to modify these to make them return the clock target(s) feeding the register. You can then create a map of clock targets to clock names, so that you can find the clocks that exist on those targets. Once you have the clocks, you can simply string-compare them against each other to see if they are equivalent (since clock names are unique).
proc get_clock_targets_feeding_node { node } {
set my_clocks [list]
foreach_in_collection path [get_path -to [get_object_info -name [get_edge_info -src [get_node_info -clock_edges $node]]]] {
lappend my_clocks [get_object_info -name [get_path_info -from $path]]
}
return $my_clocks
}
proc get_clock_targets_feeding_pin { pin } {
set my_clocks [list]
foreach_in_collection path [get_path -to $pin] {
lappend my_clocks [get_object_info -name [get_path_info -from $path]]
}
return $my_clocks
}
Regards
Hi Pawel,
Got some ideas from software experts. Please try them and let me know if things work for you.
The following procedures take a node or a pin, and return the list of all clock targets feeding it. You should be able to modify these to make them return the clock target(s) feeding the register. You can then create a map of clock targets to clock names, so that you can find the clocks that exist on those targets. Once you have the clocks, you can simply string-compare them against each other to see if they are equivalent (since clock names are unique).
proc get_clock_targets_feeding_node { node } {
set my_clocks [list]
foreach_in_collection path [get_path -to [get_object_info -name [get_edge_info -src [get_node_info -clock_edges $node]]]] {
lappend my_clocks [get_object_info -name [get_path_info -from $path]]
}
return $my_clocks
}
proc get_clock_targets_feeding_pin { pin } {
set my_clocks [list]
foreach_in_collection path [get_path -to $pin] {
lappend my_clocks [get_object_info -name [get_path_info -from $path]]
}
return $my_clocks
}
Regards
- paw_934 years ago
New Contributor
Dear @Ash_R_Intel
Thank you very much for providing these functions. I think I have succeeded with my goal. Of course it needs to be tested and used in a larger design, but in a minimal case it works perfectly.
To make it work properly I need to derive pll clocks with -use_net_name attribute.
derive_pll_clocks -use_net_name
I also had to add a function that returns a clock from a target - the working principle is opposite to the "-target" attribute:
#provide a target, receive clock
proc returnClkFromTarget {targetIn} {
set clks [all_clocks]
set clkOut ""
foreach_in_collection clk $clks {
set target [get_clock_info -targets $clk]
if {[get_object_info -name $targetIn] == [get_object_info -name $target]} {
set clkOut $clk
}
}
puts [get_clock_info -name $clkOut]
puts "net found"
return $clkOut
}Now having all these functions above it is possible to obtain a clock and find a period:
set clkOut_o [get_clock_targets_feeding_node $regOut]
set clkOut [returnClkFromTarget $clkOut_o]set out_period [get_clock_info -period $clkOut]
Thank you once again and have a nice day!
Pawel