parse_csvΒΆ
Contains functions for parsing CSV files related to the fabric definition.
FunctionsΒΆ
|
Parse a CSV file and returns a fabric object. |
|
Parse a single line of the port configuration from the CSV file. |
|
Parse a CSV supertile configuration file and returns all SuperTile objects. |
|
Parse a CSV tile configuration file and returns all tile objects. |
Module ContentsΒΆ
- parseFabricCSV(fileName) Fabric[source]ΒΆ
Parse a CSV file and returns a fabric object.
- Parameters:
fileName (str) β Directory of the CSV file.
- Raises:
FileNotFoundError β If the input does not exist.
InvalidFabricDefinition β If the fabric definition is invalid.
InvalidFabricParameter β If the fabric parameter is invalid.
InvalidFileType β If the input file is not a CSV file.
- Returns:
The fabric object.
- parsePortLine(line) tuple[list[Port], tuple[str, str] | None][source]ΒΆ
Parse a single line of the port configuration from the CSV file.
- Parameters:
line (str) β CSV line containing port configuration data.
- Raises:
InvalidPortType β If the port definition is invalid.
- Returns:
A tuple containing a list of parsed ports and an optional common wire pair.
- parseSupertilesCSV(fileName, tileDic) list[SuperTile][source]ΒΆ
Parse a CSV supertile configuration file and returns all SuperTile objects.
- Parameters:
- Raises:
InvalidFileType β If the input file is not a CSV file.
FileNotFoundError β If the input does not exist.
InvalidSupertileDefinition β If the supertile definition is invalid.
- Returns:
List of SuperTile objects.
- parseTilesCSV(fileName) tuple[list[Tile], list[tuple[str, str]]][source]ΒΆ
Parse a CSV tile configuration file and returns all tile objects.
- Parameters:
fileName (Path) β The path to the CSV file.
- Returns:
A tuple containing a list of Tile objects and a list of common wire pairs.
- Raises:
ValueError β If CARRY port prefix is not a string
FileExistsError β If the input does not exist.
InvalidFileType β If the input file is not a CSV file.
InvalidTileDefinition β If the tile definition is invalid.
InvalidPortType β If port type is invalid.