Skip to content

Commit 7f93e18

Browse files
oharboeclaude
andcommitted
Add config.mk DSL parser with 84 unit tests
Python parser for the config.mk design DSL that extracts structural params (PLATFORM, DESIGN_NAME, VERILOG_FILES, SDC_FILE, BLOCKS) and flow arguments (CORE_UTILIZATION, PLACE_DENSITY, etc.) for generating orfs_flow() Bazel targets. Handles all DSL features: export/=/?=/:=, line continuations, $(wildcard), $(sort), variable resolution. Emits deprecation warnings for complex features (ifeq, $(if), $(filter)). 84 unit tests including integration tests against all real config.mk files in the repository. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent efbef47 commit 7f93e18

3 files changed

Lines changed: 1994 additions & 0 deletions

File tree

‎bazel/BUILD.bazel‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
2+
3+
py_library(
4+
name = "config_mk_parser_lib",
5+
srcs = ["config_mk_parser.py"],
6+
visibility = ["//visibility:public"],
7+
)
8+
9+
py_binary(
10+
name = "config_mk_parser",
11+
srcs = ["config_mk_parser.py"],
12+
visibility = ["//visibility:public"],
13+
)
14+
15+
py_binary(
16+
name = "config_mk_lint",
17+
srcs = ["config_mk_parser.py"],
18+
args = [
19+
"--lint",
20+
"--all",
21+
"flow/designs",
22+
],
23+
visibility = ["//visibility:public"],
24+
)
25+
26+
py_test(
27+
name = "config_mk_parser_test",
28+
srcs = ["config_mk_parser_test.py"],
29+
data = glob(["../flow/designs/**/config.mk"]) + glob(["../flow/designs/src/**/*.mk"]),
30+
deps = [":config_mk_parser_lib"],
31+
)

0 commit comments

Comments
 (0)