Skip to content

Commit cd52523

Browse files
committed
Start adding some documentation for steps. Don't expose for now as interfaces need fixing for boards, sim etc
1 parent 6e657c4 commit cd52523

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

chipflow_lib/steps/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
Steps provide an extensible way to modify the `chipflow` command behavior for a given design
3+
"""
4+
5+
from abc import ABC
6+
7+
class StepBase(ABC):
8+
def __init__(self, config):
9+
self.platform = platform
10+
11+
def build_cli_parser(self, parser):
12+
"Build the cli parser for this step"
13+
...
14+
15+
def run_cli(self, args):
16+
"Called when this step's is used from `chipflow` command"
17+
self.build()

chipflow_lib/steps/board.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ def run_cli(self, args):
1313
self.build()
1414

1515
def build(self):
16+
"Build for the given platform"
1617
self.platform.build()

chipflow_lib/steps/silicon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def elaborate(self, platform: SiliconPlatform):
5353

5454

5555
class SiliconStep:
56-
"""Prepare and submit the design for an ASIC."""
56+
"""Step to Prepare and submit the design for an ASIC."""
5757
def __init__(self, config):
5858
self.config = config
5959

chipflow_lib/steps/software.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from doit.doit_cmd import DoitMain
55

66

7-
class SoftwareStep:
8-
"""Build the software."""
7+
class SoftwareStep(StepBase):
8+
"""Base step to build the software."""
99

1010
doit_build_module = None
1111

@@ -19,7 +19,9 @@ def run_cli(self, args):
1919
self.build()
2020

2121
def doit_build(self):
22+
"Run the overridden doit_build_module"
2223
DoitMain(ModuleTaskLoader(self.doit_build_module)).run(["build_software"])
2324

2425
def build(self):
26+
"Build the software for your design"
2527
self.doit_build()

0 commit comments

Comments
 (0)