FABulous.geometry_generator.bel_geometry ======================================== .. py:module:: FABulous.geometry_generator.bel_geometry .. autoapi-nested-parse:: Class for generating and managing the geometry of BELs. Classes ------- .. py:class:: BelGeometry() A data structure representing the geometry of a bel. .. attribute:: name Name of the bel :type: str .. attribute:: src File path of the bel HDL source file :type: str .. attribute:: width Width of the bel :type: int .. attribute:: height Height of the bel :type: int .. attribute:: relX X coordinate of the bel, relative within the tile :type: int .. attribute:: relY Y coordinate of the bel, relative within the tile :type: int .. attribute:: internalInputs Internal input port names of the bel :type: List[str] .. attribute:: internalOutputs Internal output port names of the bel :type: List[str] .. attribute:: externalInputs External input port names of the bel :type: List[str] .. attribute:: externalOutputs External output port names of the bel :type: List[str] .. attribute:: internalPortGeoms List of geometries of the internal ports of the bel :type: List[PortGeometry] .. attribute:: externalPortGeoms List of geometries of the external ports of the bel :type: List[PortGeometry] .. attribute:: Initialize a BelGeometry instance. .. attribute:: Sets all attributes to default values :type: None for names/sources, .. attribute:: zero for dimensions and coordinates, and empty lists for .. attribute:: port names and geometries. **Methods:** .. py:method:: adjustPos(relX, relY) 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 .. py:method:: generateGeometry(bel, padding) 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 .. py:method:: generatePortsGeometry(bel, padding) 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 .. py:method:: saveToCSV(writer) 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