Abstract Module
Hardware Module.
AMod
Bases: BaseTopMod
A Normal Module With Parameters And A Fixed Number Of Ports (maybe ifdef encapsulated).
See BaseMod for arguments, attributes and details.
All module parameter, local parameter, ports, signals and submodules
MUST be added and created within the _build method:
AMod Build Examples
_build(self):
>>> import ucdp as u
>>> class AdderMod(u.AMod):
...
... def _build(self) -> None:
... width_p = self.add_param(u.IntegerType(default=16), 'width_p')
... datatype = u.UintType(width_p)
... self.add_port(datatype, "a_i")
... self.add_port(datatype, "b_i")
... self.add_port(datatype, "y_o")
Warning
There is no other build method on purpose!