Files
DRAMSys/dram/src/controller/core/configuration/MemSpec.h
Janik Schlemminger efc6094c13 memspec class
2014-08-27 09:43:42 +02:00

93 lines
2.6 KiB
C++

/*
* MemSpec.h
*
* Created on: Mar 6, 2014
* Author: jonny
*/
#ifndef MemSpec_H_
#define MemSpec_H_
#include <systemc.h>
#include <map>
#include "../../../common/dramExtension.h"
namespace core{
struct RefreshTiming
{
RefreshTiming() {}
RefreshTiming(sc_time tRFC, sc_time tREFI) : tRFC(tRFC), tREFI(tREFI) {}
sc_time tRFC;
sc_time tREFI;
};
struct MemSpec
{
MemSpec()
{
//default DDR4
}
const std::vector<Bank>& getBanks() const
{
static std::vector<Bank> banks;
if (banks.size() == 0)
{
for (unsigned int i = 0; i < NumberOfBanks; i++)
{
banks.push_back(Bank(i));
}
}
return banks;
}
std::string MemoryId = "not defined.";
std::string MemoryType = "not defined.";
unsigned int NumberOfBanks;
unsigned int NumberOfBankGroups;
unsigned int BurstLength;
unsigned int nActivate;
unsigned int DataRate;
unsigned int NumberOfRows;
sc_time clk;
sc_time tRP; //precharge-time (pre -> act same bank)
sc_time tRAS; //active-time (act -> pre same bank)
sc_time tRC; //RAS-cycle-time (min time bw 2 succesive ACT to same bank)
sc_time tCCD_S; //max(bl, tCCD) is relevant for rd->rd
sc_time tCCD_L;
sc_time tRTP; //Read to precharge
sc_time tRRD_S; //min time bw 2 succesive ACT to different banks (different bank group)
sc_time tRRD_L; //.. (same bank group)
sc_time tRCD; //act -> read/write
sc_time tNAW; //n activate window
sc_time tRL; //read latency (read command start to data strobe)
sc_time tWL; //write latency
sc_time tWR; //write recovery (write to precharge)
sc_time tWTR_S; //write to read (different bank group)
sc_time tWTR_L; //.. (same bank group)
sc_time tCKESR; //min time in sref
sc_time tCKE; //min time in pdna or pdnp
sc_time tXP; //min delay to row access command after pdnpx pdnax
sc_time tXPDLL; //min delay to row access command after pdnpx pdnax for dll commands
sc_time tXSR; //min delay to row access command after srefx
sc_time tXSRDLL; //min delay to row access command after srefx for dll commands
sc_time tAL; //additive delay (delayed execution in dram)
sc_time tRFC; //min ref->act delay
sc_time tREFI; //auto refresh must be issued at an average periodic interval tREFI
std::map<Bank, RefreshTiming> refreshTimings;//ensure that map is populated completely in memspecloader
//act and read/write commands remain for this timespan in history
sc_time tActHistory(){return tNAW;}
sc_time tDataStrobeHistory(){return tWTR_L;}
};
} /* namespace core */
#endif /* MemSpec_H_ */