Matthew Guthaus
11/12/2021, 9:37 PMproc save_state {args} {
set ::env(INIT_ENV_VAR_ARRAY) [split [array names ::env] " "]
puts_info "FOOSaving Runtime Environment"
and definitely gets called:
[INFO]: Saving Runtime Environment
invalid command name "17"
while executing
"17"
("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 "flow_fail" line 6)
invoked from within
"flow_fail"
(procedure "try_catch" line 25)
invoked from within
Mitch Bailey
11/13/2021, 12:36 AMOPENLANE_ROOT
is pointing to the directory hierarchy that you're modifying? I made changes to save_state
and prep
and they were reflected in the docker run.
I guess if you're already in docker, you could check /openLANE_flow/scripts/tcl_commands/all.tcl
to see if the changes are actually there.Matthew Guthaus
11/13/2021, 1:00 AMMitch Bailey
11/13/2021, 1:08 AMspm
to use a bus clock and was able to duplicate the problem. It'll I think what happens is that the <design>/config.tcl
has the definition set ::env(CLOCK_PORT) {clk[1]}
, however when then variable is written to <design>/runs/<tag>/config.tcl
it's converted to ``set ::env(CLOCK_PORT) "clk[1]"` .
Maybe you've already come up with a solution but it looks like
If you change scripts/utils/utils.tcl
like this
proc set_log {var val filepath log_flag} {
- set cmd "set ${var} \"${val}\""
+ if { [string first {[} "$val"] != -1 } {
+ set cmd "set ${var} \{${val}\}"
+ } else {
+ set cmd "set ${var} \"${val}\""
+ }
uplevel #0 ${cmd}
set global_cfg_file [open $filepath a+]
it works with set ::env(CLOCK_PORT) {clk[1]}
.
This will quote with {}
only the variables that contain [
.
You can't quote all variable with {}
because the python report program parses the config.tcl
file and can't handle {}
for the values that it needs. Shall I do a PR?flow.tcl
or caravel_user_project/Makefile
?Maximo Balestrini
11/13/2021, 11:43 AMmake -n xxxx
) and it seems to be mounting my openlane directory in the docker's`/openLANE_Flow`, but I guess it then uses the one in /openlane
so it doesn't see the changes.Matthew Guthaus
11/13/2021, 3:34 PMdonn
11/13/2021, 3:35 PM/openlane
instead of /openLANE_flow
. If the caravel makefile still tries to mount to /openLANE_flow
, that’s a problem.Matthew Guthaus
11/13/2021, 4:02 PMMitch Bailey
11/13/2021, 4:11 PM[ERROR]: during executing: "openroad -python /openlane/scripts/generate_reports.py
It looks like it tries to calculate utilization or something from 2 of the variable in the saved config.tcl file. I guess, since it's python, it can convert "
quoted strings, but not {}
quoted strings.Matthew Guthaus
11/13/2021, 6:26 PM[INFO]: Saving Runtime Environment
invalid command name "17"
while executing
"17"
("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 "flow_fail" line 6)
invoked from within
"flow_fail"
(procedure "try_catch" line 25)
invoked from within
"try_catch $::env(OPENROAD_BIN) -exit $::env(SCRIPTS_DIR)/openroad/or_opendp.tcl |& tee $::env(TERMINAL_OUTPUT) [index_file $::env(opendp_log_file_tag)..."
(procedure "detailed_placement_or" line 6)
invoked from within
"detailed_placement_or"
(procedure "run_routing" line 32)
invoked from within
"run_routing"
(procedure "run_routing_step" line 10)
invoked from within
"[lindex $step_exe 0] [lindex $step_exe 1] "
(procedure "run_non_interactive_mode" line 43)
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[1]: *** [Makefile:43: user_project_wrapper] Error 1
make[1]: Leaving directory '/home/mrg/demo/openram_testchip/openlane'
make: *** [Makefile:70: user_project_wrapper] Error 2
mrg@diode ~/demo/openram_testchip (main)$ echo $OPENLANE_ROOT
/home/mrg/demo/openlane
mrg@diode ~/demo/openram_testchip (main)$ cd $OPENLANE_ROOT
mrg@diode ~/demo/openlane ((HEAD detached at mpw-3a))$ make mount
cd /home/mrg/demo/openlane && \
docker run -it --rm -v /home/mrg/demo/openlane:/openlane -v /home/mrg/demo:/home/mrg/demo -e PDK_ROOT=/home/mrg/demo --user 1000:1000 efabless/openlane:mpw-3a
bash-4.2$ grep FOO /openlane/scripts/tcl_commands/all.tcl
puts_info "FOOSaving Runtime Environment"
puts_info {HIHIHI}
exit 1
It should exit before it runs the flow, but mine doesn't! Yet the change is shown in flow.tcl inside docker.docker run -it -v $(OPENLANE_ROOT):/openLANE_flow \
-v $(PDK_ROOT):$(PDK_ROOT) \
-v $(PWD)/..:/project \
-v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \
-e PDK_ROOT=$(PDK_ROOT) \
-e CARAVEL_ROOT=$(CARAVEL_ROOT) \
-u $(shell id -u $(USER)):$(shell id -g $(USER)) \
$(OPENLANE_IMAGE_NAME) sh -c $(OPENLANE_BASIC_COMMAND);\
So, there are TWO COPIES of the openlane scripts when running a design using the Caravel Makefile. One in /openlane and one in /openLANE_flow. The one that ships with the docker image is used according to the command line:
OPENLANE_BASIC_COMMAND = "cd /project/openlane && flow.tcl -design ./$* -save_path .. -save -tag $* -overwrite"
but that is a mistake!
@User @UserMaximo Balestrini
11/13/2021, 8:43 PMMatthew Guthaus
11/13/2021, 8:44 PMOPENLANE_BASIC_COMMAND = "cd /project/openlane && flow.tcl -design ./$* -save_path .. -save -tag $* -overwrite"