diff --git a/simulators/c++2/src_simulator/TMLTransaction.h b/simulators/c++2/src_simulator/TMLTransaction.h index ebe095e806be13870dcfd731c9558876096a4661..f577a84f12f1d9653c6ca9f7f3aab16274313954 100644 --- a/simulators/c++2/src_simulator/TMLTransaction.h +++ b/simulators/c++2/src_simulator/TMLTransaction.h @@ -89,7 +89,10 @@ public: /** \param iStartTime Start time */ - inline void setStartTime(TMLTime iStartTime) {_startTime=iStartTime;} + inline void setStartTime(TMLTime iStartTime) {_startTime=iStartTime; + + + } ///Returns the length of the operational part of the transaction /** \return Length of the operational part diff --git a/simulators/c++2/src_simulator/arch/SingleCoreCPU.cpp b/simulators/c++2/src_simulator/arch/SingleCoreCPU.cpp index c28531e0497b496b28467a64fb7eae5959881fc9..e7d867ca4d4ce7b5ab714d97e2308fe31b66d562 100644 --- a/simulators/c++2/src_simulator/arch/SingleCoreCPU.cpp +++ b/simulators/c++2/src_simulator/arch/SingleCoreCPU.cpp @@ -47,6 +47,7 @@ #include <TMLChannel.h> //#include <TransactionListener.h> + SingleCoreCPU::SingleCoreCPU(ID iID, std::string iName, WorkloadSource* iScheduler, TMLTime iTimePerCycle, unsigned int iCyclesPerExeci, unsigned int iCyclesPerExecc, unsigned int iPipelineSize, unsigned int iTaskSwitchingCycles, unsigned int iBranchingMissrate, unsigned int iChangeIdleModeCycles, unsigned int iCyclesBeforeIdle, unsigned int ibyteDataSize): CPU(iID, iName, iScheduler), /*_lastTransaction(0),*/ _masterNextTransaction(0), _timePerCycle(iTimePerCycle) #ifdef PENALTIES_ENABLED , _pipelineSize(iPipelineSize), _taskSwitchingCycles(iTaskSwitchingCycles),_brachingMissrate(iBranchingMissrate) @@ -69,8 +70,8 @@ SingleCoreCPU::SingleCoreCPU(ID iID, std::string iName, WorkloadSource* iSchedul } SingleCoreCPU::~SingleCoreCPU(){ - std::cout << _transactList.size() << " elements in List of " << _name << ", busy cycles: " << _busyCycles << std::endl; - std::cout << " consumption value " << ((_simulatedTime/_timePerCycle)*_static_consumPerCycle) + ((_busyCycles/_timePerCycle)*_dynamic_consumPerCycle)<< std::endl; + //std::cout << _transactList.size() << " elements in List of " << _name << ", busy cycles: " << _busyCycles << std::endl; + //std::cout << " consumption value " << ((_simulatedTime/_timePerCycle)*_static_consumPerCycle) + ((_busyCycles/_timePerCycle)*_dynamic_consumPerCycle)<< std::endl; //delete _scheduler; } @@ -128,6 +129,8 @@ void SingleCoreCPU::calcStartTimeLength(TMLTime iTimeSlice){ TMLTime aStartTime = max(_endSchedule,_nextTransaction->getRunnableTime()); TMLTime aReminder = aStartTime % _timePerCycle; if (aReminder!=0) aStartTime+=_timePerCycle - aReminder; + //std::cout << "starttime=" << aStartTime << "\n"; + _nextTransaction->setStartTime(aStartTime); #ifdef BUS_ENABLED diff --git a/simulators/c++2/src_simulator/sim/Simulator.cpp b/simulators/c++2/src_simulator/sim/Simulator.cpp index 7fc83f80d219519ff37ebf981eb44a0590cf072a..48d80918a7882c97dc7988ea000f742c57c56f38 100644 --- a/simulators/c++2/src_simulator/sim/Simulator.cpp +++ b/simulators/c++2/src_simulator/sim/Simulator.cpp @@ -1525,9 +1525,9 @@ void Simulator::printCommandsOfTask(TMLTask* iTask, std::ostream& ioMessage){ ioMessage << TAG_STARTTIMEo << currCommand->getCommandStartTime() << TAG_STARTTIMEc; TMLTransaction* currTrans = currCommand->getCurrTransaction(); if (currTrans==0 || currTrans->getOverallLength()==0 || currTrans->getVirtualLength()==0){ - ioMessage << TAG_FINISHTIMEo << "-1" << TAG_FINISHTIMEc; - ioMessage << TAG_FINISHTIMETRANSo << "-1" << TAG_FINISHTIMETRANSc; - ioMessage << TAG_STARTTIMETRANSo << "-1" << TAG_STARTTIMETRANSc; + ioMessage << TAG_FINISHTIMEo << "0" << TAG_FINISHTIMEc; + ioMessage << TAG_FINISHTIMETRANSo << "0" << TAG_FINISHTIMETRANSc; + ioMessage << TAG_STARTTIMETRANSo << "0" << TAG_STARTTIMETRANSc; }else{ ioMessage << TAG_FINISHTIMEo << (currTrans->getEndTime() + currTrans->getOverallLength()*(currCommand->getLength()-currCommand->getProgress()-currTrans->getVirtualLength())/currTrans->getVirtualLength()) << TAG_FINISHTIMEc; //if (currCommand->getLength()==currCommand->getProgress())