Skip to content

Commit

Permalink
[core] add more verbose to help debug failed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tangxifan committed Jul 27, 2023
1 parent a284894 commit 97219fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion openfpga/src/annotation/fabric_tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ bool FabricTile::equivalent_tile(const FabricTileId& tile_a,
}

int FabricTile::build_unique_tiles(const DeviceGrid& grids,
const DeviceRRGSB& device_rr_gsb) {
const DeviceRRGSB& device_rr_gsb,
const bool& verbose) {
for (size_t ix = 0; ix < grids.width(); ++ix) {
for (size_t iy = 0; iy < grids.height(); ++iy) {
if (!valid_tile_id(tile_coord2id_lookup_[ix][iy])) {
Expand All @@ -607,13 +608,19 @@ int FabricTile::build_unique_tiles(const DeviceGrid& grids,
for (FabricTileId unique_tile_id : unique_tile_ids_) {
if (equivalent_tile(tile_coord2id_lookup_[ix][iy], unique_tile_id,
grids, device_rr_gsb)) {
VTR_LOGV(verbose,
"Tile[%lu][%lu] is a mirror to the unique tile[%lu][%lu]\n",
ix, iy, tile_coordinate(unique_tile_id).x(),
tile_coordinate(unique_tile_id).y());
is_unique_tile = false;
tile_coord2unique_tile_ids_[ix][iy] = unique_tile_id;
break;
}
}
/* Update list if this is a unique tile */
if (is_unique_tile) {
VTR_LOGV(verbose, "Tile[%lu][%lu] is added as a new unique tile\n", ix,
iy);
unique_tile_ids_.push_back(tile_coord2id_lookup_[ix][iy]);
tile_coord2unique_tile_ids_[ix][iy] = tile_coord2id_lookup_[ix][iy];
}
Expand Down
2 changes: 1 addition & 1 deletion openfpga/src/annotation/fabric_tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class FabricTile {
void init(const vtr::Point<size_t>& max_coord);
/** @brief Identify the number of unique tiles and keep in the lookup */
int build_unique_tiles(const DeviceGrid& grids,
const DeviceRRGSB& device_rr_gsb);
const DeviceRRGSB& device_rr_gsb, const bool& verbose);

public: /* Validators */
bool valid_tile_id(const FabricTileId& tile_id) const;
Expand Down
2 changes: 1 addition & 1 deletion openfpga/src/fabric/build_fabric_tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int build_fabric_tile(FabricTile& fabric_tile, const TileConfig& tile_config,

/* Build unique tiles to compress the number of tile modules to be built in
* later steps */
status_code = fabric_tile.build_unique_tiles(grids, device_rr_gsb);
status_code = fabric_tile.build_unique_tiles(grids, device_rr_gsb, verbose);
VTR_LOGV(verbose, "Extracted %lu uniques tiles from the FPGA fabric\n",
fabric_tile.unique_tiles().size());

Expand Down

0 comments on commit 97219fd

Please sign in to comment.