Skip to content

Commit c05c72b

Browse files
committed
fix lint issues
1 parent f74815f commit c05c72b

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

chipflow_lib/_appresponse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# SPDX-License-Identifier: BSD-2-Clause
2+
13
from dataclasses import dataclass
24

35
from pydantic import BaseModel, PlainSerializer, model_serializer
@@ -32,7 +34,7 @@ def _serialize(self):
3234
# Run Annotated PlainSerializer
3335
for metadata in self.model_fields[name].metadata:
3436
if isinstance(metadata, PlainSerializer):
35-
value = metadata.func(value)
37+
value = metadata.func(value) # type: ignore
3638

3739
serialized[serialize_key] = value
3840

chipflow_lib/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: BSD-2-Clause
2+
23
import argparse
34
import inspect
45
import sys

chipflow_lib/platforms/_internal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
__all__ = ['IO_ANNOTATION_SCHEMA', 'IOSignature', 'IOModel',
66
'OutputIOSignature', 'InputIOSignature', 'BidirIOSignature',
77
'load_pinlock', "PACKAGE_DEFINITIONS", 'top_components', 'LockFile',
8-
'Package', 'PortMap', 'Port', 'Process',
8+
'Package', 'PortMap', 'PortDesc', 'Process',
99
'GAPackageDef', 'QuadPackageDef', 'BareDiePackageDef', 'BasePackageDef',
1010
'BringupPins', 'JTAGPins', 'PowerPins',
1111
'SiliconPlatformPort', 'SiliconPlatform',

chipflow_lib/platforms/silicon.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from amaranth.lib.cdc import FFSynchronizer
1717
from amaranth.lib.wiring import Component, In, PureInterface
1818

19-
from amaranth.back import rtlil
19+
from amaranth.back import rtlil #type: ignore[reportAttributeAccessIssue]
2020
from amaranth.hdl import Fragment
2121
from amaranth.hdl._ir import PortDirection
2222

@@ -63,7 +63,7 @@ def elaborate(self, platform):
6363
heartbeat_ctr = Signal(self.counter_size)
6464
getattr(m.d, self.clock_domain).__iadd__(heartbeat_ctr.eq(heartbeat_ctr + 1))
6565

66-
heartbeat_buffer = io.Buffer("o", self.ports.heartbeat)
66+
heartbeat_buffer = io.Buffer(io.Direction.Output, self.ports.heartbeat)
6767
m.submodules.heartbeat_buffer = heartbeat_buffer
6868
m.d.comb += heartbeat_buffer.o.eq(heartbeat_ctr[-1]) # type: ignore
6969
return m
@@ -240,10 +240,10 @@ def __init__(self,
240240
self._ie = None
241241

242242
if self._oe is not None:
243-
self._oe_n = Signal(self._oe.width, name=f"{self._name}$oeb")
243+
self._oe_n = Signal(self._oe.shape().width, name=f"{self._name}$oeb")
244244
self._signals.append((self._oe_n, PortDirection.Output))
245245
if self._i is not None:
246-
self._ie = Signal(self._i.width, name=f"{self._name}$inp_dis")
246+
self._ie = Signal(self._i.shape().width, name=f"{self._name}$inp_dis")
247247
self._signals.append((self._ie, PortDirection.Input))
248248

249249
# Port Configuration
@@ -412,14 +412,14 @@ def instantiate_ports(self, m: Module):
412412
assert 'clock_domain' in clock.iomodel
413413
domain = clock.iomodel['clock_domain']
414414
setattr(m.domains, domain, ClockDomain(name=domain))
415-
clk_buffer = io.Buffer("i", self._ports[clock.port_name])
415+
clk_buffer = io.Buffer(io.Direction.Input, self._ports[clock.port_name])
416416
setattr(m.submodules, "clk_buffer_" + domain, clk_buffer)
417417
m.d.comb += ClockSignal().eq(clk_buffer.i) #type: ignore[reportAttributeAccessIssue]
418418

419419
for reset in pinlock.port_map.get_resets():
420420
assert 'clock_domain' in reset.iomodel
421421
domain = reset.iomodel['clock_domain']
422-
rst_buffer = io.Buffer("i", self._ports[reset.port_name])
422+
rst_buffer = io.Buffer(io.Direction.Input, self._ports[reset.port_name])
423423
setattr(m.submodules, reset.port_name, rst_buffer)
424424
setattr(m.submodules, reset.port_name + "_sync", FFSynchronizer(rst_buffer.i, ResetSignal())) #type: ignore[reportAttributeAccessIssue]
425425

chipflow_lib/steps/silicon.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ def network_err(e):
173173
fh.close()
174174
exit(1)
175175

176-
sp.info(f"> Submitting {submission_name} for project {self.config.chipflow.project_name} to ChipFlow Cloud {self._chipflow_api_origin}")
177-
sp.start("Sending design to ChipFlow Cloud")
176+
chipflow_api_origin = os.environ.get("CHIPFLOW_API_ORIGIN", "https://build.chipflow.org")
177+
build_submit_url = f"{chipflow_api_origin}/build/submit"
178178

179-
build_submit_url = f"{self._chipflow_api_origin}/build/submit"
179+
sp.info(f"> Submitting {submission_name} for project {self.config.chipflow.project_name} to ChipFlow Cloud {chipflow_api_origin}")
180+
sp.start("Sending design to ChipFlow Cloud")
180181

181182
assert self._chipflow_api_key
182-
assert self._chipflow_api_origin
183183
try:
184184
resp = requests.post(
185185
build_submit_url,
@@ -210,9 +210,9 @@ def network_err(e):
210210
# Handle response based on status code
211211
if resp.status_code == 200:
212212
logger.debug(f"Submitted design: {resp_data}")
213-
self._build_url = f"{self._chipflow_api_origin}/build/{resp_data['build_id']}"
214-
self._build_status_url = f"{self._chipflow_api_origin}/build/{resp_data['build_id']}/status"
215-
self._log_stream_url = f"{self._chipflow_api_origin}/build/{resp_data['build_id']}/logs?follow=true"
213+
self._build_url = f"{chipflow_api_origin}/build/{resp_data['build_id']}"
214+
self._build_status_url = f"{chipflow_api_origin}/build/{resp_data['build_id']}/status"
215+
self._log_stream_url = f"{chipflow_api_origin}/build/{resp_data['build_id']}/logs?follow=true"
216216

217217
sp.succeed(f"✅ Design submitted successfully! Build URL: {self._build_url}")
218218

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ test.cmd = "pytest"
7171
test-cov.cmd = "pytest --cov=chipflow_lib --cov-report=term"
7272
test-cov-html.cmd = "pytest --cov=chipflow_lib --cov-report=html"
7373
test-docs.cmd = "sphinx-build -b doctest docs/ docs/_build"
74-
lint.composite = [ "ruff check", "pyright chipflow_lib"]
74+
lint.composite = [ "./tools/license_check.sh", "ruff check", "pyright chipflow_lib"]
7575
docs.cmd = "sphinx-build docs/ docs/_build/ -W --keep-going"
7676
test-silicon.cmd = "pytest tests/test_silicon_platform.py tests/test_silicon_platform_additional.py tests/test_silicon_platform_amaranth.py tests/test_silicon_platform_build.py tests/test_silicon_platform_port.py --cov=chipflow_lib.platforms.silicon --cov-report=term"
7777
_check-project.call = "tools.check_project:main"

0 commit comments

Comments
 (0)