diff --git a/openfpga/src/fabric/memory_bank_shift_register_banks.cpp b/openfpga/src/fabric/memory_bank_shift_register_banks.cpp index 6956b22d2..0d4902936 100644 --- a/openfpga/src/fabric/memory_bank_shift_register_banks.cpp +++ b/openfpga/src/fabric/memory_bank_shift_register_banks.cpp @@ -1,9 +1,22 @@ +#include #include "vtr_assert.h" #include "memory_bank_shift_register_banks.h" /* begin namespace openfpga */ namespace openfpga { +std::vector MemoryBankShiftRegisterBanks::shift_register_bank_unique_modules() const { + std::vector sr_bank_modules; + for (const auto& region : sr_instance_info_) { + for (const auto& pair : region) { + if (sr_bank_modules.end() == std::find(sr_bank_modules.begin(), sr_bank_modules.end(), pair.first.first)) { + sr_bank_modules.push_back(pair.first.first); + } + } + } + return sr_bank_modules; +} + std::vector MemoryBankShiftRegisterBanks::shift_register_bank_modules(const ConfigRegionId& region) const { std::vector sr_bank_modules; VTR_ASSERT(valid_region_id(region)); diff --git a/openfpga/src/fabric/memory_bank_shift_register_banks.h b/openfpga/src/fabric/memory_bank_shift_register_banks.h index 262508bad..59c92fef7 100644 --- a/openfpga/src/fabric/memory_bank_shift_register_banks.h +++ b/openfpga/src/fabric/memory_bank_shift_register_banks.h @@ -22,6 +22,9 @@ namespace openfpga { ******************************************************************************/ class MemoryBankShiftRegisterBanks { public: /* Accessors */ + /* @brief Return a list of modules of unique shift register banks across all the regions */ + std::vector shift_register_bank_unique_modules() const; + /* @brief Return a list of modules of shift register banks under a specific configuration region of top-level module */ std::vector shift_register_bank_modules(const ConfigRegionId& region) const;