Commit 4f2e3421 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Merge branch 'vcd_change' into 'master'

Vcd change

See merge request !153
parents 538bc155 2cc324ec
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/MPSoC/mutekh" vcs="hg4idea" /> <mapping directory="$PROJECT_DIR$/MPSoC/mutekh" vcs="hg4idea" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -70,7 +70,8 @@ public: ...@@ -70,7 +70,8 @@ public:
\param iName Name of the device \param iName Name of the device
\param iScheduler Pointer to the scheduler object \param iScheduler Pointer to the scheduler object
*/ */
CPU(ID iID, std::string iName, WorkloadSource* iScheduler, unsigned int iAmountOfCore): SchedulableDevice(iID, iName, iScheduler), _lastTransaction(0), amountOfCore(iAmountOfCore)/*,_schedulingNeeded(false)*/{ CPU(ID iID, std::string iName, WorkloadSource* iScheduler, unsigned int iAmountOfCore): SchedulableDevice(iID, iName, iScheduler), _lastTransaction(0),
amountOfCore(iAmountOfCore)/*,_schedulingNeeded(false)*/{
} }
///Destructor ///Destructor
virtual ~CPU(){ virtual ~CPU(){
...@@ -270,7 +271,7 @@ protected: ...@@ -270,7 +271,7 @@ protected:
///List of bus masters ///List of bus masters
BusMasterList _busMasterList; BusMasterList _busMasterList;
///Amount of cores ///Amount of cores
unsigned int amountOfCore; unsigned int amountOfCore;
///Dirty flag of the current scheduling decision ///Dirty flag of the current scheduling decision
//bool _schedulingNeeded; //bool _schedulingNeeded;
}; };
......
...@@ -60,7 +60,8 @@ MultiCoreCPU::MultiCoreCPU(ID iID, ...@@ -60,7 +60,8 @@ MultiCoreCPU::MultiCoreCPU(ID iID,
unsigned int iChangeIdleModeCycles, unsigned int iChangeIdleModeCycles,
unsigned int iCyclesBeforeIdle, unsigned int iCyclesBeforeIdle,
unsigned int ibyteDataSize, unsigned int ibyteDataSize,
unsigned int iAmountOfCore): CPU(iID, iName, iScheduler, iAmountOfCore), /*_lastTransaction(0),*/ _masterNextTransaction(0), _timePerCycle(iTimePerCycle), coreNumber(0) unsigned int iAmountOfCore): CPU(iID, iName, iScheduler, iAmountOfCore), /*_lastTransaction(0),*/ _masterNextTransaction(0), _timePerCycle(iTimePerCycle),
coreNumber(0)
#ifdef PENALTIES_ENABLED #ifdef PENALTIES_ENABLED
, _pipelineSize(iPipelineSize), _taskSwitchingCycles(iTaskSwitchingCycles),_brachingMissrate(iBranchingMissrate) , _pipelineSize(iPipelineSize), _taskSwitchingCycles(iTaskSwitchingCycles),_brachingMissrate(iBranchingMissrate)
, _changeIdleModeCycles(iChangeIdleModeCycles), _cyclesBeforeIdle(iCyclesBeforeIdle) , _changeIdleModeCycles(iChangeIdleModeCycles), _cyclesBeforeIdle(iCyclesBeforeIdle)
...@@ -581,17 +582,14 @@ void MultiCoreCPU::getNextSignalChange(bool iInit, SignalChangeData* oSigData){ ...@@ -581,17 +582,14 @@ void MultiCoreCPU::getNextSignalChange(bool iInit, SignalChangeData* oSigData){
std::cout<<"END_TASK_CPU"<<std::endl; std::cout<<"END_TASK_CPU"<<std::endl;
do{ do{
std::cout<<"1111"<<std::endl;
_previousTransEndTime=(*_posTrasactListVCD)->getEndTime(); _previousTransEndTime=(*_posTrasactListVCD)->getEndTime();
_posTrasactListVCD++; _posTrasactListVCD++;
std::cout<<"2222"<<std::endl;
while(_posTrasactListVCD != _transactList.end()){ while(_posTrasactListVCD != _transactList.end()){
if((*_posTrasactListVCD)->getTransactCoreNumber() == oSigData->_coreNumberVcd) if((*_posTrasactListVCD)->getTransactCoreNumber() == oSigData->_coreNumberVcd)
break; break;
else else
_posTrasactListVCD++; _posTrasactListVCD++;
} }
std::cout<<"3333"<<std::endl;
}while (_posTrasactListVCD != _transactList.end() && (*_posTrasactListVCD)->getStartTimeOperation()==_previousTransEndTime); }while (_posTrasactListVCD != _transactList.end() && (*_posTrasactListVCD)->getStartTimeOperation()==_previousTransEndTime);
// std::cout<<"4444"<<std::endl; // std::cout<<"4444"<<std::endl;
if (_posTrasactListVCD != _transactList.end() && (*_posTrasactListVCD)->getStartTime()==_previousTransEndTime){ if (_posTrasactListVCD != _transactList.end() && (*_posTrasactListVCD)->getStartTime()==_previousTransEndTime){
......
...@@ -518,6 +518,7 @@ class EBRDD; ...@@ -518,6 +518,7 @@ class EBRDD;
class EBRDDCommand; class EBRDDCommand;
class SignalConstraint; class SignalConstraint;
///Datatype used for time measurements ///Datatype used for time measurements
typedef unsigned long long TMLTime; typedef unsigned long long TMLTime;
///Datatype used to indicate the virtual length of commands (execution units, data units) ///Datatype used to indicate the virtual length of commands (execution units, data units)
...@@ -763,6 +764,7 @@ void replaceAll(std::string& ioHTML, std::string iSearch, std::string iReplace); ...@@ -763,6 +764,7 @@ void replaceAll(std::string& ioHTML, std::string iSearch, std::string iReplace);
bool ends_with(std::string const& str, std::string const& suffix); bool ends_with(std::string const& str, std::string const& suffix);
inline std::string vcdValConvert(unsigned int iVal) {if(iVal==1 || iVal==2) return "1"; else return "0";} inline std::string vcdValConvert(unsigned int iVal) {if(iVal==1 || iVal==2) return "1"; else return "0";}
inline std::string vcdTaskValConvert(unsigned int iVal) {if(iVal==2) return "10"; else if(iVal==1) return "01"; else return "00";}
std::string vcdTimeConvert(TMLTime iVal); std::string vcdTimeConvert(TMLTime iVal);
int getexename(char* buf, size_t size); int getexename(char* buf, size_t size);
unsigned int getEnabledBranchNo(int iNo, int iMask); unsigned int getEnabledBranchNo(int iNo, int iMask);
......
...@@ -69,6 +69,12 @@ public: ...@@ -69,6 +69,12 @@ public:
SimComponents(int iHashValue); SimComponents(int iHashValue);
///Destructor ///Destructor
virtual ~SimComponents(); virtual ~SimComponents();
///Add name of model
/**
\param msg is the name of model
*/
inline void addModelName(std::string msg) {_modelName=msg;}
inline std::string getModelName() {return _modelName;}
///Add a task ///Add a task
/** /**
\param iTask Pointer to task \param iTask Pointer to task
...@@ -307,6 +313,8 @@ protected: ...@@ -307,6 +313,8 @@ protected:
ChannelList _channelList; ChannelList _channelList;
///TEPE listener listener ///TEPE listener listener
TEPEListenerList _tepeListenerList; TEPEListenerList _tepeListenerList;
///name of model
std::string _modelName;
#ifdef EBRDD_ENABLED #ifdef EBRDD_ENABLED
///List holding EBRDDs ///List holding EBRDDs
EBRDDList _ebrddList; EBRDDList _ebrddList;
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#include <EBRDDCommand.h> #include <EBRDDCommand.h>
#include <ERC.h> #include <ERC.h>
#endif #endif
class CurrentComponents;
Simulator::Simulator(SimServSyncInfo* iSyncInfo):_syncInfo(iSyncInfo), _simComp(_syncInfo->_simComponents), _busy(false), _simTerm(false), _randChoiceBreak(_syncInfo->_simComponents), _wasReset(true), _longRunTime(0), _shortRunTime(-1), _replyToServer(true), _branchCoverage(60), _commandCoverage(100), _terminateExplore(false), _simDuration(0){ Simulator::Simulator(SimServSyncInfo* iSyncInfo):_syncInfo(iSyncInfo), _simComp(_syncInfo->_simComponents), _busy(false), _simTerm(false), _randChoiceBreak(_syncInfo->_simComponents), _wasReset(true), _longRunTime(0), _shortRunTime(-1), _replyToServer(true), _branchCoverage(60), _commandCoverage(100), _terminateExplore(false), _simDuration(0){
} }
...@@ -303,7 +303,8 @@ std::cout<<"schedule2HTML--------------------------------------***************** ...@@ -303,7 +303,8 @@ std::cout<<"schedule2HTML--------------------------------------*****************
std::ofstream myfile(iTraceFileName.c_str()); std::ofstream myfile(iTraceFileName.c_str());
myfile<<"file name: "<<iTraceFileName.c_str()<<std::endl; //myfile<<"model name: "<<iTraceFileName.c_str();
myfile<<"model name: "<< _simComp->getModelName();
if (myfile.is_open()) { if (myfile.is_open()) {
myfile << " date: " << asctime(aTimeinfo)<<std::endl; myfile << " date: " << asctime(aTimeinfo)<<std::endl;
...@@ -429,7 +430,10 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{ ...@@ -429,7 +430,10 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{
} }
} }
else{ else{
myfile << "$var wire 1 " << (*i)->toShortString() << " " << (*i)->toString() << " $end\n"; if(((*i)->toShortString().substr(0,2) == "ta"))
myfile << "$var wire 2 " << (*i)->toShortString() << " " << (*i)->toString() << " $end\n";
else
myfile << "$var wire 1 " << (*i)->toShortString() << " " << (*i)->toString() << " $end\n";
aTopElement = new SignalChangeData(); aTopElement = new SignalChangeData();
(*i)->getNextSignalChange(true, aTopElement); (*i)->getNextSignalChange(true, aTopElement);
aQueue.push(aTopElement); aQueue.push(aTopElement);
...@@ -440,17 +444,6 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{ ...@@ -440,17 +444,6 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{
// (dynamic_cast<CPU*>(*i))->setCycleTime( (dynamic_cast<CPU*>(*i))->getCycleTime()+1); // (dynamic_cast<CPU*>(*i))->setCycleTime( (dynamic_cast<CPU*>(*i))->getCycleTime()+1);
//if sucess, make it as a fonction !!!! change
for (TraceableDeviceList::const_iterator i=_simComp->getVCDList().begin(); i!= _simComp->getVCDList().end(); ++i){
if ((*i)->toShortString().substr(0,3) == "cpu"){
for(unsigned int j = 0; j < (dynamic_cast<CPU*>(*i))->getAmoutOfCore(); j++) {
(dynamic_cast<CPU*>(*i))->setCycleTime(0);
}
}
}
myfile << "$var integer 32 clk Clock $end\n"; myfile << "$var integer 32 clk Clock $end\n";
myfile << "$upscope $end\n$enddefinitions $end\n\n"; myfile << "$upscope $end\n$enddefinitions $end\n\n";
...@@ -480,7 +473,9 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{ ...@@ -480,7 +473,9 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{
} }
//myfile << aTopElement->_sigChange << "\n"; //myfile << aTopElement->_sigChange << "\n";
if( aTopElement->_device->toShortString().substr(0,3) == "cpu") if( aTopElement->_device->toShortString().substr(0,3) == "cpu")
myfile << vcdValConvert(aTopElement->_sigChange) << aTopElement->_device->toShortString() << "_core" << aTopElement->_coreNumberVcd << "\n"; myfile << vcdValConvert(aTopElement->_sigChange) << aTopElement->_device->toShortString() << "_core" << aTopElement->_coreNumberVcd << "\n";
else if(aTopElement->_device->toShortString().substr(0,2) == "ta")
myfile <<"b"<< vcdTaskValConvert(aTopElement->_sigChange) <<" "<< aTopElement->_device->toShortString() << "\n";
else myfile << vcdValConvert(aTopElement->_sigChange) << aTopElement->_device->toShortString() << "\n"; else myfile << vcdValConvert(aTopElement->_sigChange) << aTopElement->_device->toShortString() << "\n";
aQueue.pop(); aQueue.pop();
TMLTime aTime = aTopElement->_time; TMLTime aTime = aTopElement->_time;
......
...@@ -370,5 +370,6 @@ protected: ...@@ -370,5 +370,6 @@ protected:
long _nbOfBranchesToExplore; long _nbOfBranchesToExplore;
long _nbOfBranchesExplored; long _nbOfBranchesExplored;
std::string _end; std::string _end;
}; };
#endif #endif
...@@ -267,6 +267,12 @@ public class DiploSimulatorCodeGenerator implements IDiploSimulatorCodeGenerator ...@@ -267,6 +267,12 @@ public class DiploSimulatorCodeGenerator implements IDiploSimulatorCodeGenerator
declaration += CR; declaration += CR;
// Declaration of Model Name
declaration += "//Declaration of Model Name" + CR;
declaration += "std::string msg=" + "\"LovelyModel\"" + SCCR;
declaration += "addModelName(" + "\"LovelyModel\"" + ")" + SCCR;
// Declaration of Buses // Declaration of Buses
declaration += "//Declaration of Buses" + CR; declaration += "//Declaration of Buses" + CR;
......
...@@ -2726,7 +2726,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ...@@ -2726,7 +2726,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
} }
} }
public void openProjectFromFile(File _f) { public void openProjectFromFile(File _f) {
String data = null; String data = null;
File tmpFile; File tmpFile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment