bel_geometry¶
Class for generating and managing the geometry of BELs.
Classes¶
|
A data structure representing the geometry of a bel. |
Module Contents¶
BelGeometry¶
- BelGeometry :module:
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.
- ivar name:
Name of the bel
- vartype name:
str | None
- ivar src:
File path of the bel HDL source file
- vartype src:
str | None
- ivar width:
Width of the bel
- vartype width:
int
- ivar height:
Height of the bel
- vartype height:
int
- ivar relX:
X coordinate of the bel, relative within the tile
- vartype relX:
int
- ivar relY:
Y coordinate of the bel, relative within the tile
- vartype relY:
int
- ivar internalInputs:
Internal input port names of the bel
- vartype internalInputs:
list[str]
- ivar internalOutputs:
Internal output port names of the bel
- vartype internalOutputs:
list[str]
- ivar externalInputs:
External input port names of the bel
- vartype externalInputs:
list[str]
- ivar externalOutputs:
External output port names of the bel
- vartype externalOutputs:
list[str]
- ivar internalPortGeoms:
List of geometries of the internal ports of the bel
- vartype internalPortGeoms:
list[PortGeometry]
- ivar externalPortGeoms:
List of geometries of the external ports of the bel
- vartype externalPortGeoms:
list[PortGeometry]
- adjustPosrelX, relY :module:
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.
- param relX:
New relative X coordinate within the tile
- type relX:
int
- param relY:
New relative Y coordinate within the tile
- type relY:
int
- generateGeometrybel, padding :module:
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.
- param bel:
The BEL object to generate the geometry for
- type bel:
Bel
- param padding:
The padding space to add around the BEL
- type padding:
int
- generatePortsGeometrybel, padding :module:
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).
- param bel:
The BEL object containing port information
- type bel:
Bel
- param padding:
The padding space to add around ports
- type padding:
int
- saveToCSVwriter :module:
Save BEL geometry data to CSV format.
Writes the BEL geometry information including name, source file, position, dimensions, and all port geometries to a CSV file using the provided writer.
- param writer:
The CSV writer object to use for output
- type writer:
object