Skip to content

Commit b553e63

Browse files
committed
CodingGuildlines
Signed-off-by: James Cherry <[email protected]>
1 parent 76324bb commit b553e63

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

doc/CodingGuidelines.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ private order.
105105
friend class Frobulator;
106106
}
107107

108+
Class member functions should not be defined inside the class unless they
109+
are simple accessors that return a member variable.
110+
108111
Avoid using [] to lookup a map value because it creates a key/null value
109112
pair if the lookup fails. Use map::find or sta::Map::findKey instead.
110113

@@ -114,6 +117,11 @@ Avoid all use of global variables as "caches", even if they are thread local.
114117
OpenSTA goes to great lengths to minimize global state variable that prevent
115118
multiple instances of the Sta class from coexisting.
116119

120+
Do not use thread_local variables. They are essentially global
121+
variables so they prevent multiple instances of an Sta object from
122+
existing concurrently, so they sbould also be avoided. Use stack state
123+
in each thread instead.
124+
117125
Regression Tests
118126
................
119127

@@ -129,11 +137,17 @@ Tests log files and results are in test/results. The result/test.log
129137
is compared to test.ok to determine if a test passes.
130138

131139
Test scripts are written in tcl and live in the /test directory.
132-
Compress large liberty, verilog, and spef, files and use existing
133-
libraries to prevent repository bloat.
140+
Compress large liberty, verilog, and spef, files., Use small or
141+
existing verilog and liberty files to prevent repository bloat.
134142

135143
The test script should use a one line comment at the beginning of the
136144
file so head -1 can show what it is for. Use file names to roughly
137145
group regressions and use numeric suffixes to distinguish them.
138146

139147
The script test/save_ok saves a test/results/<test>.log to test/<test>.okfile.
148+
149+
To add a new regression:
150+
add <test>.tcl to /tcl
151+
add <test> name to test/regression_vars.tcl
152+
run <test> with test/regression <test>
153+
use save_ok <test> to save the log file to >test>.log

0 commit comments

Comments
 (0)