Harald Pretl
01/20/2022, 2:37 PMconfig.tcl
? I am using e.g. io_in[34]
as clk in the user area.
set ::env(CLOCK_PORT) “????”
set ::env(CLOCK_NET) “????”Tim Edwards
01/20/2022, 2:40 PMHarald Pretl
01/20/2022, 2:43 PMManar Abdelatty
01/20/2022, 2:59 PMio_in[34]
, but you might need to escape the square brackets
set ::env(CLOCK_PORT) "io_in\[34\]"
Mitch Bailey
01/20/2022, 4:24 PMset ::env(CLOCK_PORT) {io_in[34]}
I believe this is how variables are quoted in the recent changes to config.tcl
(see the automatically generated <design>/runs/tag/config.tcl
)Harald Pretl
01/20/2022, 5:03 PMHarald Pretl
01/20/2022, 5:19 PMset ::env(CLOCK_PORT) {io_in\[34\]}
this works 🙂Harald Pretl
01/20/2022, 7:01 PMinvalid command name "34"
Harald Pretl
01/20/2022, 7:02 PMinvalid command name "34"
while executing
"34"
("uplevel" body line 1)
invoked from within
"uplevel #0 ${cmd}"
(procedure "set_log" line 3)
invoked from within
"set_log ::env($index) $escaped_env_var $::env(GLB_CFG_FILE) 1"
(procedure "save_state" line 9)
invoked from within
"save_state"
(procedure "run_non_interactive_mode" line 68)
invoked from within
"run_non_interactive_mode {*}$argv"
invoked from within
"if { [info exists flags_map(-interactive)] || [info exists flags_map(-it)] } {
puts_info "Running interactively"
if { [info exists arg_values(-file)..."
(file "/openlane/flow.tcl" line 356)
make: *** [Makefile:43: user_proj_dac] Error 1
@User any idea why it crashes, or another solution instead of set ::env(CLOCK_PORT) {io_in\[34\]}
Tim Edwards
01/20/2022, 7:19 PMMitch Bailey
01/21/2022, 12:54 AMMitch Bailey
01/21/2022, 3:37 AMCLOCK_PORT
stored in <design_name>/runs/<tag>/config.tcl
? It may be stored twice in that file, check both if it is.Harald Pretl
01/21/2022, 7:33 AMOPENLANE_TAG=mpw-3a OPENLANE_IMAGE_NAME=efabless/openlane:mpw-3a
from `…/config.tcl`:
set ::env(CLOCK_PORT) "io_in\[34\]"
it is only stored once.Mitch Bailey
01/21/2022, 10:20 AMconfig.tcl
file. The original is located just below the design directory and contains only the variables that the designer has set.
The second is located under the runs/<tag> directory and stores all the variables from the first config file plus all the internal variable (including the current state) from running flow.tcl. What is the value of CLOCK_PORT
in the second file?
I don't believe mpw-3a has the changes required to use a bus signal as a clock.
IIRC, the the following changes to openlane's scripts/utils/utils.tcl
is all you need.
# puts a variable in a log file
proc set_log {var val filepath log_flag} {
- set cmd "set ${var} \"${val}\""
- uplevel #0 ${cmd}
- set global_cfg_file [open $filepath a+]
- if { $log_flag } {
- puts $global_cfg_file $cmd
- }
- close $global_cfg_file
+ set cmd "set ${var} \{${val}\}"
+ uplevel #0 ${cmd}
+ set global_cfg_file [open $filepath a+]
+ if { $log_flag } {
+ puts $global_cfg_file $cmd
+ }
+ close $global_cfg_file
}
The set cmd
line change is the only relevant line. The other changes are just spaces.Mitch Bailey
01/21/2022, 10:31 AMHarald Pretl
01/21/2022, 4:02 PMscripts/utils/utils.tcl
you proposed, still crash. Here a bit more from the crash site, seems to be after CVC:
CVC: Log output to /project/openlane/user_proj_dac/runs/user_proj_dac/results/cvc/cvc_user_proj_dac.log
CVC: End: Fri Jan 21 15:57:33 2022
[INFO]: Saving Magic Views in /project
[INFO]: Calculating Runtime From the Start...
[INFO]: flow completed for user_proj_dac/2022.01.21_15.52.00 in 0h5m33s
[INFO]: Saving Runtime Environment
invalid command name "34"
while executing
"34"
("uplevel" body line 1)
invoked from within
"uplevel #0 ${cmd}"
(procedure "set_log" line 3)
invoked from within
"set_log ::env($index) $escaped_env_var $::env(GLB_CFG_FILE) 1"
(procedure "save_state" line 9)
invoked from within
"save_state"
(procedure "run_non_interactive_mode" line 68)
invoked from within
"run_non_interactive_mode {*}$argv"
invoked from within
"if { [info exists flags_map(-interactive)] || [info exists flags_map(-it)] } {
puts_info "Running interactively"
if { [info exists arg_values(-file)..."
(file "/openlane/flow.tcl" line 356)
make: *** [Makefile:43: user_proj_dac] Error 1
Mitch Bailey
01/21/2022, 4:05 PMgrep CLOCK_ /project/openlane/user_proj_dac/runs/user_proj_dac/config.tcl
?Harald Pretl
01/21/2022, 4:31 PMset ::env(CLOCK_BUFFER_FANOUT) "16"
set ::env(CLOCK_PERIOD) "10"
set ::env(CLOCK_PORT) "io_in\[34\]"
set ::env(CLOCK_TREE_SYNTH) "1"
set ::env(CLOCK_WIRE_RC_LAYER) "met5"
set ::env(SYNTH_CLOCK_TRANSITION) "0.15"
set ::env(SYNTH_CLOCK_UNCERTAINITY) "0.25"
set ::env(CLOCK_BUFFER_FANOUT) "16"
Mitch Bailey
01/21/2022, 4:45 PMutil.tcl
should change that (but not totally fix the problem). If you're using make <cell>
in the /project/openlane/user_proj_dac
directory, it may not be using the openlane directory that you expect.
Also, some values in the <design>/runs/<tag>/config.tcl
do not get overwritten. Sometimes deleting this file before rerunning fixes some problems.Mitch Bailey
01/21/2022, 4:53 PMset ::env(CLOCK_BUFFER_FANOUT) {16}
set ::env(CLOCK_PERIOD) {10.0}
set ::env(CLOCK_TREE_SYNTH) {1}
set ::env(CLOCK_WIRE_RC_LAYER) {met5}
So I guess the reporting programs have been modified also.
Another thing you might try is backing out the last change I suggested and using this instead.
+++ b/scripts/tcl_commands/all.tcl
@@ -24,6 +24,8 @@ proc save_state {args} {
if { $index != "INIT_ENV_VAR_ARRAY" && $index != "PS1" } {
set escaped_env_var [string map {\" \\\"} $::env($index)]
set escaped_env_var [string map {\$ \\\$} $escaped_env_var]
+ set escaped_env_var [string map {\[ \\\[} $escaped_env_var]
+ set escaped_env_var [string map {\] \\\]} $escaped_env_var]
set_log ::env($index) $escaped_env_var $::env(GLB_CFG_FILE) 1
}
}
This adds an extra escape before calling set_log
which is where your flow is failing.Harald Pretl
01/21/2022, 6:27 PMuser_clock2
🙂Matthew Guthaus
01/30/2022, 6:37 PM