Included memspec and dram component for HBM2.

This commit is contained in:
Lukas Steiner (2)
2019-10-10 15:21:58 +02:00
parent 256abe449c
commit 606d273bee
5 changed files with 299 additions and 2 deletions

View File

@@ -143,7 +143,9 @@ SOURCES += \
src/controller/checker/CheckerLPDDR4.cpp \
src/configuration/memspec/MemSpecWideIO2.cpp \
src/simulation/dram/DramWideIO2.cpp \
src/controller/checker/CheckerWideIO2.cpp
src/controller/checker/CheckerWideIO2.cpp \
src/configuration/memspec/MemSpecHBM2.cpp \
src/simulation/dram/DramHBM2.cpp
HEADERS += \
src/common/third_party/tinyxml2/tinyxml2.h \
@@ -220,7 +222,9 @@ HEADERS += \
src/controller/checker/CheckerLPDDR4.h \
src/configuration/memspec/MemSpecWideIO2.h \
src/simulation/dram/DramWideIO2.h \
src/controller/checker/CheckerWideIO2.h
src/controller/checker/CheckerWideIO2.h \
src/configuration/memspec/MemSpecHBM2.h \
src/simulation/dram/DramHBM2.h
#src/common/third_party/json/include/nlohmann/json.hpp \
thermalsim = $$(THERMALSIM)

View File

@@ -0,0 +1,88 @@
/*
* Copyright (c) 2019, University of Kaiserslautern
* 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
*/
#include "MemSpecHBM2.h"
MemSpecHBM2::MemSpecHBM2()
{
commandLength[Command::ACT] = 2;
}
sc_time MemSpecHBM2::getRefreshIntervalAB() const
{
return tREFI;
}
sc_time MemSpecHBM2::getRefreshIntervalPB() const
{
return tREFISB;
}
sc_time MemSpecHBM2::getExecutionTime(Command command) const
{
if (command == Command::PRE || command == Command::PREA)
return tRP;
else if (command == Command::ACT) // TODO: read or write?
return tRCDRD + clk;
else if (command == Command::RD || command == Command::RDA)
return tRL + tDQSCK + getReadAccessTime();
else if (command == Command::WR || command == Command::WRA)
return tWL + getWriteAccessTime();
else if (command == Command::REFA)
return tRFC;
else if (command == Command::REFB)
return tRFCSB;
else
{
SC_REPORT_FATAL("getExecutionTime",
"command not known or command doesn't have a fixed execution time");
return SC_ZERO_TIME;
}
}
TimeInterval MemSpecHBM2::getIntervalOnDataStrobe(Command command) const
{
if (command == Command::RD || command == Command::RDA)
return TimeInterval(sc_time_stamp() + tRL + tDQSCK,
sc_time_stamp() + tRL + tDQSCK + getReadAccessTime());
else if (command == Command::WR || command == Command::WRA)
return TimeInterval(sc_time_stamp() + tWL,
sc_time_stamp() + tWL + getWriteAccessTime());
else
{
SC_REPORT_FATAL("MemSpecLPDDR4", "Method was called with invalid argument");
return TimeInterval();
}
}

View File

@@ -0,0 +1,93 @@
/*
* Copyright (c) 2019, University of Kaiserslautern
* 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
*/
#ifndef MEMSPECHBM2_H
#define MEMSPECHBM2_H
#include "MemSpec.h"
struct MemSpecHBM2 final : public MemSpec
{
MemSpecHBM2();
// Memspec Variables:
sc_time tDQSCK;
// sc_time tDQSQ; // TODO: check actual value of this parameter
sc_time tRC;
sc_time tRAS;
sc_time tRCDRD;
sc_time tRCDWR;
sc_time tRRDL;
sc_time tRRDS;
sc_time tFAW;
sc_time tRTPL;
sc_time tRTPS;
sc_time tRP;
sc_time tRL;
sc_time tWL;
sc_time tPL;
sc_time tWR;
sc_time tCCDL;
sc_time tCCDS;
// sc_time tCCDR; // TODO: consecutive reads to different stack IDs
sc_time tWTRL;
sc_time tWTRS;
sc_time tRTW;
sc_time tXP;
sc_time tCKE;
sc_time tPD = tCKE;
sc_time tRDPDE = tRL + tPL + (BurstLength / 2) * clk + clk;
sc_time tWRPDE = tWL + tPL + (BurstLength / 2) * clk + clk + tWR;
sc_time tWRAPDE = tWL + tPL + (BurstLength / 2) * clk + clk + tWR;
sc_time tCKESR = tCKE + clk;
sc_time tRDSRE = tRL + tPL + (BurstLength / 2) * clk + clk;
sc_time tXS;
sc_time tRFC;
sc_time tRFCSB;
sc_time tRREFD;
sc_time tREFI;
sc_time tREFISB;
// Currents and Voltages:
// TODO: to be completed
virtual sc_time getRefreshIntervalPB() const override;
virtual sc_time getRefreshIntervalAB() const override;
virtual sc_time getExecutionTime(Command) const override;
virtual TimeInterval getIntervalOnDataStrobe(Command) const override;
};
#endif // MEMSPECHBM2_H

View File

@@ -0,0 +1,59 @@
/*
* Copyright (c) 2019, University of Kaiserslautern
* 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
*/
#include "DramHBM2.h"
#include "Dram.h"
#include "../../configuration/Configuration.h"
#include "../../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h"
#include "../../configuration/memspec/MemSpecHBM2.h"
DramHBM2::DramHBM2(sc_module_name name) : Dram(name)
{
if (StoreMode == StorageMode::ErrorModel)
SC_REPORT_FATAL("DramHBM2", "Error Model not supported for HBM2");
// Parameters for DRAMPower
MemSpecHBM2 *memSpec = dynamic_cast<MemSpecHBM2 *>(this->memSpec);
if (memSpec == nullptr)
SC_REPORT_FATAL("DramHBM2", "Wrong MemSpec chosen");
if (Configuration::getInstance().PowerAnalysis)
{
SC_REPORT_FATAL("DramHBM2", "DRAMPower not supported for HBM2");
}
else
DRAMPower = new libDRAMPowerDummy();
}

View File

@@ -0,0 +1,53 @@
/*
* Copyright (c) 2019, University of Kaiserslautern
* 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
*/
#ifndef DRAMHBM2_H
#define DRAMHBM2_H
#include <systemc.h>
#include <tlm.h>
#include "Dram.h"
using namespace tlm;
class DramHBM2 : public Dram
{
public:
DramHBM2(sc_module_name);
SC_HAS_PROCESS(DramHBM2);
virtual ~DramHBM2() {}
};
#endif // DRAMHBM2_H