Files
DRAMSys/dram/src/core/utils/Utils.h
2014-04-09 21:22:42 +02:00

46 lines
1.0 KiB
C++

/*
* Utils.h
*
* Created on: Mar 10, 2014
* Author: jonny
*/
#ifndef UTILS_H_
#define UTILS_H_
#include <systemc.h>
#include <tlm.h>
#include "../../common/dramExtension.h"
namespace core
{
unsigned int getStartAddress(const Bank& bank);
sc_time getDistance(sc_time a, sc_time b);
struct TimeInterval
{
sc_time start,end;
TimeInterval() : start(SC_ZERO_TIME), end(SC_ZERO_TIME){}
TimeInterval(sc_time start,sc_time end) : start(start), end(end){}
sc_time getLength() {return getDistance(start,end);}
bool timeIsInInterval(sc_time time);
bool intersects(TimeInterval other);
};
sc_time getBurstLengthOnDataStrobe(unsigned int burstlength);
struct TimingConfiguration;
sc_time getDelayToMeetConstraint(sc_time previous, sc_time start, sc_time constraint);
enum Alignment {UP, DOWN};
const sc_time clkAlign(sc_time time, Alignment alignment = UP);
bool isClkAligned(sc_time time, sc_time clk);
BankGroup getBankGroup(Bank bank);
void setUpDummy(tlm::tlm_generic_payload& payload, Bank& bank);
};
#endif /* UTILS_H_ */