Skip to content

Commit 3ac20dd

Browse files
robtaylorclaude
andcommitted
Fix docstring formatting and update URLs to .com domain
- Fix RST formatting in docstrings for IOModelOptions, IOModel, DriverModel, and simulatable_interface - Use double backticks for inline code references - Move orphaned docstring inside simulatable_interface function - Update all build.chipflow.org URLs to build.chipflow.com - Fix test assertions for new URL 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7fb7cf4 commit 3ac20dd

9 files changed

Lines changed: 44 additions & 35 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,6 @@ chipflow-lib is a Python library for working with the ChipFlow platform, enablin
136136
- `CHIPFLOW_ROOT`: Project root directory (auto-detected if not set)
137137
- `CHIPFLOW_API_KEY`: API key for cloud builder authentication
138138
- `CHIPFLOW_API_KEY_SECRET`: Deprecated, use `CHIPFLOW_API_KEY` instead
139-
- `CHIPFLOW_API_ORIGIN`: Cloud builder URL (default: https://build.chipflow.org)
139+
- `CHIPFLOW_API_ORIGIN`: Cloud builder URL (default: https://build.chipflow.com)
140140
- `CHIPFLOW_BACKEND_VERSION`: Developer override for backend version
141141
- `CHIPFLOW_SUBMISSION_NAME`: Override submission name (default: git commit hash)

chipflow/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def get_api_key(api_origin: str | None = None, interactive: bool = True, force_l
254254
AuthenticationError: If all authentication methods fail
255255
"""
256256
if api_origin is None:
257-
api_origin = os.environ.get("CHIPFLOW_API_ORIGIN", "https://build.chipflow.org")
257+
api_origin = os.environ.get("CHIPFLOW_API_ORIGIN", "https://build.chipflow.com")
258258

259259
# Method 1: Check environment variable
260260
api_key = os.environ.get("CHIPFLOW_API_KEY")

chipflow/auth_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _login(self, force=False):
5656
"""Perform login/authentication."""
5757
import os
5858

59-
api_origin = os.environ.get("CHIPFLOW_API_ORIGIN", "https://build.chipflow.org")
59+
api_origin = os.environ.get("CHIPFLOW_API_ORIGIN", "https://build.chipflow.com")
6060

6161
print(f"🔐 Authenticating with ChipFlow API ({api_origin})...")
6262

chipflow/platform/io/iosignature.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,20 @@ class IOModelOptions(TypedDict):
5656
Attributes:
5757
invert: Polarity inversion. If the value is a simple :class:`bool`, it specifies inversion for
5858
the entire port. If the value is an iterable of :class:`bool`, the iterable must have the
59-
same length as the width of :py:`io`, and the inversion is specified for individual wires.
59+
same length as the width of ``io``, and the inversion is specified for individual wires.
6060
individual_oe: controls whether each output wire is associated with an individual Output Enable bit
6161
or if a single OE bit will be used for entire port. The default value is False (indicating that a
6262
single OE bit controls the entire port).
63-
power_domain: The name of the I/O power domain. NB there is only one of these, so IO with multiple power domains must be split up.
64-
65-
clock_domain: the name of the I/O's clock domain (see `Amaranth.ClockDomain`). NB there is only one of these, so IO with multiple clocks must be split up.
63+
power_domain: The name of the I/O power domain. NB there is only one of these, so IO with
64+
multiple power domains must be split up.
65+
clock_domain: the name of the I/O's clock domain (see ``amaranth.hdl.ClockDomain``). NB there
66+
is only one of these, so IO with multiple clocks must be split up.
6667
buffer_in: Should the IO pad have an input buffer?
6768
buffer_out: Should the IO pad have an output buffer?
68-
sky130_drive_mode: Drive mode for output buffer on sky130
69-
trip_point: Trip Point configutation for input buffer
70-
init: The value for the initial values of the port
71-
init_oe: The value for the initial values of the output enable(s) of the port
69+
sky130_drive_mode: Drive mode for output buffer on sky130.
70+
trip_point: Trip Point configuration for input buffer.
71+
init: The value for the initial values of the port.
72+
init_oe: The value for the initial values of the output enable(s) of the port.
7273
"""
7374

7475
invert: NotRequired[bool|Tuple[bool, ...]]
@@ -85,11 +86,11 @@ class IOModelOptions(TypedDict):
8586
@pydantic.config.with_config(ConfigDict(arbitrary_types_allowed=True)) # type: ignore[reportCallIssue]
8687
class IOModel(IOModelOptions):
8788
"""
88-
Setting for IO Ports (see also base class `IOModelOptions`)
89+
Setting for IO Ports (see also base class :class:`IOModelOptions`).
8990
9091
Attributes:
91-
direction: `io.Direction.Input`, `io.Direction.Output` or `io.Direction.Bidir`
92-
width: width of port, default is 1
92+
direction: ``io.Direction.Input``, ``io.Direction.Output`` or ``io.Direction.Bidir``.
93+
width: Width of port, default is 1.
9394
"""
9495

9596
width: int

chipflow/platform/io/signatures.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ class Data(TypedDict, Generic[_T_DataClass]):
8484

8585
class DriverModel(TypedDict):
8686
"""
87-
Options for `SoftwareDriverSignature`
87+
Options for :class:`SoftwareDriverSignature`.
8888
8989
Attributes:
90-
component: The `wiring.Component` that this is the signature for.
91-
regs_struct: The name of the C struct that represents the registers of this component
92-
h_files: Header files for the driver
93-
c_files: C files for the driver
94-
regs_bus: The bus of this `Component` which contains its control registers
95-
include_dirs: any extra include directories needed by the driver
90+
component: The ``wiring.Component`` that this is the signature for.
91+
regs_struct: The name of the C struct that represents the registers of this component.
92+
h_files: Header files for the driver.
93+
c_files: C files for the driver.
94+
regs_bus: The bus of this ``Component`` which contains its control registers.
95+
include_dirs: Any extra include directories needed by the driver.
9696
"""
9797
# we just extrat the info we need, don't actually serialise a `wiring.Component`...
9898
component: Annotated[
@@ -125,13 +125,21 @@ def _unpack_dict(d: dict) -> str:
125125
params = [ f"{k}={repr(v)}" for k,v in d.items()]
126126
return ', '.join(params)
127127

128-
"""
129-
Attributes:
130-
__chipflow_parameters__: list of tuples (name, value).
131-
It is expected that a model that takes parameters is implmemted as a template, with the parameters in the order
132-
given.
133-
"""
128+
134129
def simulatable_interface(base="com.chipflow.chipflow"):
130+
"""
131+
Decorator for creating simulatable interface signatures.
132+
133+
The decorated class will have a ``__chipflow_parameters__`` method that returns
134+
a list of tuples (name, value). It is expected that a model that takes parameters
135+
is implemented as a template, with the parameters in the order given.
136+
137+
Args:
138+
base: Base UID string for the interface (default: "com.chipflow.chipflow").
139+
140+
Returns:
141+
A decorator function that adds chipflow annotation support to a class.
142+
"""
135143
def decorate(klass):
136144
assert _VALID_UID(base)
137145
dec = amaranth_annotate(SimInterface, SIM_ANNOTATION_SCHEMA)

chipflow/platform/silicon_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def submit(self, rtlil_path, args):
121121
--wait: Wait until build has completed. Use '-v' to increase level of verbosity
122122
--log-file <file>: Log full debug output to file
123123
"""
124-
chipflow_api_origin = os.environ.get("CHIPFLOW_API_ORIGIN", "https://build.chipflow.org")
124+
chipflow_api_origin = os.environ.get("CHIPFLOW_API_ORIGIN", "https://build.chipflow.com")
125125

126126
if not args.dry_run:
127127
# Get API key using the new authentication helper

docs/UNFINISHED_IDEAS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ These may be implemented in the future or serve as inspiration for documentation
88
### Environment Variables (REAL - should be documented)
99
- `CHIPFLOW_ROOT`: Root directory of your project (must contain chipflow.toml)
1010
- `CHIPFLOW_API_KEY`: API key for ChipFlow cloud services
11-
- `CHIPFLOW_API_ENDPOINT`: Custom API endpoint (defaults to https://build.chipflow.org)
11+
- `CHIPFLOW_API_ENDPOINT`: Custom API endpoint (defaults to https://build.chipflow.com)
1212
- `CHIPFLOW_DEBUG`: Enable debug logging (set to "1")
1313

1414
**Action**: Add environment variable reference to chipflow-commands.rst or chipflow-toml-guide.rst

docs/getting-started.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Method 2: Manual API key (Alternative)
100100

101101
If you prefer to manually manage your API key:
102102

103-
1. Go to https://build.chipflow.org/ and log in with your GitHub account
103+
1. Go to https://build.chipflow.com/ and log in with your GitHub account
104104
2. Click on the 'User' menu, then on 'Create/Refresh API Key'
105105
3. Your new API key will appear at the top
106106

@@ -179,7 +179,7 @@ This should return something like:
179179

180180
INFO:chipflow.steps.silicon:Submitting c23dab6-dirty for project chipflow-examples-minimal
181181
INFO:chipflow.steps.silicon:Submitted design: {'build_id': '3f51a69c-b3e3-4fd3-88fd-52826ac5e5dd'}
182-
Design submitted successfully! Build URL: https://build-staging.chipflow.org//build/3f51a69c-b3e3-4fd3-88fd-52826ac5e5dd
182+
Design submitted successfully! Build URL: https://build.chipflow.com/build/3f51a69c-b3e3-4fd3-88fd-52826ac5e5dd
183183

184184
Your design will now start building: pictures and logs of the build are
185185
available at build URL that is returned, once it is complete.

tests/test_silicon_submit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_browser_prompt_yes(self, mock_subprocess, mock_isatty, mock_input, mock
5050
config.chipflow.silicon = True
5151
config.chipflow.project_name = 'test_project'
5252
step = SiliconStep(config)
53-
step._build_url = "https://build.chipflow.org/build/test123"
53+
step._build_url = "https://build.chipflow.com/build/test123"
5454
step.platform._ports = {}
5555

5656
# Mock the submit method dependencies
@@ -74,7 +74,7 @@ def test_browser_prompt_yes(self, mock_subprocess, mock_isatty, mock_input, mock
7474
step.submit('/tmp/test.il', args)
7575

7676
# Verify webbrowser.open was called
77-
mock_webbrowser.assert_called_once_with("https://build.chipflow.org/build/test123")
77+
mock_webbrowser.assert_called_once_with("https://build.chipflow.com/build/test123")
7878
mock_exit.assert_called_once_with(0)
7979

8080
@mock.patch('chipflow.packaging.load_pinlock')
@@ -99,7 +99,7 @@ def test_browser_prompt_no(self, mock_subprocess, mock_isatty, mock_input, mock_
9999
config.chipflow.silicon = True
100100
config.chipflow.project_name = 'test_project'
101101
step = SiliconStep(config)
102-
step._build_url = "https://build.chipflow.org/build/test123"
102+
step._build_url = "https://build.chipflow.com/build/test123"
103103
step.platform._ports = {}
104104

105105
# Mock the submit method dependencies
@@ -146,7 +146,7 @@ def test_browser_prompt_not_tty(self, mock_subprocess, mock_isatty, mock_input,
146146
config.chipflow.silicon = True
147147
config.chipflow.project_name = 'test_project'
148148
step = SiliconStep(config)
149-
step._build_url = "https://build.chipflow.org/build/test123"
149+
step._build_url = "https://build.chipflow.com/build/test123"
150150
step.platform._ports = {}
151151

152152
# Mock the submit method dependencies

0 commit comments

Comments
 (0)