-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
166 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
report_timing -delay_type min_max -max_paths 10 -slack_less_than 0 -sort_by group -input_pins -name timing_3 | ||
|
||
set failing_paths [get_timing_paths -delay_type min_max -max_paths 10 -slack_less_than 0 -sort_by group] | ||
report_property [lindex $failing_paths 0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# reportCriticalPaths.tcl | ||
|
||
#------------------------------------------------------------------------ | ||
# This function generates a CSV file that provides a summary of the first | ||
# 50 violations for both Setup and Hold analysis. So a maximum number of | ||
# 100 paths are reported. | ||
# | ||
# #------------------------------------------------------------------------ | ||
proc reportCriticalPaths { fileName } { | ||
# Open the specified output file in write mode | ||
set FH [open $fileName w] | ||
# Write the current date and CSV format to a file header | ||
puts $FH "#\n# File created on [clock format [clock seconds]]\n#\n" | ||
puts $FH "Startpoint,Endpoint,DelayType,Slack,#Levels,#LUTs" | ||
# Iterate through both Min and Max delay types | ||
foreach delayType {max min} { | ||
# Collect details from the 50 worst timing paths for the current analysis | ||
# (max = setup/recovery, min = hold/removal) | ||
# The $path variable contains a Timing Path object. | ||
foreach path [get_timing_paths -delay_type $delayType -max_paths 50 -nworst 1] { | ||
# Get the LUT cells of the timing paths | ||
set luts [get_cells -filter {REF_NAME =~ LUT*} -of_object $path] | ||
# Get the startpoint of the Timing Path object | ||
set startpoint [get_property STARTPOINT_PIN $path] | ||
# Get the endpoint of the Timing Path object | ||
set endpoint [get_property ENDPOINT_PIN $path] | ||
# Get the slack on the Timing Path object | ||
set slack [get_property SLACK $path] | ||
# Get the number of logic levels between startpoint and endpoint | ||
set levels [get_property LOGIC_LEVELS $path] | ||
# Save the collected path details to the CSV file | ||
puts $FH "$startpoint,$endpoint,$delayType,$slack,$levels,[llength $luts]" | ||
} | ||
} | ||
# Close the output file | ||
close $FH | ||
puts "CSV file $fileName has been created.\n" | ||
return 0 | ||
}; # End PROC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function, absolute_import | ||
from future.utils import iterkeys, itervalues, iteritems | ||
|
||
|
||
class AlienNode2g(object): | ||
""" | ||
Utility class to easily build trees of key-values, useful for configuration | ||
tress | ||
""" | ||
def __init__(self): | ||
super(AlienNode2g, self).__init__() | ||
self.__dict__['_locked'] = False | ||
|
||
def __repr__(self): | ||
return str({ k:v for k, v in self.__dict__.iteritems() if not k.startswith('_')}) | ||
|
||
def __getattr__(self, name): | ||
try: | ||
return self.__dict__[name] | ||
except KeyError: | ||
if self._locked or name.startswith('__'): | ||
raise | ||
else: | ||
value = self.__dict__[name] = type(self)() | ||
return value | ||
|
||
def __setattr__(self, name, value): | ||
if name not in self.__dict__ and name.startswith('_'): | ||
raise AttributeError("Attributes starting with '_' are reserved ") | ||
super(AlienNode2g, self).__setattr__(name, value) | ||
|
||
def __getitem__(self, name): | ||
# print('get',name) | ||
tokens = name.split('.',1) | ||
child = getattr(self,tokens[0]) | ||
if len(tokens) == 1: | ||
return child | ||
else: | ||
return child[tokens[1]] | ||
|
||
def __setitem__(self, name, value): | ||
|
||
tokens = name.rsplit('.',1) | ||
if len(tokens) == 1: | ||
setattr(self, name, value) | ||
else: | ||
setattr(self[tokens[0]],tokens[1], value) | ||
|
||
def __iter__(self): | ||
for n,o in self.__dict__.iteritems(): | ||
if n.startswith('_'): | ||
continue | ||
elif isinstance(o, type(self)): | ||
for cn in o: | ||
yield n+'.'+cn | ||
yield n | ||
else: | ||
yield n | ||
|
||
def _iternodes(self): | ||
for n,o in self.__dict__.iteritems(): | ||
if n.startswith('_'): | ||
continue | ||
elif isinstance(o, type(self)): | ||
for cn, co in o._iternodes(): | ||
yield n+'.'+cn, co | ||
else: | ||
yield n,o | ||
#----------------------------------------------------------------------- | ||
|
||
def iternodes(node): | ||
""" | ||
Helper function to iterate over a node tree | ||
:param node: The node | ||
:type node: { type_description } | ||
:returns: { description_of_the_return_value } | ||
:rtype: { return_type_description } | ||
""" | ||
return node._iternodes() | ||
|
||
node = AlienNode2g() | ||
print(node) | ||
print(vars(node)) | ||
print(dir(node)) | ||
print(vars(node)) | ||
print(node.a) | ||
print(node) | ||
|
||
node.b.c = 5 | ||
print(node) | ||
print(node['b.c']) | ||
print(node['b.d']) | ||
print(node['b']['c']) | ||
print(node) | ||
node['l1.l2.l3.l4'] =7 | ||
node.l1.l2.l3.l4=8 | ||
print (node) | ||
for k in node: | ||
print ('-', k) | ||
|
||
|
||
print('locked:', node._locked) | ||
node._locked = True | ||
try: | ||
node.noway.val = 7 | ||
except Exception as e: | ||
print (type(e), e) | ||
|
||
for n in node: | ||
print (n) | ||
|
||
print('b' in node) | ||
|
||
for n in node._iternodes(): | ||
print (n) | ||
|
||
for n in iternodes(node): | ||
print (n) |