|
22 | 22 | from chipflow_lib.cli import run as cli_run |
23 | 23 | from chipflow_lib.steps.silicon import SiliconStep, SiliconTop |
24 | 24 | from chipflow_lib.config_models import Config, ChipFlowConfig, SiliconConfig |
| 25 | +from chipflow_lib.platforms._internal import Process |
25 | 26 |
|
26 | 27 | DEFAULT_PINLOCK = { |
27 | 28 | "process" : "ihp_sg13g2", |
28 | 29 | "package" : { |
29 | | - "type": { |
| 30 | + "package_type": { |
30 | 31 | "name": "pga144", |
31 | 32 | "package_type": "QuadPackageDef", |
32 | 33 | "width": 36, |
@@ -56,7 +57,7 @@ def setUp(self): |
56 | 57 | os.environ, {"CHIPFLOW_ROOT": self.temp_dir.name} |
57 | 58 | ) |
58 | 59 | self.chipflow_root_patcher.start() |
59 | | - _ensure_chipflow_root.root = None |
| 60 | + _ensure_chipflow_root.root = None # type: ignore |
60 | 61 |
|
61 | 62 | # Create basic config for tests |
62 | 63 | self.config = { |
@@ -97,9 +98,8 @@ def test_init(self, mock_silicontop_class): |
97 | 98 | top={"mock_component": "module.MockComponent"}, |
98 | 99 | silicon=SiliconConfig( |
99 | 100 | package="cf20", |
100 | | - process="ihp_sg13g2", |
| 101 | + process=Process.HELVELLYN2, |
101 | 102 | debug={"heartbeat": True}, |
102 | | - pads={}, |
103 | 103 | power={} |
104 | 104 | ) |
105 | 105 | )) |
@@ -133,7 +133,6 @@ def test_prepare(self, mock_top_components, mock_platform_class, mock_silicontop |
133 | 133 | package="cf20", |
134 | 134 | process="ihp_sg13g2", |
135 | 135 | debug={"heartbeat": True}, |
136 | | - pads={}, |
137 | 136 | power={} |
138 | 137 | ) |
139 | 138 | )) |
@@ -182,34 +181,6 @@ def test_build_cli_parser(self): |
182 | 181 | default=False, action="store_true" |
183 | 182 | ) |
184 | 183 |
|
185 | | - @mock.patch("chipflow_lib.steps.silicon.SiliconPlatform") |
186 | | - @mock.patch("chipflow_lib.steps.silicon.top_components") |
187 | | - @mock.patch("chipflow_lib.steps.silicon.dotenv.load_dotenv") |
188 | | - @mock.patch("chipflow_lib.steps.silicon.SiliconStep.submit") |
189 | | - @mock.patch("chipflow_lib.steps.silicon.SiliconStep.prepare") |
190 | | - def test_cli_prepare(self, mock_prepare, mock_submit, mock_dotenv, mock_top_components, mock_platform_class): |
191 | | - """Test prepare method""" |
192 | | - mock_platform = mock_platform_class.return_value |
193 | | - mock_platform.build.return_value = "/path/to/rtlil" |
194 | | - |
195 | | - # Create mock args |
196 | | - args = mock.MagicMock() |
197 | | - args.action = "prepare" |
198 | | - |
199 | | - # Create SiliconStep instance - parse config first |
200 | | - config_obj = Config.model_validate(self.config) |
201 | | - step = SiliconStep(config_obj) |
202 | | - |
203 | | - # Set up the mock to handle SiliconTop |
204 | | - |
205 | | - # Call the method |
206 | | - step.run_cli(args) |
207 | | - |
208 | | - mock_prepare.assert_called_once() |
209 | | - mock_submit.assert_not_called() |
210 | | - # Verify dotenv not loaded for prepare |
211 | | - mock_dotenv.assert_not_called() |
212 | | - |
213 | 184 | @unittest.skip |
214 | 185 | @mock.patch("chipflow_lib.steps.silicon.SiliconTop") |
215 | 186 | @mock.patch("chipflow_lib.steps.silicon.SiliconStep.prepare") |
|
0 commit comments