-
Notifications
You must be signed in to change notification settings - Fork 68
/
myscriptPerDesign.py
35 lines (28 loc) · 1.39 KB
/
myscriptPerDesign.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SLregisterNewErrorType("[WARN :PY0099]", "Instance \"%s\"", "");
SLoverrideSeverity("[WARN :PY0099]", "WARNING")
def recurseInstance(errors, design, instance):
mod = SLgetInstanceDefinition(instance)
print (SLgetInstanceName(instance), SLgetModuleName(mod))
SLaddError(errors, "[WARN :PY0099]", SLgetInstanceFileName(instance), SLgetInstanceLine(instance), 0, SLgetInstanceName(instance))
nbdefs = SLgetnInstanceChildren(instance)
for i in range(nbdefs):
subinstance = SLgetInstanceChildren(instance,i)
recurseInstance(errors, design, subinstance)
def slUserCallbackPerDesign (errors, design):
nbdefs = SLgetnModuleDefinition(design)
print (nbdefs)
for i in range(nbdefs):
mod = SLgetModuleDefinition(design, i)
print (SLgetModuleName(mod), SLgetModuleFile(mod), SLgetModuleLine(mod))
set = SLcollectAll(SLgetModuleFileContent(mod), SLgetModuleRootNode(mod), slModule_item, False)
print (" ", set)
nbdefs = SLgetnClassDefinition(design)
print (nbdefs)
for i in range(nbdefs):
mod = SLgetClassDefinition(design, i)
print (SLgetClassName(mod), SLgetClassFile(mod), SLgetClassLine(mod), SLgetClassRootNode(mod))
nbdefs = SLgetnTopModuleInstance(design)
print (nbdefs)
for i in range(nbdefs):
instance = SLgetTopModuleInstance(design,i)
recurseInstance(errors, design, instance)