Implement Partial Write for DDR5
This commit is contained in:
@@ -133,7 +133,9 @@ MemSpecDDR5::MemSpecDDR5(const DRAMSys::Config::MemSpec &memSpec)
|
||||
commandLengthInCycles[Command::RD] = 2;
|
||||
commandLengthInCycles[Command::RDA] = 2;
|
||||
commandLengthInCycles[Command::WR] = 2;
|
||||
commandLengthInCycles[Command::MWR] = 2;
|
||||
commandLengthInCycles[Command::WRA] = 2;
|
||||
commandLengthInCycles[Command::MWRA] = 2;
|
||||
}
|
||||
else if (cmdMode == 2)
|
||||
{
|
||||
@@ -144,7 +146,9 @@ MemSpecDDR5::MemSpecDDR5(const DRAMSys::Config::MemSpec &memSpec)
|
||||
commandLengthInCycles[Command::RD] = 4;
|
||||
commandLengthInCycles[Command::RDA] = 4;
|
||||
commandLengthInCycles[Command::WR] = 4;
|
||||
commandLengthInCycles[Command::MWR] = 4;
|
||||
commandLengthInCycles[Command::WRA] = 4;
|
||||
commandLengthInCycles[Command::MWRA] = 4;
|
||||
commandLengthInCycles[Command::REFAB] = 2;
|
||||
commandLengthInCycles[Command::RFMAB] = 2;
|
||||
commandLengthInCycles[Command::REFSB] = 2;
|
||||
@@ -279,14 +283,12 @@ TimeInterval MemSpecDDR5::getIntervalOnDataStrobe(Command command, const tlm_gen
|
||||
}
|
||||
}
|
||||
|
||||
bool MemSpecDDR5::requiresReadModifyWrite(const tlm::tlm_generic_payload& payload) const
|
||||
bool MemSpecDDR5::requiresMaskedWrite(const tlm::tlm_generic_payload& payload) const
|
||||
{
|
||||
// auto burstLength = ControllerExtension::getBurstLength(payload);
|
||||
auto burstLength = ControllerExtension::getBurstLength(payload);
|
||||
|
||||
// if (burstLength == 16 && bitWidth == 4)
|
||||
// return true;
|
||||
|
||||
// assert(false); // TODO
|
||||
if (burstLength == 16 && bitWidth == 4)
|
||||
return true;
|
||||
|
||||
return payload.get_byte_enable_ptr() != nullptr;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
sc_core::sc_time getExecutionTime(Command command, const tlm::tlm_generic_payload &payload) const override;
|
||||
TimeInterval getIntervalOnDataStrobe(Command command, const tlm::tlm_generic_payload &payload) const override;
|
||||
|
||||
bool requiresReadModifyWrite(const tlm::tlm_generic_payload& payload) const override;
|
||||
bool requiresMaskedWrite(const tlm::tlm_generic_payload& payload) const override;
|
||||
};
|
||||
|
||||
} // namespace DRAMSys
|
||||
|
||||
@@ -441,7 +441,7 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, const tlm_generic
|
||||
}
|
||||
}
|
||||
|
||||
if (burstLength == 16 && memSpec->bitWidth == 4) // second WR requires RMW
|
||||
if (memSpec->requiresMaskedWrite(payload)) // second WR requires RMW
|
||||
{
|
||||
lastCommandStart = lastScheduledByCommandAndBank[Command::WR][bank];
|
||||
if (lastCommandStart != scMaxTime)
|
||||
@@ -517,7 +517,7 @@ sc_time CheckerDDR5::timeToSatisfyConstraints(Command command, const tlm_generic
|
||||
}
|
||||
}
|
||||
|
||||
if (burstLength == 16 && memSpec->bitWidth == 4) // second WR requires RMW
|
||||
if (memSpec->requiresMaskedWrite(payload)) // second WR requires RMW
|
||||
{
|
||||
lastCommandStart = lastScheduledByCommandAndBankGroup[Command::WRA][bankGroup];
|
||||
if (lastCommandStart != scMaxTime)
|
||||
|
||||
@@ -248,7 +248,7 @@ TimeInterval MemSpecLPDDR5::getIntervalOnDataStrobe(Command command, const tlm_g
|
||||
}
|
||||
}
|
||||
|
||||
bool MemSpecLPDDR5::requiresReadModifyWrite(const tlm::tlm_generic_payload& payload) const
|
||||
bool MemSpecLPDDR5::requiresMaskedWrite(const tlm::tlm_generic_payload& payload) const
|
||||
{
|
||||
// assert(false); // TODO
|
||||
return payload.get_byte_enable_ptr() != nullptr;
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
sc_core::sc_time getExecutionTime(Command command, const tlm::tlm_generic_payload &payload) const override;
|
||||
TimeInterval getIntervalOnDataStrobe(Command command, const tlm::tlm_generic_payload &payload) const override;
|
||||
|
||||
bool requiresReadModifyWrite(const tlm::tlm_generic_payload& payload) const override;
|
||||
bool requiresMaskedWrite(const tlm::tlm_generic_payload& payload) const override;
|
||||
|
||||
private:
|
||||
unsigned per2BankOffset;
|
||||
|
||||
Reference in New Issue
Block a user