Skip to content

Commit bd1cbef

Browse files
committed
write_sdc -mode
Signed-off-by: James Cherry <cherry@parallaxsw.com>
1 parent f622da7 commit bd1cbef

7 files changed

Lines changed: 58 additions & 11 deletions

File tree

doc/ChangeLog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ OpenSTA Timing Analyzer Release Notes
44
This file summarizes user visible changes for each release.
55
See ApiChangeLog.txt for changes to the STA api.
66

7+
2026/05/01
8+
----------
9+
10+
The write_sdc command supports a -mode argument.
11+
12+
read_sdc [-mode mode]
13+
714
2026/03/23
815
----------
916

include/sta/Sta.hh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,13 @@ public:
10411041
const Scene *scene,
10421042
const MinMax *min_max,
10431043
int digits);
1044+
void writeSdc(std::string_view filename,
1045+
std::string_view mode_name,
1046+
bool leaf,
1047+
bool native,
1048+
int digits,
1049+
bool gzip,
1050+
bool no_timestamp);
10441051
void writeSdc(const Sdc *sdc,
10451052
std::string_view filename,
10461053
// Map hierarchical pins and instances to leaf pins and instances.

sdc/Sdc.i

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ private:
9494

9595
void
9696
write_sdc_cmd(std::string filename,
97-
bool leaf,
98-
bool compatible,
99-
int digits,
100-
bool gzip,
101-
bool no_timestamp)
97+
std::string mode_name,
98+
bool leaf,
99+
bool compatible,
100+
int digits,
101+
bool gzip,
102+
bool no_timestamp)
102103
{
103104
Sta *sta = Sta::sta();
104-
const Sdc *sdc = sta->cmdSdc();
105-
sta->writeSdc(sdc, filename, leaf, compatible, digits, gzip, no_timestamp);
105+
sta->writeSdc(filename, mode_name, leaf, compatible, digits, gzip, no_timestamp);
106106
}
107107

108108
void

sdc/Sdc.tcl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,18 @@ proc_redirect read_sdc {
6262
################################################################
6363

6464
define_cmd_args "write_sdc" \
65-
{[-map_hpins] [-digits digits] [-gzip] [-no_timestamp] filename}
65+
{[-mode mode] [-map_hpins] [-digits digits] [-gzip] [-no_timestamp] filename}
6666

6767
proc write_sdc { args } {
68-
parse_key_args "write_sdc" args keys {-digits -significant_digits} \
68+
parse_key_args "write_sdc" args keys {-mode -digits} \
6969
flags {-map_hpins -compatible -gzip -no_timestamp}
7070
check_argc_eq1 "write_sdc" $args
7171

72+
set mode [cmd_mode]
73+
if { [info exists keys(-mode)] } {
74+
set mode $keys(-mode)
75+
}
76+
7277
set digits 4
7378
if { [info exists keys(-digits)] } {
7479
set digits $keys(-digits)
@@ -80,7 +85,7 @@ proc write_sdc { args } {
8085
set no_timestamp [info exists flags(-no_timestamp)]
8186
set map_hpins [info exists flags(-map_hpins)]
8287
set native [expr ![info exists flags(-compatible)]]
83-
write_sdc_cmd $filename $map_hpins $native $digits $gzip $no_timestamp
88+
write_sdc_cmd $filename $mode $map_hpins $native $digits $gzip $no_timestamp
8489
}
8590

8691
################################################################

sdf/Sdf.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ define_cmd_args "write_sdf" \
180180

181181
proc_redirect write_sdf {
182182
parse_key_args "write_sdf" args \
183-
keys {-corner -scene -divider -digits -significant_digits} \
183+
keys {-corner -scene -divider -digits} \
184184
flags {-include_typ -gzip -no_timestamp -no_version}
185185
check_argc_eq1 "write_sdf" $args
186186
set scene [parse_scene keys]

search/Search.i

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,12 @@ cmd_mode_name()
816816
return Sta::sta()->cmdMode()->name();
817817
}
818818

819+
Mode *
820+
cmd_mode()
821+
{
822+
return Sta::sta()->cmdMode();
823+
}
824+
819825
void
820826
set_cmd_mode(std::string mode_name)
821827
{
@@ -828,6 +834,12 @@ find_modes(std::string mode_name)
828834
return Sta::sta()->findModes(mode_name);
829835
}
830836

837+
Mode *
838+
find_mode(std::string mode_name)
839+
{
840+
return Sta::sta()->findMode(mode_name);
841+
}
842+
831843
////////////////////////////////////////////////////////////////
832844

833845
CheckErrorSeq &

search/Sta.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,6 +2206,22 @@ Sta::checkExceptionToPins(ExceptionTo *to,
22062206
}
22072207
}
22082208

2209+
void
2210+
Sta::writeSdc(std::string_view filename,
2211+
std::string_view mode_name,
2212+
bool leaf,
2213+
bool native,
2214+
int digits,
2215+
bool gzip,
2216+
bool no_timestamp)
2217+
{
2218+
Mode *mode = findMode(mode_name);
2219+
if (mode)
2220+
writeSdc(mode->sdc(), filename, leaf, native, digits, gzip, no_timestamp);
2221+
else
2222+
report_->warn(1561, "mode {} not found.", mode_name);
2223+
}
2224+
22092225
void
22102226
Sta::writeSdc(const Sdc *sdc,
22112227
std::string_view filename,

0 commit comments

Comments
 (0)