parse_csv

Contains functions for parsing CSV files related to the fabric definition.

Functions

parseFabricCSV(fileName)

Parse a CSV file and returns a fabric object.

parseSupertilesCSV(fileName, tileDic)

Parse a CSV supertile configuration file and returns all SuperTile objects.

parseTilesCSV(fileName)

Parse a CSV tile configuration file and returns all tile objects.

Module Contents

parseFabricCSV(fileName)[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.

Return type:

Fabric

parseSupertilesCSV(fileName, tileDic)[source]

Parse a CSV supertile configuration file and returns all SuperTile objects.

Parameters:
  • fileName (Path) – The path to the CSV file.

  • tileDic (dict[str, Tile]) – Dict of tiles.

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.

Return type:

list[SuperTile]

parseTilesCSV(fileName)[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.

Return type:

tuple[list[Tile], list[tuple[str, str]]]

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.