relocated getBankgroup function
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "dramExtension.h"
|
||||
#include <assert.h>
|
||||
#include "../core/configuration/Configuration.h"
|
||||
#include "map"
|
||||
|
||||
using namespace tlm;
|
||||
|
||||
@@ -45,6 +47,22 @@ bool operator !=(const Channel& lhs, const Channel& rhs)
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
BankGroup Bank::getBankGroup()
|
||||
{
|
||||
static std::map<Bank, BankGroup> bankgroups;
|
||||
if (bankgroups.size() == 0)
|
||||
{
|
||||
SC_ASSERT_(config.NumberOfBanks % config.NumberOfBankGroups == 0, "Number of banks must be a multiple of number of bankgroups");
|
||||
|
||||
for (unsigned int bank = 0; bank < core::Configuration::getInstance().NumberOfBanks; bank++)
|
||||
{
|
||||
unsigned int group = bank % core::Configuration::getInstance().NumberOfBankGroups;
|
||||
bankgroups.insert(std::pair<Bank, BankGroup>(Bank(bank), BankGroup(group)));
|
||||
}
|
||||
}
|
||||
return bankgroups.at(*this);
|
||||
}
|
||||
|
||||
bool operator ==(const Bank& lhs, const Bank& rhs)
|
||||
{
|
||||
return lhs.ID() == rhs.ID();
|
||||
@@ -95,3 +113,4 @@ bool operator !=(const Column& lhs, const Column& rhs)
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user