Skip to content

Commit

Permalink
Rename set_units to check_units and set_cmd_units to set_units
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy committed Jan 28, 2025
1 parent ff656f2 commit 357ec63
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
12 changes: 6 additions & 6 deletions sdc/Sdc.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@ proc check_path_divider { divider } {

################################################################

define_cmd_args "set_units" \
define_cmd_args "check_units" \
{[-time time_unit] [-capacitance cap_unit] [-resistance res_unit]\
[-voltage voltage_unit] [-current current_unit] [-power power_unit]\
[-distance distance_unit]}

# Note that the set_units command does NOT actually set the units.
# Note that the check_units command does NOT actually set the units.
# It merely checks that the current units are the same as the
# units in the set_units command.
proc set_units { args } {
parse_key_args "set_units" args \
# units in the check_units command.
proc check_units { args } {
parse_key_args "check_units" args \
keys {-capacitance -resistance -time -voltage -current -power -distance} \
flags {}
check_argc_eq0 "set_units" $args
check_argc_eq0 "check_units" $args
check_unit "time" -time "s" keys
check_unit "capacitance" -capacitance "f" keys
check_unit "resistance" -resistance "ohm" keys
Expand Down
8 changes: 4 additions & 4 deletions tcl/CmdUtil.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ proc write_units_json { jsonfile } {

################################################################

define_cmd_args "set_cmd_units" \
define_cmd_args "set_units" \
{[-capacitance cap_unit] [-resistance res_unit] [-time time_unit]\
[-voltage voltage_unit] [-current current_unit] [-power power_unit]\
[-distance distance_unit]}

proc set_cmd_units { args } {
parse_key_args "set_cmd_units" args \
proc set_units { args } {
parse_key_args "set_units" args \
keys {-capacitance -resistance -time -voltage -current -power \
-distance -digits -suffix} \
flags {}

check_argc_eq0 "set_cmd_units" $args
check_argc_eq0 "set_units" $args
set_unit_values "capacitance" -capacitance "f" keys
set_unit_values "time" -time "s" keys
set_unit_values "voltage" -voltage "v" keys
Expand Down
2 changes: 2 additions & 0 deletions test/extras.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Warning: ../examples/gcd_sky130hd.v line 527, module sky130_fd_sc_hd__tapvpwrvgn
opensta
Warning: all_fanin not supported, will return empty list
Warning: all_fanout not supported, will return empty list
Warning: extras.tcl line 11, time scale 1e-12 does not match library scale 1e-09.
Warning: extras.tcl line 11, capacitance scale 1e-15 does not match library scale 1e-12.
4 changes: 4 additions & 0 deletions test/extras.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ set_dont_touch sky130_fd_sc_hd__a2111o_1
echo [get_db program_short_name]
all_fanin -to [get_ports resp_rdy]
all_fanout -from [get_ports req_rdy]

check_units -time ps -resistance kOhm -capacitance fF -voltage V -current mA
set_units -time ps -resistance kOhm -capacitance fF -voltage V -current mA
check_units -time ps -resistance kOhm -capacitance fF -voltage V -current mA

0 comments on commit 357ec63

Please sign in to comment.