File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -298,6 +298,8 @@ public:
298298 void removeClock (Clock *clk);
299299 // Update period/waveform for generated clocks from source pin clock.
300300 void updateGeneratedClks ();
301+ // Mark that generated clocks need to be updated.
302+ void setUpdateGenclks ();
301303 // True if pin is defined as a clock source (pin may be hierarchical).
302304 bool isClockSrc (const Pin *pin) const ;
303305 // Propagated (non-ideal) clocks.
Original file line number Diff line number Diff line change @@ -3269,7 +3269,7 @@ LibertyReader::visitDividedBy(LibertyAttr *attr)
32693269 int value;
32703270 getAttrInt (attr, value, exists);
32713271 if (exists) {
3272- if (!isPowerOfTwo (value)) {
3272+ if (!isPowerofTwo (value)) {
32733273 libError (1234 , attr, " divided_by must be a power of two." );
32743274 }
32753275 generated_clock_->setDividedBy (value);
@@ -3283,7 +3283,7 @@ LibertyReader::visitMultipliedBy(LibertyAttr *attr)
32833283 int value;
32843284 getAttrInt (attr, value, exists);
32853285 if (exists) {
3286- if (!isPowerOfTwo (value)) {
3286+ if (!isPowerofTwo (value)) {
32873287 libError (1234 , attr, " multiplied_by must be a power of two." );
32883288 }
32893289 generated_clock_->setMultipliedBy (value);
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ Network::clear()
5353{
5454 default_liberty_ = nullptr ;
5555 clearNetDrvrPinMap ();
56- generated_clock_pins_to_cell_ .clear ();
56+ generated_clock_pins_to_cells_ .clear ();
5757}
5858
5959bool
@@ -1224,12 +1224,13 @@ Network::setPathEscape(char escape)
12241224 escape_ = escape;
12251225}
12261226
1227- void Network::addGeneratedClockPintoCell (const char *pinName, LibertyCell *cell)
1227+ void Network::addGeneratedClockPinToCell (const char *pinName, LibertyCell *cell)
12281228{
1229- generated_clock_pins_to_cell_ [pinName]=cell;
1229+ generated_clock_pins_to_cells_ [pinName]=cell;
12301230}
12311231
12321232
1233+
12331234// //////////////////////////////////////////////////////////////
12341235
12351236typedef Vector<InstanceChildIterator *> InstanceChildIteratorSeq;
Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ Clock::generate(const Clock *src_clk)
400400 waveform_->push_back ((*src_wave)[1 ]);
401401 }
402402 else if (divide_by_ > 1 ) {
403- if (isPowerOfTwo (divide_by_)) {
403+ if (isPowerofTwo (divide_by_)) {
404404 period_ = src_clk->period () * divide_by_;
405405 const FloatSeq *src_wave = src_clk->waveform ();
406406 float rise = (*src_wave)[0 ];
@@ -481,7 +481,7 @@ Clock::generateEdgesClk(const Clock *src_clk)
481481}
482482
483483bool
484- isPowerOfTwo (int i)
484+ isPowerofTwo (int i)
485485{
486486 return (i & (i - 1 )) == 0 ;
487487}
Original file line number Diff line number Diff line change @@ -3557,7 +3557,7 @@ Sta::updateGeneratedClks()
35573557}
35583558
35593559void
3560- Sta::setUpdateGenClks ()
3560+ Sta::setUpdateGenclks ()
35613561{
35623562 update_genclks_ = true ;
35633563}
Original file line number Diff line number Diff line change @@ -935,6 +935,37 @@ proc get_clocks_warn { arg_name arglist } {
935935 return $clks
936936}
937937
938+ # Get attribute
939+ sta::define_cmd_args " get_attribute" {args}
940+
941+ proc get_attribute {args} {
942+ sta::parse_key_args " get_attribute" args keys {} flags {-quiet}
943+ set quiet [info exists flags(-quiet)]
944+ set arg1 [lindex $args 0]
945+ set arg2 [lindex $args 1]
946+
947+ # Suppress unknown property warning
948+ if { $quiet } {
949+ suppress_msg 9000
950+ }
951+ if { [sta::is_object $arg1 ] } {
952+ set result [get_property $arg1 $arg2 ]
953+ } elseif { [sta::is_object $arg2 ] } {
954+ set result [get_property $arg2 $arg1 ]
955+ } else {
956+ if { $quiet } {
957+ unsuppress_msg 9000
958+ }
959+ error " get_attribute: invalid object $arg1 or $arg2 "
960+ }
961+ # Re-enable warning after the call
962+ if { $quiet } {
963+ unsuppress_msg 9000
964+ }
965+ return $result
966+ }
967+
968+
938969proc get_net_arg { arg_name arg } {
939970 set net " NULL"
940971 if {[llength $arg ] > 1} {
Original file line number Diff line number Diff line change @@ -269,16 +269,26 @@ proc report_object_names { objects } {
269269define_cmd_args " get_name" {object}
270270define_cmd_args " get_full_name" {object}
271271
272+ # Get Object name
273+ interp alias {} get_object_name {} get_full_name
274+
272275# ###############################################################
273276
274277proc get_name { object } {
275278 return [get_object_property $object " name" ]
276279}
277280
278281proc get_full_name { object } {
282+ if { [llength $object ] > 1 } {
283+ foreach obj $object {
284+ lappend full_names [get_full_name $obj ]
285+ }
286+ return $full_names
287+ }
279288 return [get_object_property $object " full_name" ]
280289}
281290
291+
282292proc sort_by_name { objects } {
283293 return [lsort -command name_cmp $objects ]
284294}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ create_clock -name clk2 -period 100 [get_ports CLK_IN_2]
88puts " Number of clocks: [ llength [get_clocks] ]"
99
1010# Report all clock periods
11- foreach_in_collection clk [get_clocks] {
11+ foreach clk [get_clocks] {
1212 puts " [ get_object_name $clk ] period: [ get_attribute $clk period] "
1313}
1414
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ trimLeft(string &str)
265265}
266266
267267void
268- trim (strin &str)
268+ trim (string &str)
269269{
270270 trimLeft (str);
271271 trimRight (str);
You can’t perform that action at this time.
0 commit comments