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

Use ORFS from docker image #16

Merged
merged 34 commits into from
Apr 11, 2024

Conversation

lpawelcz
Copy link
Contributor

@lpawelcz lpawelcz commented Mar 18, 2024

This PR modifies the existing rules to run physical design flow in a docker container with installed OpenROAD-flow-scripts.

It uses rules_oci to import and load external docker image into local docker runtime.
The solution is based on generating config.mk files for each design (once per build_openroad()) with new macro called write_config(). The config consist of common and design-specific environment variables, as well as definitions of all rules for make targets used in bazel-orfs.
The config and other inputs to the flow are passed down to the docker container using bind mount mechanism.
Currently it is required to disable bazel's sandboxing feature in order to provide correct paths for mounting directories with input files for the flow.

The flow is started with an entrypoint script based on docker_shell.sh utility imported from OpenROAD-flow-scripts.

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.

break into one rules.mk per stage or we have to rebuild everything when we tinker with one rule. redoing a 7200s synthesis is annoying when tweaking e.g. floorplan rules...

@lpawelcz lpawelcz force-pushed the 56027-use-docker-orfs branch 2 times, most recently from 115fce0 to 03c11cb Compare March 22, 2024 12:52
Required for passing correct paths to mount in the docker container

Signed-off-by: Pawel Czarnecki <[email protected]>
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.

Remove util.tcl from bazel-orfs, this is part of what the user of bazel-orfs needs to set up and provide. The user may or may not have a util.tcl.

@oharboe
Copy link
Collaborator

oharboe commented Mar 25, 2024

@lpawelcz I realize this is WIP, but thought I would try it quickly. Removed util.tcl references in bazel-orfs and got this far:

$ bazel build L1MetadataArray_test_generate_abstract
INFO: Invocation ID: 7fa43090-2474-4138-ac1f-4d75ce72668d
ERROR: error loading package '@@bazel-orfs//': Unable to find package for @@rules_oci//oci:defs.bzl: The repository '@@rules_oci' could not be resolved: Repository '@@rules_oci' is not defined.
ERROR: /home/oyvind/megaboom/BUILD.bazel:936:15: error loading package '@@bazel-orfs//': Unable to find package for @@rules_oci//oci:defs.bzl: The repository '@@rules_oci' could not be resolved: Repository '@@rules_oci' is not defined. and referenced by '//:L1MetadataArray_test_generate_abstract'
ERROR: Analysis of target '//:L1MetadataArray_test_generate_abstract' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.262s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

README.md Outdated
@@ -100,6 +100,11 @@ The example comes from the `BUILD` file in this repository. For details about ta

This script loads the ORFS environment and evaluates the rest of the command line that called the script.

### util.tcl
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove. Not part of bazel-orfs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -5,5 +5,5 @@ bazel-generate_abstract:

.PHONY: bazel-generate_abstract_mock_area
bazel-generate_abstract_mock_area: bazel-generate_abstract
cp $(RESULTS_DIR)/../mock_area/$(DESIGN_NAME).lef $(RESULTS_DIR)/
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmm.... was the removal of mock_area intentional here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I understand this correctly, this target was meant to copy files from mock_area flow variant output directory to base (or other flow variant provided in one of the build_openroad attributes) output directory.

After my modifications RESULTS_DIR in the context of mock_area stages already points to the directory relevant to mock_area flow variant. We then have to build the path for the other flow variant from scratch.

@@ -1,4 +1,4 @@
source util.tcl
Copy link
Collaborator

Choose a reason for hiding this comment

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

move util.tcl into the test/ folder. It is not part of bazel-orfs, but part of the design being built.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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.

Also, we can squash these numerous commits into a single one or a few. There has been a fair deal of back and forth testing out things, the history of trying out things isn't important going forward.

@lpawelcz
Copy link
Contributor Author

lpawelcz commented Mar 25, 2024

Removed util.tcl references in bazel-orfs and got this far

For the time being docker flow is supported and tested only in bazel-orfs repo. If you want to test this there you must first run bazel run orfs_env in order to load the bazel image into your docker runtime. Then you can run e.g. L1MetadataArray targets (expect failures in cts and further stages).

EDIT:
After bumping the docker ORFS image all stage targets from L1MetadataArray should work

we can squash these numerous commits into a single one or a few

Sure. For now this is WIP. At this stage I prefer to keep small commits in case something has to be reverted or slightly modified. I will surely clean the history before putting up this work for a review.

@lpawelcz
Copy link
Contributor Author

Reworked TCL and constraints handling, cleaned up the code responsible for flow arguments, source and outputs specification.
Added generating configs per stage (those are included in config generated per design by new env var STAGE_CONFIG).
Fixed the local flow after adding docker flow.
Enabled CI tests for docker flow and reworked local flow.

The plan for now is to add modified version of L1MetadataArray with enabled grt and final stages. Then we can work on https://github.com/Pinata-Consulting/ascenium-antmicro/issues/15.
Please note that those changes were not yet tested in megaboom and we expect some failures there.
Once we have grt and final stages tested here we will start integrating and testing the changes in megaboom workspace

Signed-off-by: Pawel Czarnecki <[email protected]>
Import slightly modified docker_shell.sh utility from ORFS

Signed-off-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Assume util.tcl is always a dependency for synth, floorplan and place stages.
Introduce UTIL_TCL env var which should be used for including util.tcl in different scripts

Signed-off-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
lpawelcz and others added 19 commits April 11, 2024 15:51
Signed-off-by: Pawel Czarnecki <[email protected]>
* Run job in default GitHub Runner container
* Load the ORFS image before running bazel targets

Signed-off-by: Pawel Czarnecki <[email protected]>
Add modified configuration for L1MetadataArray design
Perform additional 'route' and 'flow' stages

Signed-off-by: Paweł Czarnecki <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Check if it is possible to locally continue physical design flow which
was started with the docker flow.

Signed-off-by: Eryk Szpotanski <[email protected]>
…lues in GDS_ALLOW_EMPTY

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

oharboe commented Apr 11, 2024

@lpawelcz ready?

@lpawelcz lpawelcz marked this pull request as ready for review April 11, 2024 14:18
@oharboe
Copy link
Collaborator

oharboe commented Apr 11, 2024

@lpawelcz I need an accompanying megaboom pull request...

@lpawelcz
Copy link
Contributor Author

@oharboe ready, here is the megaboom PR: The-OpenROAD-Project/megaboom#29

@lpawelcz lpawelcz changed the title [WIP] Use ORFS from docker image Use ORFS from docker image Apr 11, 2024
@oharboe oharboe merged commit 5a76d99 into The-OpenROAD-Project:main Apr 11, 2024
8 checks passed
@oharboe
Copy link
Collaborator

oharboe commented Apr 11, 2024

Continue testing and file github issues based upon master.

@lpawelcz lpawelcz deleted the 56027-use-docker-orfs branch April 11, 2024 14:47
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