Skip to content

Commit 7cdfa13

Browse files
committed
[rdl] Process the rdl files to generate templates and rtl
1 parent f795e4e commit 7cdfa13

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

util/top_gen.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,22 @@
33
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
44
# SPDX-License-Identifier: Apache-2.0
55

6+
import subprocess
67
from pathlib import Path
78

89
from top_gen import generator, parser
910

11+
RDL_GEN_FOLDER = Path("build/rdl")
12+
1013
if __name__ == "__main__":
11-
config = parser.parse_top_config(Path("data/top_config.toml"))
14+
# Generates reg2hw, hw2reg and rdl.json from the rdl files.
15+
RDL_GEN_FOLDER.mkdir(parents=True, exist_ok=True)
16+
subprocess.run(
17+
["rdl2ot", "export-rtl", "--soc", "data/top.rdl", RDL_GEN_FOLDER],
18+
check=True,
19+
)
20+
21+
config = parser.parse_top_config(
22+
Path("data/top_config.toml"), RDL_GEN_FOLDER / "rdl.json"
23+
)
1224
generator.generate_top(config)

0 commit comments

Comments
 (0)