Merge branch 'master' of git.rhrk.uni-kl.de:EIT-Wehn/dram.vp.system
This commit is contained in:
@@ -135,10 +135,9 @@ private:
|
||||
void appendDramExtension(int socketId, tlm_generic_payload& payload)
|
||||
{
|
||||
unsigned int burstlength = payload.get_streaming_width();
|
||||
node n;
|
||||
xmlAddressDecoder::getInstance().getNode(static_cast<unsigned int>(payload.get_address()), &n);
|
||||
DecodedAddress n = xmlAddressDecoder::getInstance().decodeAddress(payload.get_address());
|
||||
Bank bank(n.bank);
|
||||
DramExtension* extension = new DramExtension(Thread(socketId+1), Channel(n.channel), bank, bank.getBankGroup(), Row(n.row), Column(n.colum),burstlength);
|
||||
DramExtension* extension = new DramExtension(Thread(socketId+1), Channel(n.channel), bank, bank.getBankGroup(), Row(n.row), Column(n.column),burstlength);
|
||||
payload.set_auto_extension(extension);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -83,10 +83,10 @@ void Simulation::instantiateModules(const string &pathToResources, const std::ve
|
||||
arbiter = new Arbiter<NumberOfTracePlayers, 128>("arbiter");
|
||||
controller = new Controller<>("controller");
|
||||
|
||||
player1 = new TracePlayer<>("player1", pathToResources + string("traces/") + devices[0].trace, devices[0].burstLength, this);
|
||||
player2 = new TracePlayer<>("player2", pathToResources + string("traces/") + devices[1].trace, devices[1].burstLength, this);
|
||||
player3 = new TracePlayer<>("player3", pathToResources + string("traces/") + devices[2].trace, devices[2].burstLength, this);
|
||||
player4 = new TracePlayer<>("player4", pathToResources + string("traces/") + devices[3].trace, devices[3].burstLength, this);
|
||||
player1 = new TracePlayer<>("player1", pathToResources + string("traces/") + devices[0].trace, devices[0].burstLength, devices[0].clk, this);
|
||||
player2 = new TracePlayer<>("player2", pathToResources + string("traces/") + devices[1].trace, devices[1].burstLength, devices[1].clk, this);
|
||||
player3 = new TracePlayer<>("player3", pathToResources + string("traces/") + devices[2].trace, devices[2].burstLength, devices[2].clk, this);
|
||||
player4 = new TracePlayer<>("player4", pathToResources + string("traces/") + devices[3].trace, devices[3].burstLength, devices[3].clk, this);
|
||||
}
|
||||
|
||||
void Simulation::bindSockets()
|
||||
|
||||
@@ -30,10 +30,11 @@ struct DramSetup
|
||||
struct Device
|
||||
{
|
||||
Device():trace("empty.stl"), burstLength(0){}
|
||||
Device(std::string trace, unsigned int burstLength = 8) : trace(trace), burstLength(burstLength)
|
||||
Device(std::string trace, sc_time clk, unsigned int burstLength = 8) : trace(trace), clk (clk), burstLength(burstLength)
|
||||
{
|
||||
}
|
||||
std::string trace;
|
||||
sc_time clk;
|
||||
unsigned int burstLength;
|
||||
};
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void SimulationManager::addTraceSetup(SimulationBatch& batch, tinyxml2::XMLEleme
|
||||
vector<Device> devices;
|
||||
for (XMLElement* device = element->FirstChildElement("device"); device != NULL; device = device->NextSiblingElement("device"))
|
||||
{
|
||||
devices.push_back(Device(device->GetText(), device->IntAttribute("bl")));
|
||||
devices.push_back(Device(device->GetText(), FrequencyToClk(device->DoubleAttribute("clkMhz")), device->IntAttribute("bl")));
|
||||
}
|
||||
while (devices.size() < Simulation::NumberOfTracePlayers)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ struct TracePlayer: public sc_module
|
||||
{
|
||||
public:
|
||||
tlm_utils::simple_initiator_socket<TracePlayer, BUSWIDTH, tlm::tlm_base_protocol_types> iSocket;
|
||||
TracePlayer(sc_module_name /*name*/, string pathToTrace, unsigned int burstLength,
|
||||
TracePlayer(sc_module_name /*name*/, string pathToTrace, unsigned int burstLength, sc_time clk,
|
||||
simulation::ISimulation* simulationManager);
|
||||
|
||||
void start();
|
||||
@@ -46,6 +46,7 @@ private:
|
||||
MemoryManager memoryManager;
|
||||
ifstream file;
|
||||
unsigned int burstlenght;
|
||||
sc_time clk;
|
||||
unsigned int numberOfPendingTransactions;
|
||||
unsigned int transactionsSent;
|
||||
unsigned int transactionsReceived;
|
||||
@@ -54,8 +55,8 @@ private:
|
||||
|
||||
|
||||
template<unsigned int BUSWIDTH>
|
||||
TracePlayer<BUSWIDTH>::TracePlayer(sc_module_name, string pathToTrace, unsigned int burstLength, simulation::ISimulation *simulationManager) :
|
||||
payloadEventQueue(this, &TracePlayer<BUSWIDTH>::peqCallback), file(pathToTrace), burstlenght(burstLength),
|
||||
TracePlayer<BUSWIDTH>::TracePlayer(sc_module_name, string pathToTrace, unsigned int burstLength, sc_time clk, simulation::ISimulation *simulationManager) :
|
||||
payloadEventQueue(this, &TracePlayer<BUSWIDTH>::peqCallback), file(pathToTrace), burstlenght(burstLength), clk(clk),
|
||||
numberOfPendingTransactions(0), transactionsSent(0), transactionsReceived(0), simulationManager(simulationManager)
|
||||
{
|
||||
if (!file.is_open())
|
||||
@@ -112,7 +113,7 @@ void TracePlayer<BUSWIDTH>::generateNextPayload()
|
||||
payload->set_byte_enable_length(0);
|
||||
payload->set_streaming_width(burstlenght);
|
||||
|
||||
sc_time sendingTime = sc_time(std::stoi(time.c_str()), SC_NS);
|
||||
sc_time sendingTime = std::stoi(time.c_str())*clk;
|
||||
GenerationExtension* genExtension = new GenerationExtension(sendingTime);
|
||||
payload->set_auto_extension(genExtension);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user