Files
DRAMSys/extensions/standards/LPDDR5/DRAMSys/configuration/memspec/MemSpecLPDDR5.h
Derek Christ 812b540ed5 Make DRAMPower required again
DRAMPower was only optional because the linker had problems when
integrating with gem5 as there still exists a very old version in the
source tree.

With the new namespaces, there is no longer a need for making DRAMPower
optional.
2025-05-09 16:45:54 +02:00

147 lines
4.9 KiB
C++

/*
* Copyright (c) 2021, RPTU Kaiserslautern-Landau
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Authors:
* Lukas Steiner
* Derek Christ
* Marco Mörz
*/
#ifndef MEMSPECLPDDR5_H
#define MEMSPECLPDDR5_H
#include <DRAMSys/configuration/memspec/MemSpec.h>
#include <DRAMUtils/memspec/standards/MemSpecLPDDR5.h>
#ifdef DRAMPOWER
#include <DRAMPower/memspec/MemSpecLPDDR5.h>
#include <DRAMPower/standards/lpddr5/LPDDR5.h>
#endif
#include <systemc>
namespace DRAMSys
{
class MemSpecLPDDR5 final : public MemSpec
{
public:
explicit MemSpecLPDDR5(const DRAMUtils::MemSpec::MemSpecLPDDR5& memSpec);
// Memspec Variables:
const DRAMUtils::MemSpec::MemSpecLPDDR5& memSpec;
const sc_core::sc_time tREFI;
const sc_core::sc_time tREFIpb;
const sc_core::sc_time tRFCab;
const sc_core::sc_time tRFCpb;
const sc_core::sc_time tRAS;
const sc_core::sc_time tRPab;
const sc_core::sc_time tRPpb;
const sc_core::sc_time tRCpb;
const sc_core::sc_time tRCab;
const sc_core::sc_time tPPD;
const sc_core::sc_time tRCD_L;
const sc_core::sc_time tRCD_S;
const sc_core::sc_time tFAW;
const sc_core::sc_time tRRD;
// const sc_core::sc_time tCCD;
const sc_core::sc_time tRL;
const sc_core::sc_time tRPRE;
const sc_core::sc_time tRPST;
// const sc_core::sc_time tDQSCK;
const sc_core::sc_time tRBTP;
const sc_core::sc_time tWL;
// const sc_core::sc_time tDQSS;
// const sc_core::sc_time tDQS2DQ;
const sc_core::sc_time tWR;
const sc_core::sc_time tWPRE;
const sc_core::sc_time tWPST;
// const sc_core::sc_time tWTR;
// const sc_core::sc_time tXP;
// const sc_core::sc_time tSR;
// const sc_core::sc_time tXSR;
// const sc_core::sc_time tESCKE;
// const sc_core::sc_time tCKE;
// const sc_core::sc_time tCMDCKE;
const sc_core::sc_time tRTRS;
const sc_core::sc_time BL_n_min_16;
const sc_core::sc_time BL_n_max_16;
const sc_core::sc_time BL_n_L_16;
const sc_core::sc_time BL_n_S_16;
const sc_core::sc_time BL_n_min_32;
const sc_core::sc_time BL_n_max_32;
const sc_core::sc_time BL_n_L_32;
const sc_core::sc_time BL_n_S_32;
const sc_core::sc_time tWTR_L;
const sc_core::sc_time tWTR_S;
const sc_core::sc_time tWCK2DQO;
const sc_core::sc_time tpbR2act;
const sc_core::sc_time tpbR2pbR;
const sc_core::sc_time tBURST16;
const sc_core::sc_time tBURST32;
const enum class BankMode { M16B, MBG, M8B } bankMode;
// Currents and Voltages:
// TODO: to be completed
[[nodiscard]] sc_core::sc_time getRefreshIntervalAB() const override;
[[nodiscard]] sc_core::sc_time getRefreshIntervalPB() const override;
[[nodiscard]] sc_core::sc_time getRefreshIntervalP2B() const override;
[[nodiscard]] unsigned getPer2BankOffset() const override;
[[nodiscard]] sc_core::sc_time
getExecutionTime(Command command, const tlm::tlm_generic_payload& payload) const override;
[[nodiscard]] TimeInterval
getIntervalOnDataStrobe(Command command,
const tlm::tlm_generic_payload& payload) const override;
[[nodiscard]] bool requiresMaskedWrite(const tlm::tlm_generic_payload& payload) const override;
[[nodiscard]] std::unique_ptr<DRAMPower::dram_base<DRAMPower::CmdType>>
toDramPowerObject() const override;
private:
unsigned per2BankOffset;
};
} // namespace DRAMSys
#endif // MEMSPECLPDDR5_H