Skip to content

Commit

Permalink
libarch: interchange: fixed model ports reading
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Comodi <[email protected]>
  • Loading branch information
acomodi committed Oct 26, 2021
1 parent e168dc7 commit 4712f09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions libs/libarchfpga/src/read_fpga_interchange_arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ struct ArchReader {
"Model output ports can not have combinational sink ports");
}

model_port->min_size = 1;
model_port->size = 1;
if (port.isBus()) {
int s = port.getBus().getBusStart();
int e = port.getBus().getBusEnd();
model_port->size = std::abs(e - s) + 1;
}

port_names.insert(std::pair<std::string, enum PORTS>(model_port->name, dir));
//Add the port
if (dir == IN_PORT) {
Expand Down
2 changes: 1 addition & 1 deletion vpr/test/test_interchange_netlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TEST_CASE("read_interchange_netlist", "[vpr]") {
std::vector<t_physical_tile_type> physical_tile_types;
std::vector<t_logical_block_type> logical_block_types;

FPGAInterchangeReadArch(kArchFile, &arch, physical_tile_types, logical_block_types);
FPGAInterchangeReadArch(kArchFile, /*timing_enabled=*/true, &arch, physical_tile_types, logical_block_types);

vpr_setup.user_models = arch.models;
vpr_setup.library_models = arch.model_library;
Expand Down

0 comments on commit 4712f09

Please sign in to comment.