Skip to content

Commit 4712f09

Browse files
committed
libarch: interchange: fixed model ports reading
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
1 parent e168dc7 commit 4712f09

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ struct ArchReader {
221221
"Model output ports can not have combinational sink ports");
222222
}
223223

224+
model_port->min_size = 1;
225+
model_port->size = 1;
226+
if (port.isBus()) {
227+
int s = port.getBus().getBusStart();
228+
int e = port.getBus().getBusEnd();
229+
model_port->size = std::abs(e - s) + 1;
230+
}
231+
224232
port_names.insert(std::pair<std::string, enum PORTS>(model_port->name, dir));
225233
//Add the port
226234
if (dir == IN_PORT) {

vpr/test/test_interchange_netlist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TEST_CASE("read_interchange_netlist", "[vpr]") {
2121
std::vector<t_physical_tile_type> physical_tile_types;
2222
std::vector<t_logical_block_type> logical_block_types;
2323

24-
FPGAInterchangeReadArch(kArchFile, &arch, physical_tile_types, logical_block_types);
24+
FPGAInterchangeReadArch(kArchFile, /*timing_enabled=*/true, &arch, physical_tile_types, logical_block_types);
2525

2626
vpr_setup.user_models = arch.models;
2727
vpr_setup.library_models = arch.model_library;

0 commit comments

Comments
 (0)