mirror of
https://github.com/retroSoC/retroSoC.git
synced 2026-11-06 14:55:14 +00:00
feat: refactor user extension handling and update MPW generation
- Updated README.md to clarify the status of KianV RV32IMA and PicoRV32 in the user-extension map. - Modified Makefile to include USER_EXTENSIONS_SOURCE in MPW variant stamp dependencies. - Enhanced integration README.md to better describe the relationship between user_extensions.json and mpw.toml. - Updated generate_user_extensions.py to include design_id in ExtensionTarget and enforce unique design IDs. - Changed user_extensions.json schema version to 2 and added design_id fields for core and IP targets. - Refactored generate_mpw.py to support the new manifest structure and validate design selections. - Adjusted sysctrl_tb.sv test cases to reflect changes in user core reset states. - Enhanced test_opipsram.py to utilize ccache for improved compilation performance. - Updated test_script_tools.py to include new tests for active manifest generation. - Modified test_user_extensions.py to validate isolated scalar bindings and reject duplicate design selections.
This commit is contained in:
23 files changed
+1058
-2979
No files matched your search
@@ -49,18 +49,22 @@ def test_extensions_generate_isolated_scalar_bindings(tmp_path: Path) -> None:
|
||||
filelist = (tmp_path / "user_extensions.fl").read_text(encoding="utf-8")
|
||||
config = (tmp_path / "rtl/user_extensions_config.svh").read_text(encoding="utf-8")
|
||||
|
||||
assert core.count("rib_if u_user_") == 6
|
||||
assert core.count("ribp_if u_user_") == 6
|
||||
assert core.count("ribp2rib #(") == 6
|
||||
assert core.count(".SyncReset(1'b1)") == 3
|
||||
assert core.count("rib_if u_user_") == 4
|
||||
assert core.count("ribp_if u_user_") == 4
|
||||
assert core.count("ribp2rib #(") == 4
|
||||
assert core.count(".SyncReset(1'b1)") == 1
|
||||
assert core.count(".SyncReset(1'b0)") == 3
|
||||
assert "u_user_rib_if.cmd_valid = '0;" in core
|
||||
assert "5'd0: begin" in core
|
||||
assert "5'd4: begin" in core
|
||||
assert "5'd5: begin" in core
|
||||
assert "5'd3: begin" in core
|
||||
assert "5'd4: begin" not in core
|
||||
assert "core_reset_i[0]" in core
|
||||
assert "mpw_c0 #(0)" in core
|
||||
assert "mpw_c5 #(5)" in core
|
||||
assert "mpw_c1 #(1)" in core
|
||||
assert "mpw_c3 #(3)" in core
|
||||
assert "u_mpw_core_serv" in core
|
||||
assert "u_mpw_core_kianv_rv32ima" not in core
|
||||
assert "u_mpw_core_picorv32" not in core
|
||||
assert "mpw_i1 #(1)" in ip
|
||||
assert "User core 0 uses the RIBP contract" in core
|
||||
assert ip.count("user_gpio_if #(`USER_GPIO_NUM)") == 2
|
||||
@@ -68,7 +72,7 @@ def test_extensions_generate_isolated_scalar_bindings(tmp_path: Path) -> None:
|
||||
assert "8'd2: begin" in ip
|
||||
assert "u_user_2_apb4_if.psel = apb.psel;" in ip
|
||||
assert filelist.startswith("+incdir+")
|
||||
assert "`define USER_CORE_COUNT 6" in config
|
||||
assert "`define USER_CORE_COUNT 4" in config
|
||||
|
||||
|
||||
def test_extensions_reject_noncontiguous_slots_and_invalid_modules(tmp_path: Path) -> None:
|
||||
@@ -91,3 +95,11 @@ def test_extensions_reject_invalid_core_reset_style(tmp_path: Path) -> None:
|
||||
result = validate(write_invalid_extensions(tmp_path, document))
|
||||
assert result.returncode != 0
|
||||
assert ".reset must be sync or async" in result.stderr
|
||||
|
||||
|
||||
def test_extensions_reject_duplicate_design_selection(tmp_path: Path) -> None:
|
||||
document = json.loads(EXTENSIONS.read_text(encoding="utf-8"))
|
||||
document["core_targets"][1]["design_id"] = document["core_targets"][0]["design_id"]
|
||||
result = validate(write_invalid_extensions(tmp_path, document))
|
||||
assert result.returncode != 0
|
||||
assert "design_id kianv_rv32i is duplicated" in result.stderr
|
||||
Reference in new issue
Block a user