[Engine] Add a new API to the MemoryBankShiftRegisterBank to access all the unique modules
This commit is contained in:
parent
b87b7a99c5
commit
f456c7e236
|
@ -1,9 +1,22 @@
|
||||||
|
#include <algorithm>
|
||||||
#include "vtr_assert.h"
|
#include "vtr_assert.h"
|
||||||
#include "memory_bank_shift_register_banks.h"
|
#include "memory_bank_shift_register_banks.h"
|
||||||
|
|
||||||
/* begin namespace openfpga */
|
/* begin namespace openfpga */
|
||||||
namespace openfpga {
|
namespace openfpga {
|
||||||
|
|
||||||
|
std::vector<ModuleId> MemoryBankShiftRegisterBanks::shift_register_bank_unique_modules() const {
|
||||||
|
std::vector<ModuleId> 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<ModuleId> MemoryBankShiftRegisterBanks::shift_register_bank_modules(const ConfigRegionId& region) const {
|
std::vector<ModuleId> MemoryBankShiftRegisterBanks::shift_register_bank_modules(const ConfigRegionId& region) const {
|
||||||
std::vector<ModuleId> sr_bank_modules;
|
std::vector<ModuleId> sr_bank_modules;
|
||||||
VTR_ASSERT(valid_region_id(region));
|
VTR_ASSERT(valid_region_id(region));
|
||||||
|
|
|
@ -22,6 +22,9 @@ namespace openfpga {
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
class MemoryBankShiftRegisterBanks {
|
class MemoryBankShiftRegisterBanks {
|
||||||
public: /* Accessors */
|
public: /* Accessors */
|
||||||
|
/* @brief Return a list of modules of unique shift register banks across all the regions */
|
||||||
|
std::vector<ModuleId> 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 */
|
/* @brief Return a list of modules of shift register banks under a specific configuration region of top-level module */
|
||||||
std::vector<ModuleId> shift_register_bank_modules(const ConfigRegionId& region) const;
|
std::vector<ModuleId> shift_register_bank_modules(const ConfigRegionId& region) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue