Skip to content

Commit 00c78a4

Browse files
authored
Merge pull request #7206 from Pinata-Consulting/orfs-test-case
Orfs test case - basis for further collaboration and discussion
2 parents a02d71f + 23721d9 commit 00c78a4

9 files changed

Lines changed: 12976 additions & 76 deletions

File tree

.bazelignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ build/
22
debug/
33
src/sta/build/
44
src/sta/debug/
5+
# delete line below when CI can handle it and it runs in minutes
6+
test/orfs/

MODULE.bazel

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,25 @@ pip.parse(
9898
requirements_lock = "//bazel:requirements_lock_3_13.txt",
9999
)
100100
use_repo(pip, "openroad-pip")
101+
102+
bazel_dep(name = "bazel-orfs")
103+
104+
# To bump version, run: bazelisk run @bazel-orfs//:bump
105+
git_override(
106+
module_name = "bazel-orfs",
107+
commit = "126765508161956f8f82ae169084da0235230637",
108+
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
109+
)
110+
111+
orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
112+
113+
# To bump version, run: bazelisk run @bazel-orfs//:bump
114+
orfs.default(
115+
# Official image https://hub.docker.com/r/openroad/orfs/tags
116+
image = "docker.io/openroad/orfs:v3.0-2883-ge22e4fc7",
117+
# Use OpenROAD of this repo instead of from the docker image
118+
openroad = "//:openroad",
119+
sha256 = "6ad0b1b7fbf290f33f0050ead4da181c83c6e8a9337b65f5f9cff65d67788424",
120+
)
121+
use_repo(orfs, "com_github_nixos_patchelf_download")
122+
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

Lines changed: 12063 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/orfs/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ORFS smoke tests
2+
3+
A set of ORFS integration tests that runs in a few minutes suitable for inclusion in the local fast regression testing workflow prior to creating a PR:
4+
5+
bazel -c opt test ...
6+
7+
## Updating RULES_JSON files
8+
9+
1. Run `bazel run -c opt //test/orfs/gcd:gcd_update` to update RULES_JSON file for a design. This will build and run OpenROAD to generate a new RULES_JSON file and update the RULES_JSON source file.
10+
2. Create commit for RULES_JSON file
11+
12+
## Updating ORFS and bazel-orfs
13+
14+
`bazel run @bazel-orfs//:bump`, this will find the latest bazel-orfs and ORFS docker image and update MODULE.bazel and MODULE.bazel.lock.

test/orfs/gcd/BUILD

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
load("@bazel-orfs//:openroad.bzl", "orfs_flow")
2+
3+
orfs_flow(
4+
name = "gcd",
5+
arguments = {
6+
# Faster builds
7+
"SKIP_INCREMENTAL_REPAIR": "1",
8+
"GPL_TIMING_DRIVEN": "0",
9+
"SKIP_LAST_GASP": "1",
10+
# Various
11+
"DIE_AREA": "0 0 16.2 16.2",
12+
"CORE_AREA": "1.08 1.08 15.12 15.12",
13+
"PLACE_DENSITY": "0.35",
14+
},
15+
sources = {
16+
"RULES_JSON": [":rules-base.json"],
17+
"SDC_FILE": [":constraint.sdc"],
18+
},
19+
verilog_files = ["gcd.v"],
20+
tags = ["manual"],
21+
)

test/orfs/gcd/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Summary
2+
3+
Simple GCD (greatest common denominator) core. This is an extremely small
4+
design mostly used to test the sanity of the flow.
5+
6+
Originally generated using [PyMTL](https://github.com/cornell-brg/pymtl).
7+
8+
This design has about 250 cells.
9+
10+
# Source
11+
12+
Re-used code derived from http://opencelerity.org/ project.

test/orfs/gcd/constraint.sdc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
current_design gcd
2+
3+
set clk_name core_clock
4+
set clk_port_name clk
5+
set clk_period 310
6+
set clk_io_pct 0.2
7+
8+
set clk_port [get_ports $clk_port_name]
9+
10+
create_clock -name $clk_name -period $clk_period $clk_port
11+
12+
set non_clock_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port]
13+
14+
set_input_delay [expr $clk_period * $clk_io_pct] -clock $clk_name $non_clock_inputs
15+
set_output_delay [expr $clk_period * $clk_io_pct] -clock $clk_name [all_outputs]

0 commit comments

Comments
 (0)