bel_geometryΒΆ
Class for generating and managing the geometry of BELs.
ClassesΒΆ
A data structure representing the geometry of a bel. |
Module ContentsΒΆ
BelGeometryΒΆ
- class BelGeometry[source]ΒΆ
A data structure representing the geometry of a bel.
Sets all attributes to default values: None for names/sources, zero for dimensions and coordinates, and empty lists for port names and geometries.
- Variables:
name (str | None) β Name of the bel
src (str | None) β File path of the bel HDL source file
width (int) β Width of the bel
height (int) β Height of the bel
relX (int) β X coordinate of the bel, relative within the tile
relY (int) β Y coordinate of the bel, relative within the tile
internalInputs (list[str]) β Internal input port names of the bel
internalOutputs (list[str]) β Internal output port names of the bel
externalInputs (list[str]) β External input port names of the bel
externalOutputs (list[str]) β External output port names of the bel
internalPortGeoms (list[PortGeometry]) β List of geometries of the internal ports of the bel
externalPortGeoms (list[PortGeometry]) β List of geometries of the external ports of the bel
MethodsΒΆ
- adjustPos(relX, relY) None[source]ΒΆ
Adjust the position of the BEL within its containing tile.
Updates the relative X and Y coordinates of the BEL to position it correctly within the tile layout.
- generateGeometry(bel, padding) None[source]ΒΆ
Generate the geometry for a BEL (Basic Element).
Creates the geometric representation of a BEL including its dimensions and port layout. The height is determined by the maximum number of ports on either side plus padding, while width is currently fixed.
- generatePortsGeometry(bel, padding) None[source]ΒΆ
Generate the geometry for all ports of the BEL.
Creates PortGeometry objects for all internal and external input/output ports of the BEL. Internal ports are positioned on the left side (X=0), while external ports are positioned on the right side (X=width).