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
buildmethod 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 Recvfrom the input ports, transform the inputs, andsendon the output ports
All of these concepts are covered in-depth in the examples