Skip to content

Commit 7fd8611

Browse files
committed
[libs][physical_types] add is_io to logical block
1 parent 5888193 commit 7fd8611

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libs/libarchfpga/src/physical_types.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ bool t_logical_block_type::is_empty() const {
230230
return name == std::string(EMPTY_BLOCK_NAME);
231231
}
232232

233+
bool t_logical_block_type::is_io() const {
234+
// Iterate over all equivalent tiles and return true if any
235+
// of them are IO tiles
236+
for (const auto& tile : equivalent_tiles) {
237+
if (tile->is_io()) {
238+
return true;
239+
}
240+
}
241+
return false;
242+
}
243+
233244
const t_port* t_logical_block_type::get_port(std::string_view port_name) const {
234245
for (int i = 0; i < pb_type->num_ports; i++) {
235246
auto port = pb_type->ports[i];

libs/libarchfpga/src/physical_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,9 @@ struct t_logical_block_type {
978978
// Is this t_logical_block_type empty?
979979
bool is_empty() const;
980980

981+
// Returns true if this logical block type is an IO block
982+
bool is_io() const;
983+
981984
public:
982985
/**
983986
* @brief Returns the logical block port given the port name and the corresponding logical block type

0 commit comments

Comments
 (0)