Merge branch 'fix/beat_byte_granularity' into 'develop'

Allow non-byte granularity for bus width

See merge request ems/astdm/modeling.dram/dram.sys.5!119
This commit is contained in:
Lukas Steiner
2025-04-24 14:15:46 +00:00
4 changed files with 13 additions and 15 deletions

View File

@@ -69,14 +69,12 @@ MemSpec::MemSpec(const Config::MemSpec& memSpec,
dataRate(memSpec.memarchitecturespec.entries.at("dataRate")), dataRate(memSpec.memarchitecturespec.entries.at("dataRate")),
bitWidth(memSpec.memarchitecturespec.entries.at("width")), bitWidth(memSpec.memarchitecturespec.entries.at("width")),
dataBusWidth(bitWidth * devicesPerRank), dataBusWidth(bitWidth * devicesPerRank),
bytesPerBeat(dataBusWidth / 8),
defaultBytesPerBurst((defaultBurstLength * dataBusWidth) / 8), defaultBytesPerBurst((defaultBurstLength * dataBusWidth) / 8),
maxBytesPerBurst((maxBurstLength * dataBusWidth) / 8), maxBytesPerBurst((maxBurstLength * dataBusWidth) / 8),
tCK(sc_time(memSpec.memtimingspec.entries.at("tCK"), SC_PS)), tCK(sc_time(memSpec.memtimingspec.entries.at("tCK"), SC_PS)),
memoryId(memSpec.memoryId), memoryId(memSpec.memoryId),
memoryType(memSpec.memoryType), memoryType(memSpec.memoryType),
burstDuration(tCK * (static_cast<double>(defaultBurstLength) / dataRate)) burstDuration(tCK * (static_cast<double>(defaultBurstLength) / dataRate))
{ {
commandLengthInCycles = std::vector<double>(Command::numberOfCommands(), 1); commandLengthInCycles = std::vector<double>(Command::numberOfCommands(), 1);
} }

View File

@@ -78,7 +78,6 @@ public:
const unsigned dataRate; const unsigned dataRate;
const unsigned bitWidth; const unsigned bitWidth;
const unsigned dataBusWidth; const unsigned dataBusWidth;
const unsigned bytesPerBeat;
const unsigned defaultBytesPerBurst; const unsigned defaultBytesPerBurst;
const unsigned maxBytesPerBurst; const unsigned maxBytesPerBurst;

View File

@@ -607,16 +607,16 @@ void Controller::manageRequests(const sc_time& delay)
// continuous block of data that can be fetched with a single burst // continuous block of data that can be fetched with a single burst
DecodedAddress decodedAddress = DecodedAddress decodedAddress =
addressDecoder.decodeAddress(transToAcquire.payload->get_address()); addressDecoder.decodeAddress(transToAcquire.payload->get_address());
ControllerExtension::setAutoExtension(*transToAcquire.payload, ControllerExtension::setAutoExtension(
nextChannelPayloadIDToAppend++, *transToAcquire.payload,
Rank(decodedAddress.rank), nextChannelPayloadIDToAppend++,
Stack(decodedAddress.stack), Rank(decodedAddress.rank),
BankGroup(decodedAddress.bankgroup), Stack(decodedAddress.stack),
Bank(decodedAddress.bank), BankGroup(decodedAddress.bankgroup),
Row(decodedAddress.row), Bank(decodedAddress.bank),
Column(decodedAddress.column), Row(decodedAddress.row),
transToAcquire.payload->get_data_length() / Column(decodedAddress.column),
memSpec.bytesPerBeat); (transToAcquire.payload->get_data_length() * 8) / memSpec.dataBusWidth);
Rank rank = Rank(decodedAddress.rank); Rank rank = Rank(decodedAddress.rank);
if (ranksNumberOfPayloads[rank] == 0) if (ranksNumberOfPayloads[rank] == 0)
@@ -814,7 +814,8 @@ void Controller::createChildTranses(tlm::tlm_generic_payload& parentTrans)
Bank(decodedAddress.bank), Bank(decodedAddress.bank),
Row(decodedAddress.row), Row(decodedAddress.row),
Column(decodedAddress.column), Column(decodedAddress.column),
childTrans->get_data_length() / memSpec.bytesPerBeat); (childTrans->get_data_length() * 8) /
memSpec.dataBusWidth);
} }
nextChannelPayloadIDToAppend++; nextChannelPayloadIDToAppend++;
ParentExtension::setExtension(parentTrans, std::move(childTranses)); ParentExtension::setExtension(parentTrans, std::move(childTranses));

View File

@@ -195,7 +195,7 @@ void AddressDecoder::plausibilityCheck(const MemSpec& memSpec)
if (memSpec.numberOfChannels != channels || memSpec.ranksPerChannel != ranks || if (memSpec.numberOfChannels != channels || memSpec.ranksPerChannel != ranks ||
memSpec.bankGroupsPerChannel != absoluteBankGroups || memSpec.bankGroupsPerChannel != absoluteBankGroups ||
memSpec.banksPerChannel != absoluteBanks || memSpec.rowsPerBank != rows || memSpec.banksPerChannel != absoluteBanks || memSpec.rowsPerBank != rows ||
memSpec.columnsPerRow != columns || memSpec.devicesPerRank * memSpec.bitWidth != bytes * 8) memSpec.columnsPerRow != columns)
SC_REPORT_FATAL("AddressDecoder", "Memspec and address mapping do not match"); SC_REPORT_FATAL("AddressDecoder", "Memspec and address mapping do not match");
} }