From 2d865dd272954a20be9f3bae3701a3bc68e0524c Mon Sep 17 00:00:00 2001 From: Emin Date: Fri, 5 Jun 2026 15:05:41 +0800 Subject: [PATCH 1/2] feat(rcx): pass pdk selector to ecc-tools --- chipcompiler/data/workspace.py | 1 + chipcompiler/thirdparty/ecc-tools | 2 +- chipcompiler/tools/ecc/configs/rcx.json | 3 ++- chipcompiler/tools/ecc/module.py | 4 +++- chipcompiler/tools/ecc/runner.py | 5 ++++- test/test_ecc_tools_module.py | 27 +++++++++++++++++++++++++ 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/chipcompiler/data/workspace.py b/chipcompiler/data/workspace.py index 648b1293..76673652 100644 --- a/chipcompiler/data/workspace.py +++ b/chipcompiler/data/workspace.py @@ -258,6 +258,7 @@ def init_workspace_config(workspace: Workspace) -> None: json_write(workspace.config[f"{StepEnum.ROUTING.value}"], router) rcx = json_read(workspace.config[f"{StepEnum.RCX.value}"]) + rcx["pdk"] = "ics55" if workspace.pdk.name == "ics55" else "" rcx["mapping_file"] = workspace.pdk.mapping_file corners = deepcopy(workspace.pdk.corners) rcx["corners"] = corners diff --git a/chipcompiler/thirdparty/ecc-tools b/chipcompiler/thirdparty/ecc-tools index bd388210..545e372a 160000 --- a/chipcompiler/thirdparty/ecc-tools +++ b/chipcompiler/thirdparty/ecc-tools @@ -1 +1 @@ -Subproject commit bd3882102078fcb1e77b450aa468bfe806c6e564 +Subproject commit 545e372a6b22a4e89199e0c9ebdddd2d2d5388e6 diff --git a/chipcompiler/tools/ecc/configs/rcx.json b/chipcompiler/tools/ecc/configs/rcx.json index 66e01a2c..930b972a 100644 --- a/chipcompiler/tools/ecc/configs/rcx.json +++ b/chipcompiler/tools/ecc/configs/rcx.json @@ -1,4 +1,5 @@ { + "pdk": "", "thread_num": 64, "output": "/RCX_ecc/output", "mapping_file": "/corners/ICsprout_55LLULP_1P6M_5lc_V1p1_cell.map", @@ -58,4 +59,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/chipcompiler/tools/ecc/module.py b/chipcompiler/tools/ecc/module.py index a76fa276..8bae313c 100644 --- a/chipcompiler/tools/ecc/module.py +++ b/chipcompiler/tools/ecc/module.py @@ -890,7 +890,9 @@ def is_rt_timing_enable(self, config : str): ######################################################################## # RCX api ######################################################################## - def init_rcx(self, config: str): + def init_rcx(self, config: str, pdk: str = ""): + if pdk: + return self.ecc.init_rcx(config=config, pdk=pdk) return self.ecc.init_rcx(config=config) def run_rcx(self): diff --git a/chipcompiler/tools/ecc/runner.py b/chipcompiler/tools/ecc/runner.py index 2f6670ad..e863530f 100644 --- a/chipcompiler/tools/ecc/runner.py +++ b/chipcompiler/tools/ecc/runner.py @@ -791,7 +791,10 @@ def run_jsons_to_itf(ecc_module : ECCToolsModule) -> bool: sub_flow.update_step(step_name=EccSubFlowEnum.run_rcx.value, state=StateEnum.Imcomplete) result = False else: - ecc_module.init_rcx(config=workspace.config.get(StepEnum.RCX.value, "")) + rcx_config_path = workspace.config.get(StepEnum.RCX.value, "") + rcx_config = json_read(rcx_config_path) + rcx_pdk = str(rcx_config.get("pdk", "") or "").strip() + ecc_module.init_rcx(config=rcx_config_path, pdk=rcx_pdk) ecc_module.run_rcx() ecc_module.report_rcx() sub_flow.update_step(step_name=EccSubFlowEnum.run_rcx.value, state=StateEnum.Success) diff --git a/test/test_ecc_tools_module.py b/test/test_ecc_tools_module.py index 4853c553..7748a784 100644 --- a/test/test_ecc_tools_module.py +++ b/test/test_ecc_tools_module.py @@ -4,6 +4,33 @@ from chipcompiler.tools.ecc.module import ECCToolsModule +class FakeEcc: + def __init__(self): + self.calls = [] + + def init_rcx(self, **kwargs): + self.calls.append(kwargs) + return True + + def test_ecc_tools_module_imports_installed_native_extension(): module = ECCToolsModule() assert module.get_ecc() is not None + + +def test_init_rcx_passes_pdk_when_configured(): + module = ECCToolsModule.__new__(ECCToolsModule) + module.ecc = FakeEcc() + + assert module.init_rcx(config="/tmp/rcx.json", pdk="ics55") is True + + assert module.ecc.calls == [{"config": "/tmp/rcx.json", "pdk": "ics55"}] + + +def test_init_rcx_omits_empty_pdk_for_backward_compatibility(): + module = ECCToolsModule.__new__(ECCToolsModule) + module.ecc = FakeEcc() + + assert module.init_rcx(config="/tmp/rcx.json") is True + + assert module.ecc.calls == [{"config": "/tmp/rcx.json"}] From 756c4bf3dac9c51b13e58fbbac104f5f119c4687 Mon Sep 17 00:00:00 2001 From: Emin Date: Mon, 8 Jun 2026 16:51:12 +0800 Subject: [PATCH 2/2] chore: bump ecc submodule Signed-off-by: Emin --- chipcompiler/thirdparty/ecc-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chipcompiler/thirdparty/ecc-tools b/chipcompiler/thirdparty/ecc-tools index 545e372a..e6050a57 160000 --- a/chipcompiler/thirdparty/ecc-tools +++ b/chipcompiler/thirdparty/ecc-tools @@ -1 +1 @@ -Subproject commit 545e372a6b22a4e89199e0c9ebdddd2d2d5388e6 +Subproject commit e6050a57e48f7c4567552d6ba2f86958d63d8d51