Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add targets running OpenROAD GUI with Docker image #27

Merged
merged 4 commits into from
May 2, 2024

Conversation

eszpotanski
Copy link
Contributor

This PR adds *_gui targets for Docker flow, which has to be called with run, e.g.:

bazel run L1MetadataArray_full_final_gui

GUI for local flow works fine, apart from synthesis stage, which requires additional LEF files - new target *_gui_synth_make resolves this issue.

Copy link
Collaborator

@oharboe oharboe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits.

Nice initiative. I was going to request targets for the GUI dependencies. The .lib files are needed for the GUI, they contain timing information and as you point out, synthesis has some other dependencies, .lef files, as I recall.

NOTE! You there is a command line version of the gui_ targets, called open_.

Add automated tests to make sure this works, by running:

echo | make open_synth/floorplan/place/crt/5_1_grt.odb/route/final

The above should load everything for the respective stages without errors.

openroad.bzl Outdated
name = target_name + "_" + stage + "_gui",
tools = [Label("//:docker_shell")],
srcs = [make_pattern, design_config, stage_config] + base_targets,
cmd = "echo \"chmod -R +w . && \"" + get_entrypoint_cmd(make_pattern, design_config, stage_config, Label("//:docker_shell"), "gui_" + stage, docker_image = docker_image) + " > $@ ",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which folder is this chmod -R +w in? It should be the bazel-bin folder, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chmod is changing permissions on the current working folder, it should be bazel-bin.

oyvind@small-cigar:~/bazel-orfs$ bazel run L1MetadataArray_full_final_gui
INFO: Invocation ID: 8364ca15-a6c4-4eaf-b6fa-b1738bccb841
INFO: Analyzed target //:L1MetadataArray_full_final_gui (0 packages loaded, 1 target configured).
INFO: Found 1 target...
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-out -> /home/oyvind/.cache/bazel/_bazel_oyvind/6e078b44989a9ce1500a63165a20fd2a/execroot/_main/bazel-out:  /home/oyvind/bazel-orfs/bazel-out (File exists)
Target //:L1MetadataArray_full_final_gui up-to-date:
  bazel-bin/L1MetadataArray_full_final_gui.sh
INFO: Elapsed time: 0.054s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/L1MetadataArray_full_final_gui.sh
/home/oyvind/.cache/bazel/_bazel_oyvind/6e078b44989a9ce1500a63165a20fd2a/execroot/_main/bazel-out/k8-fastbuild/bin/L1MetadataArray_full_final_gui.sh: line 1: bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/docker_shell: No such file or directory
oyvind@small-cigar:~/bazel-orfs$ cat bazel-bin/L1MetadataArray_full_final_gui.shchmod -R +w . && OR_IMAGE=openroad/flow-ubuntu22.04-builder:latest DESIGN_CONFIG=bazel-out/k8-fastbuild/bin/L1MetadataArray_full_config.mk STAGE_CONFIG=bazel-out/k8-fastbuild/bin/L1MetadataArray_full_final_config.mk MAKE_PATTERN=./final-bazel.mk RULEDIR=bazel-out/k8-fastbuild/bin bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/docker_shell make gui_final

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a leftover which should be removed during rebase, now it's gone

@oharboe
Copy link
Collaborator

oharboe commented Apr 18, 2024

I am unable to get this to work from megaboom:

$ git diff | cat
diff --git a/.bazelrc b/.bazelrc
index 1fefebc..1cc1b92 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -1,2 +1,3 @@
 build --incompatible_strict_action_env
 build --spawn_strategy=local
+build --remote_cache=https://storage.googleapis.com/megaboom-bazel-artifacts --google_credentials=/home/oyvind/Downloads/innate-diode-408109-9c5d0543f9b3.json --remote_cache_compression=true
diff --git a/MODULE.bazel b/MODULE.bazel
index 84bf612..375ec83 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -5,12 +5,12 @@ module(
 )
 
 bazel_dep(name = "bazel-orfs")
-git_override(
-    module_name = "bazel-orfs",
-    remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
-    commit = "c4fc0c549fde78560f5504e823c1283895e1effe",
-)
-
-#local_path_override(
-#    module_name = "bazel-orfs", path = "../bazel-orfs"
+#git_override(
+#    module_name = "bazel-orfs",
+#    remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
+#    commit = "c4fc0c549fde78560f5504e823c1283895e1effe",
 #)
+
+local_path_override(
+    module_name = "bazel-orfs", path = "../bazel-orfs"
+)
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
index 6d9b9cc..6855ca6 100644
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -1,6 +1,6 @@
 {
   "lockFileVersion": 3,
-  "moduleFileHash": "13f80b1a5a0afc3c54e277230468d706e9635dd12bef30eb3dbad8571c1eac28",
+  "moduleFileHash": "c45e4d867d41f680d6d969336dcbebe781a17f6f3a7ee1435f0b87906b05754b",
   "flags": {
     "cmdRegistries": [
       "https://bcr.bazel.build/"
@@ -13,6 +13,7 @@
     "compatibilityMode": "ERROR"
   },
   "localOverrideHashes": {
+    "bazel-orfs": "2aca7cf8613c58b798ea6d8c170ebd5b597f1db83a21c7135f4a3925551c6506",
     "bazel_tools": "922ea6752dc9105de5af957f7a99a6933c0a6a712d23df6aad16a9c399f7e787"
   },
   "moduleDepGraph": {

Produces:

oyvind@small-cigar:~/megaboom$ bazel build BoomTile_synth_sdc
INFO: Invocation ID: 7906f391-5110-4930-8b9b-3887c2de15bc
INFO: Analyzed target //:BoomTile_synth_sdc (81 packages loaded, 387 targets configured).
ERROR: /home/oyvind/megaboom/BUILD.bazel:817:15: Executing genrule //:BoomTile_synth_sdc failed: (Exit 2): bash failed: error executing Genrule command (from target //:BoomTile_synth_sdc) /bin/bash -c ... (remaining 1 argument skipped)
++ uuidgen
+ uuid=6774601a-3e68-44be-9d9c-8df5ee143ef0
+++ dirname bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/bazel-orfs~override/docker_shell
++ cd bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/bazel-orfs~override
++ pwd
+ DIR=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/bazel-orfs~override
++ pwd
+ WORKSPACE_ROOT=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../..
++ pwd
+ WORKSPACE_EXECROOT=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main
+ WORKSPACE_EXTERNAL=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../../external
+ XSOCK=/tmp/.X11-unix
+ XAUTH=/tmp/.docker.xauth
+ xauth nlist :0
+ sed -e 's/^..../ffff/'
+ xauth -f /tmp/.docker.xauth nmerge -
xauth:  unable to generate an authority file name
xauth:  /tmp/.docker.xauth not writable, changes will be ignored
xauth: (argv):1:  unable to read any entries from file "(stdin)"
+ ARGUMENTS='make bazel-synth_sdc elapsed'
+ test -t 0
+ export FLOW_HOME=/OpenROAD-flow-scripts/flow/
+ FLOW_HOME=/OpenROAD-flow-scripts/flow/
+++ find /home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main -maxdepth 1 -type l -exec realpath '{}' ';' -quit
++ dirname /home/oyvind/megaboom/floorplan_BoomTile_asap7_base_2024-04-16_23-53.tar.gz
+ export WORKSPACE_ORIGIN=/home/oyvind/megaboom
+ WORKSPACE_ORIGIN=/home/oyvind/megaboom
+ [[ external/bazel-orfs~override/synth_sdc-bazel.mk = external* ]]
+ export PATH_PREFIX=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../..
+ PATH_PREFIX=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../..
+ export MAKE_PATTERN_PREFIXED=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../../external/bazel-orfs~override/synth_sdc-bazel.mk
+ MAKE_PATTERN_PREFIXED=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../../external/bazel-orfs~override/synth_sdc-bazel.mk
+ [[ -n '' ]]
+ export DESIGN_CONFIG_PREFIXED=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/BoomTile_config.mk
+ DESIGN_CONFIG_PREFIXED=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/BoomTile_config.mk
+ export STAGE_CONFIG_PREFIXED=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/BoomTile_synth_sdc_config.mk
+ STAGE_CONFIG_PREFIXED=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/BoomTile_synth_sdc_config.mk
+ chmod -R +w /home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin
+ trap handle_sigterm SIGTERM
+ wait 27150
++ id -u
++ id -g
+ docker run --name bazel-orfs-6774601a-3e68-44be-9d9c-8df5ee143ef0 --rm -u 1000:1000 -e LIBGL_ALWAYS_SOFTWARE=1 -e QT_X11_NO_MITSHM=1 -e XDG_RUNTIME_DIR=/tmp/xdg-run -e DISPLAY= -e QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/.docker.xauth:/tmp/.docker.xauth -e XAUTHORITY=/tmp/.docker.xauth -e BUILD_DIR=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main -e FLOW_HOME=/OpenROAD-flow-scripts/flow/ -e DESIGN_CONFIG=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/BoomTile_config.mk -e STAGE_CONFIG=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/BoomTile_synth_sdc_config.mk -e MAKE_PATTERN=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../../external/bazel-orfs~override/synth_sdc-bazel.mk -e MOCK_AREA_TCL= -e WORK_HOME=/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin -v /home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../..:/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../.. -v /home/oyvind/megaboom:/home/oyvind/megaboom --network host openroad/flow-ubuntu22.04-builder:latest bash -c 'set -ex
 . ./env.sh
 cd $FLOW_HOME
 make bazel-synth_sdc elapsed
 '
+ . ./env.sh
++ [[ linux-gnu == \d\a\r\w\i\n* ]]
++++ readlink -f ./env.sh
+++ dirname /OpenROAD-flow-scripts/env.sh
++ DIR=/OpenROAD-flow-scripts
++ '[' -f /opt/rh/rh-python38/enable ']'
++ export OPENROAD=/OpenROAD-flow-scripts/tools/OpenROAD
++ OPENROAD=/OpenROAD-flow-scripts/tools/OpenROAD
++ echo 'OPENROAD: /OpenROAD-flow-scripts/tools/OpenROAD'
++ export PATH=/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export PATH=/OpenROAD-flow-scripts/tools/install/yosys/bin:/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/OpenROAD-flow-scripts/tools/install/yosys/bin:/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export PATH=/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/OpenROAD-flow-scripts/tools/install/yosys/bin:/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/OpenROAD-flow-scripts/tools/install/yosys/bin:/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export PATH=/OpenROAD-flow-scripts/dependencies/bin:/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/OpenROAD-flow-scripts/tools/install/yosys/bin:/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/OpenROAD-flow-scripts/dependencies/bin:/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/OpenROAD-flow-scripts/tools/install/yosys/bin:/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ [[ linux-gnu == \d\a\r\w\i\n* ]]
+ cd /OpenROAD-flow-scripts/flow/
+ make bazel-synth_sdc elapsed
/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/bazel-out/k8-fastbuild/bin/BoomTile_config.mk:16: /home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../../external/bazel-orfs~override/synth_sdc-bazel.mk: No such file or directory
make: *** No rule to make target '/home/oyvind/.cache/bazel/_bazel_oyvind/7e6ad621f3f951c3ee6f5b179289b54e/execroot/_main/../../external/bazel-orfs~override/synth_sdc-bazel.mk'.  Stop.
OPENROAD: /OpenROAD-flow-scripts/tools/OpenROAD
[INFO-FLOW] ASU ASAP7 - version 2
Default PVT selection: BC
Target //:BoomTile_synth_sdc failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.228s, Critical Path: 0.75s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully

@oharboe
Copy link
Collaborator

oharboe commented Apr 18, 2024

This is forcing the use of docker for bazel run. I want to be able to choose between docker and a local ORFS.

I think it is fine to have _gui launch the docker, but I want to have a _gui_deps target that brings in the dependencies required to launch the gui and then use the _make script to launch the GUI using local ORFS.

@oharboe
Copy link
Collaborator

oharboe commented Apr 18, 2024

Fails:

oyvind@small-cigar:~/bazel-orfs$ bazel run L1MetadataArray_full_final_gui
[deleted]
INFO: Elapsed time: 239.335s, Critical Path: 238.65s
INFO: 47 processes: 5 internal, 42 local.
INFO: Build completed successfully, 47 total actions
INFO: Running command line: bazel-bin/L1MetadataArray_full_final_gui.sh
/home/oyvind/.cache/bazel/_bazel_oyvind/6e078b44989a9ce1500a63165a20fd2a/execroot/_main/bazel-out/k8-fastbuild/bin/L1MetadataArray_full_final_gui.sh: line 1: bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/docker_shell: No such file or directory

@eszpotanski eszpotanski force-pushed the 57167-gui-targets branch 2 times, most recently from 1dd7282 to 618cfc2 Compare April 19, 2024 10:09
@eszpotanski
Copy link
Contributor Author

There were some conflicts with recently merged features, now it should work in both bazel-orfs and MegaBoom.

I also added *_open target for Docker flow and as requested *_gui_deps which build all dependencies needed to run GUI locally.

Copy link
Collaborator

@oharboe oharboe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it and it does not work yet:

oyvind@small-cigar:~/bazel-orfs$ ls bazel-bin/results/asap7/L1MetadataArray/full/
1_1_yosys.v                3_4_place_resized.odb  6_1_fill.sdc
1_synth.sdc                3_5_place_dp.odb       6_1_merged.gds
1_synth.v                  3_place.odb            6_final.def
2_1_floorplan.odb          3_place.sdc            6_final.gds
2_2_floorplan_io.odb       4_1_cts.odb            6_final.odb
2_3_floorplan_tdms.odb     4_cts.odb              6_final.sdc
2_4_floorplan_macro.odb    4_cts.sdc              6_final.spef
2_5_floorplan_tapcell.odb  5_1_grt.odb            6_final.v
2_6_floorplan_pdn.odb      5_1_grt.sdc            clock_period.txt
2_floorplan.odb            5_2_fillcell.odb       grt.ok
2_floorplan.sdc            5_3_route.odb          place.ok
3_1_place_gp_skip_io.odb   5_route.odb            route.guide
3_2_place_iop.odb          5_route.sdc
3_3_place_gp.odb           6_1_fill.odb
oyvind@small-cigar:~/bazel-orfs$ bazel build L1MetadataArray_full_final
INFO: Invocation ID: d1246f1d-1607-4f39-b57e-6e57f15083c1
INFO: Analyzed target //:L1MetadataArray_full_final (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-out -> /home/oyvind/.cache/bazel/_bazel_oyvind/6e078b44989a9ce1500a63165a20fd2a/execroot/_main/bazel-out:  /home/oyvind/bazel-orfs/bazel-out (File exists)
Target //:L1MetadataArray_full_final up-to-date:
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.spef
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.gds
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.sdc
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.odb
  bazel-bin/logs/asap7/L1MetadataArray/full/6_1_merge.log
  bazel-bin/logs/asap7/L1MetadataArray/full/6_report.log
INFO: Elapsed time: 0.110s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
oyvind@small-cigar:~/bazel-orfs$ bazel build L1MetadataArray_full_final_gui_deps
INFO: Invocation ID: a68ce4da-2cb0-4f8d-a4b0-21cae2a14437
INFO: Analyzed target //:L1MetadataArray_full_final_gui_deps (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-out -> /home/oyvind/.cache/bazel/_bazel_oyvind/6e078b44989a9ce1500a63165a20fd2a/execroot/_main/bazel-out:  /home/oyvind/bazel-orfs/bazel-out (File exists)
Target //:L1MetadataArray_full_final_gui_deps up-to-date:
  bazel-bin/L1MetadataArray_full_config.mk
  bazel-bin/L1MetadataArray_full_final_config.mk
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.spef
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.gds
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.sdc
  bazel-bin/results/asap7/L1MetadataArray/full/6_final.odb
  bazel-bin/logs/asap7/L1MetadataArray/full/6_1_merge.log
  bazel-bin/logs/asap7/L1MetadataArray/full/6_report.log
INFO: Elapsed time: 0.048s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
oyvind@small-cigar:~/bazel-orfs$ bazel build L1MetadataArray_full_final_make
INFO: Invocation ID: 37991d3f-6954-42c3-972c-9077d729dc81
INFO: Analyzed target //:L1MetadataArray_full_final_make (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-out -> /home/oyvind/.cache/bazel/_bazel_oyvind/6e078b44989a9ce1500a63165a20fd2a/execroot/_main/bazel-out:  /home/oyvind/bazel-orfs/bazel-out (File exists)
Target //:L1MetadataArray_full_final_make up-to-date:
  bazel-bin/logs/asap7/L1MetadataArray/full/make_script_final.sh
  bazel-bin/L1MetadataArray_full_final_make
INFO: Elapsed time: 0.050s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
oyvind@small-cigar:~/bazel-orfs$ bazel-bin/L1MetadataArray_full_final_make gui_final
+++ dirname /home/oyvind/bazel-orfs/orfs
++ cd /home/oyvind/bazel-orfs
++ pwd
+ WORKSPACE=/home/oyvind/bazel-orfs
+ export ORFS=/home/oyvind/OpenROAD-flow-scripts
+ ORFS=/home/oyvind/OpenROAD-flow-scripts
+ export FLOW_HOME=/home/oyvind/OpenROAD-flow-scripts/flow
+ FLOW_HOME=/home/oyvind/OpenROAD-flow-scripts/flow
+ export MAKEFILES=/home/oyvind/OpenROAD-flow-scripts/flow/Makefile
+ MAKEFILES=/home/oyvind/OpenROAD-flow-scripts/flow/Makefile
+ [[ /home/oyvind/bazel-orfs = * ]]
++ echo /home/oyvind/bazel-orfs
++ sed 's|external/bazel-orfs~override|execroot/_main|'
+ export BUILD_DIR=/home/oyvind/bazel-orfs
+ BUILD_DIR=/home/oyvind/bazel-orfs
+ export WORK_HOME=/home/oyvind/bazel-orfs/bazel-out/k8-fastbuild/bin
+ WORK_HOME=/home/oyvind/bazel-orfs/bazel-out/k8-fastbuild/bin
+ chmod -R +w /home/oyvind/bazel-orfs/bazel-out/k8-fastbuild/bin
+ source /home/oyvind/OpenROAD-flow-scripts/env.sh
++ [[ linux-gnu == \d\a\r\w\i\n* ]]
++++ readlink -f /home/oyvind/OpenROAD-flow-scripts/env.sh
+++ dirname /home/oyvind/OpenROAD-flow-scripts/env.sh
++ DIR=/home/oyvind/OpenROAD-flow-scripts
++ '[' -f /opt/rh/rh-python38/enable ']'
++ export OPENROAD=/home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD
++ OPENROAD=/home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD
++ echo 'OPENROAD: /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD'
OPENROAD: /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD
++ export PATH=/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ PATH=/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ export PATH=/home/oyvind/OpenROAD-flow-scripts/tools/install/yosys/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ PATH=/home/oyvind/OpenROAD-flow-scripts/tools/install/yosys/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ export PATH=/home/oyvind/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/yosys/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ PATH=/home/oyvind/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/yosys/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ export PATH=/home/oyvind/OpenROAD-flow-scripts/dependencies/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/yosys/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ PATH=/home/oyvind/OpenROAD-flow-scripts/dependencies/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/LSOracle/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/yosys/bin:/home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/oyvind/.cargo/bin:/home/oyvind/.local/bin:/home/oyvind/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
++ [[ linux-gnu == \d\a\r\w\i\n* ]]
++ export FLOW_HOME=/home/oyvind/OpenROAD-flow-scripts/flow
++ FLOW_HOME=/home/oyvind/OpenROAD-flow-scripts/flow
+ make gui_final
[INFO-FLOW] ASU ASAP7 - version 2
Default PVT selection: BC
make: *** No rule to make target 'gui_6_final.odb', needed by 'gui_final'.  Stop.

README.md Outdated
The exception is CLI and GUI for Synth stage, which requires additional LEF files provided with `_open_synth_make` and `_gui_synth_make` target:

```
bazel build L1MetadataArray_full_open_synth_open_deps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want bazel-orfs to be a wafer thin layer on top of ORFS, so refer as much as possible to ORFS and don't create an additional user-facing set of commands in bazel-orfs, unless necessary.

Introduce a single _deps target. This target can be used for gui, open or make issue. It should include dependencies for all the cases. When creating an issue, it might be useful to have .lib & .lef files in there.

remove _gui/_open targets and have only _make targets.

@oharboe
Copy link
Collaborator

oharboe commented Apr 19, 2024

@eszpotanski @lpawelcz What is the motivation behind using bazel run? Why not leave this to the generated _make script?

We want bazel-orfs to be a wafer thin layer on top of ORFS and hand the job of to ORFS when we can; introduce as few new concepts as possible.

The generated _make scripts will handle many situations:

  • open openroad in command line(open_ targets in ORFS) or GUI mode (gui_ targets in ORFS)
  • create issues make issue in ORFS. Here dependencies should also be included.
  • Various inspections, quick local testing, like do-floorplan. This can include modifying variables or tinkering with ORFS scripts.
  • It will be nice to have a _docker script alongside the _make script to choose between local ORFS and the Docker version used in the project.

@eszpotanski
Copy link
Contributor Author

The main reason for using bazel run was consistency, as for Docker flow OpenROAD is run through Bazel and for local flow _make scripts are used, and right now:

  • using local OpenROAD - GUI/open can be executed through default _make scripts, apart from synth, where additional _open_synth_make and _gui_synth_make were created. Those two are basically the same, but were added to be more user-friendly. If you'd like to minimize number of target, e.g. _gui_synth_make can be removed and _open_synth_make script will be used for both open_ and gui_.
  • using OpenROAD in Docker - GUI/open can be executed with bazel run {target}_gui or bazel run {target}_open. Like other targets from Docker flow, they are run directly from Bazel, this case is similar - bazel build builds required dependencies and creates script which is executed with bazel run. It's also more natural for Bazel to use build for compilation/dependencies and run for running prepared program. Moreover, for bazel build Bazel do not share TTY with the user, so programs cannot get any input.

By removing _gui/_open targets and have only _make targets, you mean to completely abandon feature with GUI/open targets run from Docker container? Or to use _make script for running GUI/open in Docker (this would also require additional target as scripts for local and Docker flow are completely different)?

As for single _deps targets - the reason behind introducing _gui_deps and _open_deps was also to make it more user-friendly - it can be easily reduced to e.g. only _open_deps.
But creating only one _deps target for all 3 mentioned use-cases is impossible, as GUI/open for e.g. L1MetadataArray_test_floorplan requires all its dependencies and floorplan itself, where make issue requires only floorplan dependencies - so I'd propose to have one _deps for normal target and second for GUI/open targets, like:

  • L1MetadataArray_test_floorplan_deps
  • L1MetadataArray_test_floorplan_open_deps

What do you think?

@oharboe
Copy link
Collaborator

oharboe commented Apr 22, 2024

@lpawelcz @eszpotanski I want to create a flow that is less Bazel oriented and more ORFS oriented.

I want to remove bazel run from the non-bazel use of ORFS. Non-bazel ORFS use is both through docker and locally installed ORFS.

We can achieve what we need with only three targets for each stage. Note that the semantics is a bit different than today:

  • _scripts, creates non-bazel scripts for local ORFS install and Docker. This is what the _make bazel targets do today.
  • We need an additional _issue variant of the scripts that is just like _make, except that it contains variables from all the stages. This will be used to run make foo_issue feature in ORFS. The OpenROAD maintainers are confused that not all variables for all stages are available when running make issue from a specific stage like bazel-bin/SomeModule_floorplan_make floorplan_issue
  • _make, downloads all dependencies to run the next stage, but not enough to run make open_ and gui_ targets. Depends on _scripts bazel target.
  • _gui, downloads all dependencies required to run make open_ and gui_ targets for all stages, including synth. That synth is special is an implementation detail of _gui. Depends on _scripts bazel target. This also covers the dependencies of _make.

@lpawelcz
Copy link
Contributor

@oharboe, CC @eszpotanski

I want to remove bazel run from the non-bazel use of ORFS. Non-bazel ORFS use is both through docker and locally installed ORFS.

Right, so the baseline is to have scripts that can be executed straight from ./bazel-bin, just as current _make scripts.

We can achieve what we need with only three targets for each stage. Note that the semantics is a bit different than today:

  • _scripts, creates non-bazel scripts for local ORFS install and Docker. This is what the _make bazel targets do today.

Got it, so rename _make targets to _script. This 'family' of targets should generate 2 output files:

  • script for running the local flow
  • script for running the docker flow
  • _make, downloads all dependencies to run the next stage, but not enough to run make open_ and gui_ targets. Depends on _scripts bazel target.

Not sure if I understand that correctly. New _make targets should:

  • generate 2 scripts for running given ORFS stage (dependency on _script bazel target, generate variant for local and docker flow)
  • build all previous stages and all required macros
  • eg.: L1MetadataArray_test_floorplan_make will:
    • build scripts (bazel target L1MetadataArray_test_floorplan_script) capable of running ORFS make targets like: do-floorplan floorplan_gui, floorplan_open
    • build dependencies with docker flow:
      • the whole tag_array_64x184 macro,
      • L1MetadataArray_test stages up to synth
  • _gui, downloads all dependencies required to run make open_ and gui_ targets for all stages, including synth. That synth is special is an implementation detail of _gui. Depends on _scripts bazel target. This also covers the dependencies of _make.

So this one should basically only depend on _make target (_make already depends on _script) and additionally build the dependencies for running ORFS make targets *-gui/*-open

Please confirm if that is correct so we can move on with the implementation.

@oharboe
Copy link
Collaborator

oharboe commented Apr 23, 2024

Comments inline:

@oharboe, CC @eszpotanski

I want to remove bazel run from the non-bazel use of ORFS. Non-bazel ORFS use is both through docker and locally installed ORFS.

Right, so the baseline is to have scripts that can be executed straight from ./bazel-bin, just as current _make scripts.

Yes.

We can achieve what we need with only three targets for each stage. Note that the semantics is a bit different than today:

  • _scripts, creates non-bazel scripts for local ORFS install and Docker. This is what the _make bazel targets do today.

Got it, so rename _make targets to _script. This 'family' of targets should generate 2 output files:

  • script for running the local flow
  • script for running the docker flow

and third script for running the make issue.

  • _make, downloads all dependencies to run the next stage, but not enough to run make open_ and gui_ targets. Depends on _scripts bazel target.

Not sure if I understand that correctly. New _make targets should:

  • generate 2 scripts for running given ORFS stage (dependency on _script bazel target, generate variant for local and docker flow)
  • build all previous stages

Only the immediately preceeding stage.

and all required macros

Yes, but not that not all stages require macros. Search for ADDITIONAL_LIB/LEFS/GDS_FILES to see what files are required for a stage.

  • eg.: L1MetadataArray_test_floorplan_make will:

    • build scripts (bazel target L1MetadataArray_test_floorplan_script) capable of running ORFS make targets like: do-floorplan floorplan_gui, floorplan_open

    • build dependencies with docker flow:

      • the whole tag_array_64x184 macro,
      • L1MetadataArray_test stages up to synth

Yes.

However, if you create a "place" script, then only the immediately preceeding stage, "floorplan" outputs are needed.

  • _gui, downloads all dependencies required to run make open_ and gui_ targets for all stages, including synth. That synth is special is an implementation detail of _gui. Depends on _scripts bazel target. This also covers the dependencies of _make.

So this one should basically only depend on _make target (_make already depends on _script) and additionally build the dependencies for running ORFS make targets *-gui/*-open

Yes.

Please confirm if that is correct so we can move on with the implementation.

With the corrections above, please proceed.

This is a bit tricky and we can't expect to get all details right on the first try, but I think we have the general direction clearly sorted out and that we can fix all the details when we have a PR to test.

@lpawelcz
Copy link
Contributor

OK, thanks for clarifying that out. We will now focus on the implementation according to the description above.

Signed-off-by: Eryk Szpotanski <[email protected]>
@oharboe
Copy link
Collaborator

oharboe commented May 2, 2024

@lpawelcz @eszpotanski Are you waiting for me on anything for this PR?

@eszpotanski eszpotanski force-pushed the 57167-gui-targets branch 2 times, most recently from b0e1f88 to 30cf6ba Compare May 2, 2024 13:56
@eszpotanski eszpotanski force-pushed the 57167-gui-targets branch from 30cf6ba to 193b1e4 Compare May 2, 2024 14:00
@eszpotanski
Copy link
Contributor Author

No, we were not waiting for you. Just this PR required some adjustments. Now, as you described, there is one type of targets (_gui), which generates scripts (from _scripts target) and prepares all required dependencies for open_{STAGE} and gui_{STAGE}.

Moreover, tests for open_{STAGE} were added to CI.

@oharboe oharboe self-requested a review May 2, 2024 14:01
Copy link
Collaborator

@oharboe oharboe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Will merge when it passes tests as a baseline for further improvements and testing.

@oharboe oharboe merged commit c3833cb into The-OpenROAD-Project:main May 2, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants