Files
DRAMSys/dram/src/core/TimingConfiguration.h
2014-03-29 00:26:21 +01:00

69 lines
1.3 KiB
C++

/*
* TimingConfiguration.h
*
* Created on: Mar 6, 2014
* Author: jonny
*/
#ifndef TIMINGS_H_
#define TIMINGS_H_
#include <systemc.h>
#include "utils/Utils.h"
namespace core{
struct RefreshTiming
{
RefreshTiming(sc_time tRFC, sc_time tREFI) : tRFC(tRFC), tREFI(tREFI) {}
sc_time tRFC;
sc_time tREFI;
};
struct TimingConfiguration
{
TimingConfiguration(unsigned int numberOfBanks)
{
clk = sc_time(6, SC_NS); // 166MHz
for (unsigned int i = 0; i < numberOfBanks; ++i)
{
sc_time tRFC = 21*clk;
//sc_time tREFI = 100*clk;
sc_time tREFI = sc_time(15.6, SC_US); //TODO align
//tREFI = sc_time(301268, SC_NS);
refreshTimings.push_back(RefreshTiming(tRFC, tREFI));
}
tRP = 3*clk; //precharge-time (pre -> act same bank)
tRAS = 6*clk; //active-time (act -> pre same bank)
tRC = tRP + tRAS; //RAS-cycle-time (min time bw 2 succesive ACT to same bank)
tRRD = 2*clk; //(min time bw 2 succesive ACT to different banks)
tRCD = 3*clk; //act -> read/write
tRL = 3*clk; //read latency (read command start to data strobe)
tTAW = 48*clk; //two activate window
}
sc_time clk;
sc_time tRP;
sc_time tRAS;
sc_time tRC;
sc_time tRRD;
sc_time tRCD;
sc_time tTAW;
sc_time tRL;
std::vector<RefreshTiming> refreshTimings;
};
} /* namespace controller */
#endif /* TimingConfiguration_H_ */