Usage guide
Circuits designed in CircuitBrew are written as standard Python classes using the following rules:
Netlisting
- Inherit from Module 1.
- Every Port must be defined as a class attribute.
- Every Module must have a
def build(self)
method. - Every sub-instance to be emitted as part of your Module must be assigned as an instance attribute on
the Module using
self
. - Every
build
method needs aself.finalize()
statement at the end.
Other than that, you can use bog-standard Python to construct your instances/connectivity.
Modeling
- Implement an
async def sim(self):
method Recv
from the input ports, transform the inputs, andsend
on the output ports
All of these concepts are covered in-depth in the examples