Merge branch 'fix/james_hbm_sid' into 'develop'

Fix issue with stack id

See merge request ems/astdm/modeling.dram/dram.sys.5!105
This commit is contained in:
2025-03-03 16:02:56 +00:00
2 changed files with 8 additions and 4 deletions

View File

@@ -233,6 +233,7 @@ void ControllerExtension::copy_from(const tlm_extension_base& ext)
const auto& cpyFrom = dynamic_cast<const ControllerExtension&>(ext);
channelPayloadID = cpyFrom.channelPayloadID;
rank = cpyFrom.rank;
stack = cpyFrom.stack;
bankGroup = cpyFrom.bankGroup;
bank = cpyFrom.bank;
row = cpyFrom.row;

View File

@@ -120,14 +120,16 @@ AddressDecoder::AddressDecoder(const Config::AddressMapping& addressMapping)
unsigned channels = std::lround(std::pow(2.0, vChannelBits.size()));
unsigned ranks = std::lround(std::pow(2.0, vRankBits.size()));
unsigned stacks = std::lround(std::pow(2.0, vStackBits.size()));
unsigned bankGroups = std::lround(std::pow(2.0, vBankGroupBits.size()));
unsigned banks = std::lround(std::pow(2.0, vBankBits.size()));
unsigned rows = std::lround(std::pow(2.0, vRowBits.size()));
unsigned columns = std::lround(std::pow(2.0, vColumnBits.size()));
unsigned bytes = std::lround(std::pow(2.0, vByteBits.size()));
maximumAddress =
static_cast<uint64_t>(bytes) * columns * rows * banks * bankGroups * ranks * channels - 1;
maximumAddress = static_cast<uint64_t>(bytes) * columns * rows * banks * bankGroups * stacks *
ranks * channels -
1;
bankgroupsPerRank = bankGroups;
banksPerGroup = banks;
@@ -144,8 +146,9 @@ void AddressDecoder::plausibilityCheck(const MemSpec& memSpec)
unsigned columns = std::lround(std::pow(2.0, vColumnBits.size()));
unsigned bytes = std::lround(std::pow(2.0, vByteBits.size()));
maximumAddress =
static_cast<uint64_t>(bytes) * columns * rows * banks * bankGroups * stacks * ranks * channels - 1;
maximumAddress = static_cast<uint64_t>(bytes) * columns * rows * banks * bankGroups * stacks *
ranks * channels -
1;
auto totalAddressBits = static_cast<unsigned>(std::log2(maximumAddress));
for (unsigned bitPosition = 0; bitPosition < totalAddressBits; bitPosition++)