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"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/MPSoC/mutekh" vcs="hg4idea" />
</component>
</project>
\ No newline at end of file
......@@ -70,7 +70,8 @@ public:
\param iName Name of the device
\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
virtual ~CPU(){
......
......@@ -60,7 +60,8 @@ MultiCoreCPU::MultiCoreCPU(ID iID,
unsigned int iChangeIdleModeCycles,
unsigned int iCyclesBeforeIdle,
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
, _pipelineSize(iPipelineSize), _taskSwitchingCycles(iTaskSwitchingCycles),_brachingMissrate(iBranchingMissrate)
, _changeIdleModeCycles(iChangeIdleModeCycles), _cyclesBeforeIdle(iCyclesBeforeIdle)
......@@ -581,17 +582,14 @@ void MultiCoreCPU::getNextSignalChange(bool iInit, SignalChangeData* oSigData){
std::cout<<"END_TASK_CPU"<<std::endl;
do{
std::cout<<"1111"<<std::endl;
_previousTransEndTime=(*_posTrasactListVCD)->getEndTime();
_posTrasactListVCD++;
std::cout<<"2222"<<std::endl;
while(_posTrasactListVCD != _transactList.end()){
if((*_posTrasactListVCD)->getTransactCoreNumber() == oSigData->_coreNumberVcd)
break;
else
_posTrasactListVCD++;
}
std::cout<<"3333"<<std::endl;
}while (_posTrasactListVCD != _transactList.end() && (*_posTrasactListVCD)->getStartTimeOperation()==_previousTransEndTime);
// std::cout<<"4444"<<std::endl;
if (_posTrasactListVCD != _transactList.end() && (*_posTrasactListVCD)->getStartTime()==_previousTransEndTime){
......
......@@ -518,6 +518,7 @@ class EBRDD;
class EBRDDCommand;
class SignalConstraint;
///Datatype used for time measurements
typedef unsigned long long TMLTime;
///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);
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 vcdTaskValConvert(unsigned int iVal) {if(iVal==2) return "10"; else if(iVal==1) return "01"; else return "00";}
std::string vcdTimeConvert(TMLTime iVal);
int getexename(char* buf, size_t size);
unsigned int getEnabledBranchNo(int iNo, int iMask);
......
......@@ -69,6 +69,12 @@ public:
SimComponents(int iHashValue);
///Destructor
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
/**
\param iTask Pointer to task
......@@ -307,6 +313,8 @@ protected:
ChannelList _channelList;
///TEPE listener listener
TEPEListenerList _tepeListenerList;
///name of model
std::string _modelName;
#ifdef EBRDD_ENABLED
///List holding EBRDDs
EBRDDList _ebrddList;
......
......@@ -57,7 +57,7 @@
#include <EBRDDCommand.h>
#include <ERC.h>
#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){
}
......@@ -303,7 +303,8 @@ std::cout<<"schedule2HTML--------------------------------------*****************
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()) {
myfile << " date: " << asctime(aTimeinfo)<<std::endl;
......@@ -429,6 +430,9 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{
}
}
else{
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();
(*i)->getNextSignalChange(true, aTopElement);
......@@ -440,17 +444,6 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{
// (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 << "$upscope $end\n$enddefinitions $end\n\n";
......@@ -481,6 +474,8 @@ void Simulator::schedule2VCD(std::string& iTraceFileName) const{
//myfile << aTopElement->_sigChange << "\n";
if( aTopElement->_device->toShortString().substr(0,3) == "cpu")
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";
aQueue.pop();
TMLTime aTime = aTopElement->_time;
......
......@@ -370,5 +370,6 @@ protected:
long _nbOfBranchesToExplore;
long _nbOfBranchesExplored;
std::string _end;
};
#endif
......@@ -267,6 +267,12 @@ public class DiploSimulatorCodeGenerator implements IDiploSimulatorCodeGenerator
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 += "//Declaration of Buses" + CR;
......
......@@ -2726,7 +2726,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
}
}
public void openProjectFromFile(File _f) {
String data = null;
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