Skip to content
Snippets Groups Projects
Commit 5cece2d1 authored by jawher-j's avatar jawher-j
Browse files

Update Trace and Timeline HTML

parent 6e1d4454
No related branches found
No related tags found
1 merge request!442Update Trace and Timeline HTML
......@@ -558,85 +558,87 @@ void TMLTask::schedule2HTML(std::ofstream& myfile) const {
bool changeCssClass = false;
TMLTransaction* checkLastTime = _transactList.back();
for( TransactionList::const_iterator i = _transactList.begin(); i != _transactList.end(); ++i ) {
//if( (*i)->getTransactCoreNumber() == this->_cycleTime ){
TMLTransaction* aCurrTrans = *i;
unsigned int aBlanks = aCurrTrans->getStartTime() - aCurrTime;
bool isBlankTooBig = false;
std::ostringstream tempString;
int tempBlanks;
if(checkLastTime->getEndTime() >= 250 && aBlanks > 10) {
int newBlanks = 10;
tempBlanks = aBlanks;
tempReduce += aBlanks - newBlanks;
aBlanks = newBlanks;
isBlankTooBig = true;
changeCssClass = true;
}
if ( aBlanks >= 0 && (!(aCurrTrans->getCommand()->getActiveDelay()) && aCurrTrans->getCommand()->isDelayTransaction()) ){
listScale.push_back(aBlanks+1);
tempString << tempBlanks+1;
if(aCurrTrans->getStartTime()+1 > listScaleTime.back()){
listScaleTime.push_back(aCurrTrans->getStartTime()+1);
}
if (isBlankTooBig){
writeHTMLColumn( myfile, aBlanks+1, "not", "idle time", "<- idle " + tempString.str() + " ->", false );
} else {
writeHTMLColumn( myfile, aBlanks+1, "not", "idle time" );
}
}
else if ( aBlanks > 0 ){
listScale.push_back(aBlanks);
tempString << tempBlanks;
if(aCurrTrans->getStartTime() > listScaleTime.back()){
listScaleTime.push_back(aCurrTrans->getStartTime());
}
if (isBlankTooBig){
writeHTMLColumn( myfile, aBlanks, "not", "idle time", "<- idle " + tempString.str() + " ->", false );
} else {
writeHTMLColumn( myfile, aBlanks, "not", "idle time" );
}
}
//if( (*i)->getTransactCoreNumber() == this->_cycleTime ){
TMLTransaction* aCurrTrans = *i;
unsigned int penLength = aCurrTrans->getPenalties();
unsigned long beg = aCurrTrans->getStartTime() - penLength;
unsigned int aBlanks = beg - aCurrTime;
bool isBlankTooBig = false;
std::ostringstream tempString;
int tempBlanks;
if(checkLastTime->getEndTime() >= 250 && aBlanks > 10) {
int newBlanks = 10;
tempBlanks = aBlanks;
tempReduce += aBlanks - newBlanks;
aBlanks = newBlanks;
isBlankTooBig = true;
changeCssClass = true;
}
if ( aBlanks >= 0 && (!(aCurrTrans->getCommand()->getActiveDelay()) && aCurrTrans->getCommand()->isDelayTransaction()) ){
listScale.push_back(aBlanks+1);
tempString << tempBlanks+1;
if (beg + 1 > listScaleTime.back()) {
listScaleTime.push_back(beg + 1);
}
if (isBlankTooBig) {
writeHTMLColumn( myfile, aBlanks+1, "not", "idle time", "<- idle " + tempString.str() + " ->", false );
} else {
writeHTMLColumn( myfile, aBlanks+1, "not", "idle time" );
}
}
else if ( aBlanks > 0 ) {
listScale.push_back(aBlanks);
tempString << tempBlanks;
if (beg > listScaleTime.back()) {
listScaleTime.push_back(beg);
}
if (isBlankTooBig) {
writeHTMLColumn( myfile, aBlanks, "not", "idle time", "<- idle " + tempString.str() + " ->", false );
} else {
writeHTMLColumn( myfile, aBlanks, "not", "idle time" );
}
}
unsigned int aLength = aCurrTrans->getPenalties();
unsigned int aLength = aCurrTrans->getPenalties();
if ( aLength != 0 ) {
std::ostringstream title;
listScaleTime.push_back(listScaleTime.back()+aLength);
if(checkLastTime->getEndTime() >= 250 && aLength > 10){
tempReduce += aLength - 10;
aLength = 10;
}
listScale.push_back(aLength);
title << "idle:" << aCurrTrans->getIdlePenalty() << " switching penalty:" << aCurrTrans->getTaskSwitchingPenalty();
writeHTMLColumn( myfile, aLength, "not", title.str() );
}
if ( aLength != 0 ) {
std::ostringstream title;
long tempL = listScaleTime.back() + aLength;
listScaleTime.push_back(tempL);
if(checkLastTime->getEndTime() >= 250 && aLength > 10) {
tempReduce += aLength - 10;
aLength = 10;
}
listScale.push_back(aLength);
title << "idle:" << aCurrTrans->getIdlePenalty() << " switching penalty:" << aCurrTrans->getTaskSwitchingPenalty();
writeHTMLColumn( myfile, aLength, "not", title.str());
}
aLength = aCurrTrans->getOperationLength();
// Issue #4
TMLTask* task = aCurrTrans->getCommand()->getTask();
const std::string cellClass = determineHTMLCellClass( taskCellClasses, task, nextCellClassIndex );
std::string aCurrTransName=aCurrTrans->toShortString();
unsigned int indexTrans=aCurrTransName.find_first_of(":");
std::string aCurrContent=aCurrTransName.substr(indexTrans+1,2);
if(!(!(aCurrTrans->getCommand()->getActiveDelay()) && aCurrTrans->getCommand()->isDelayTransaction())){
if(checkLastTime->getEndTime() >= 250 && aLength > 10){
tempReduce += aLength - 10;
aLength = 10;
}
writeHTMLColumn( myfile, aLength, cellClass, aCurrTrans->toShortString(), aCurrContent );
listScale.push_back(aLength);
if(aCurrTrans->getStartTime() > listScaleTime.back()){
listScaleTime.push_back(aCurrTrans->getStartTime());
}
if(aCurrTrans->getEndTime() > listScaleTime.back()){
listScaleTime.push_back(aCurrTrans->getEndTime());
}
}
aLength = aCurrTrans->getOperationLength();
// Issue #4
TMLTask* task = aCurrTrans->getCommand()->getTask();
const std::string cellClass = determineHTMLCellClass( taskCellClasses, task, nextCellClassIndex);
std::string aCurrTransName=aCurrTrans->toShortString();
unsigned int indexTrans=aCurrTransName.find_first_of(":");
std::string aCurrContent=aCurrTransName.substr(indexTrans+1,2);
if(!(!(aCurrTrans->getCommand()->getActiveDelay()) && aCurrTrans->getCommand()->isDelayTransaction())) {
if(checkLastTime->getEndTime() >= 250 && aLength > 10) {
tempReduce += aLength - 10;
aLength = 10;
}
writeHTMLColumn( myfile, aLength, cellClass, aCurrTrans->toShortString(), aCurrContent);
listScale.push_back(aLength);
if(aCurrTrans->getStartTime() > listScaleTime.back()) {
listScaleTime.push_back(aCurrTrans->getStartTime());
}
if(aCurrTrans->getEndTime() > listScaleTime.back()) {
listScaleTime.push_back(aCurrTrans->getEndTime());
}
}
aCurrTime = aCurrTrans->getEndTime();
// }
aCurrTime = aCurrTrans->getEndTime();
// }
}
......
......@@ -501,10 +501,11 @@ void CPU::HW2HTML(std::ofstream &myfile) const
// std::cout<<"get transaction core number is: "<<(*i)->getTransactCoreNumber()<<std::endl;
// std::cout<<"time : "<<_cycleTime<<std::endl;
// std::cout << "CPU:calcSTL: html of CPU " << _name << ": " << (*i)->toString() << std::endl;
if ((*i)->getTransactCoreNumber() == this->_cycleTime)
{
if ((*i)->getTransactCoreNumber() == this->_cycleTime) {
TMLTransaction *aCurrTrans = *i;
unsigned int aBlanks = aCurrTrans->getStartTime() - aCurrTime;
unsigned int penLength = aCurrTrans->getPenalties();
unsigned long beg = aCurrTrans->getStartTime() - penLength;
unsigned int aBlanks = beg - aCurrTime;
bool isBlankTooBig = false;
std::ostringstream tempString;
int tempBlanks;
......@@ -521,9 +522,8 @@ void CPU::HW2HTML(std::ofstream &myfile) const
{
listScale.push_back(aBlanks + 1);
tempString << tempBlanks + 1;
if (aCurrTrans->getStartTime() + 1 > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime() + 1);
if (beg + 1 > listScaleTime.back()) {
listScaleTime.push_back(beg + 1);
}
if (isBlankTooBig)
{
......@@ -538,9 +538,8 @@ void CPU::HW2HTML(std::ofstream &myfile) const
{
listScale.push_back(aBlanks);
tempString << tempBlanks;
if (aCurrTrans->getStartTime() > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime());
if (beg > listScaleTime.back()) {
listScaleTime.push_back(beg);
}
if (isBlankTooBig)
{
......@@ -556,7 +555,8 @@ void CPU::HW2HTML(std::ofstream &myfile) const
if (aLength != 0)
{
listScaleTime.push_back(listScaleTime.back() + aLength);
long tempL = listScaleTime.back() + aLength;
listScaleTime.push_back(tempL);
if (endTimeOfCore >= 250 && aLength > 10)
{
tempReduce += aLength - 10;
......@@ -682,10 +682,11 @@ void CPU::schedule2HTML(std::ofstream &myfile) const
// std::cout<<"get transaction core number is: "<<(*i)->getTransactCoreNumber()<<std::endl;
// std::cout<<"time : "<<_cycleTime<<std::endl;
// std::cout << "CPU:calcSTL: html of CPU " << _name << ": " << (*i)->toString() << std::endl;
if ((*i)->getTransactCoreNumber() == this->_cycleTime)
{
if ((*i)->getTransactCoreNumber() == this->_cycleTime) {
TMLTransaction *aCurrTrans = *i;
unsigned int aBlanks = aCurrTrans->getStartTime() - aCurrTime;
unsigned int penLength = aCurrTrans->getPenalties();
unsigned long beg = aCurrTrans->getStartTime() - penLength;
unsigned int aBlanks = beg - aCurrTime;
bool isBlankTooBig = false;
std::ostringstream tempString;
int tempBlanks;
......@@ -702,9 +703,8 @@ void CPU::schedule2HTML(std::ofstream &myfile) const
{
listScale.push_back(aBlanks + 1);
tempString << tempBlanks + 1;
if (aCurrTrans->getStartTime() + 1 > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime() + 1);
if (beg + 1 > listScaleTime.back()) {
listScaleTime.push_back(beg + 1);
}
if (isBlankTooBig)
{
......@@ -719,9 +719,8 @@ void CPU::schedule2HTML(std::ofstream &myfile) const
{
listScale.push_back(aBlanks);
tempString << tempBlanks;
if (aCurrTrans->getStartTime() > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime());
if (beg > listScaleTime.back()) {
listScaleTime.push_back(beg);
}
if (isBlankTooBig)
{
......@@ -738,7 +737,8 @@ void CPU::schedule2HTML(std::ofstream &myfile) const
if (aLength != 0)
{
std::ostringstream title;
listScaleTime.push_back(listScaleTime.back() + aLength);
long tempL = listScaleTime.back() + aLength;
listScaleTime.push_back(tempL);
if (endTimeOfCore >= 250 && aLength > 10)
{
tempReduce += aLength - 10;
......
......@@ -432,6 +432,10 @@ std::map<TMLTask *, std::string> SchedulableDevice::HWTIMELINE2HTML(std::ostring
listScaleTime.push_back(beg);
std::cout << "listScaleTime. Pushing trans start time: " << beg << std::endl;
}
if (aCurrTrans->getStartTime() > listScaleTime.back()){
listScaleTime.push_back(aCurrTrans->getStartTime());
std::cout << "listScaleTime. Pushing trans end time: " << aCurrTrans->getStartTime() << std::endl;
}
if (isBlankTooBig)
{
myfile << "<td colspan=\"" << aBlanks << "\" title=\"idle time\" class=\"not\">"
......@@ -455,6 +459,9 @@ std::map<TMLTask *, std::string> SchedulableDevice::HWTIMELINE2HTML(std::ostring
std::ostringstream title;
long back = listScaleTime.back() + aLength;
// listScaleTime.push_back(back);
if(aBlanks==0){
listScaleTime.push_back(back);
}
std::cout << "SD. listScaleTime. Pushing penalties: " << back << std::endl;
if (isScalable && checkLastTime->getEndTime() >= MIN_RESIZE_THRESHOLD && aLength > MIN_RESIZE_TRANS)
{
......@@ -625,7 +632,9 @@ void SchedulableDevice::HW2HTML(std::ofstream &myfile) const
std::cout << "CPU:calcSTL: html of CPU " << _name << ": " << (*i)->toString() << std::endl;
// if( (*i)->getTransactCoreNumber() == this->_cycleTime ){
TMLTransaction *aCurrTrans = *i;
unsigned int aBlanks = aCurrTrans->getStartTime() - aCurrTime;
unsigned int penLength = aCurrTrans->getPenalties();
unsigned long beg = aCurrTrans->getStartTime() - penLength;
unsigned int aBlanks = beg - aCurrTime;
bool isBlankTooBig = false;
std::ostringstream tempString;
int tempBlanks;
......@@ -642,9 +651,9 @@ void SchedulableDevice::HW2HTML(std::ofstream &myfile) const
{
listScale.push_back(aBlanks + 1);
tempString << tempBlanks + 1;
if (aCurrTrans->getStartTime() + 1 > listScaleTime.back())
if (beg + 1 > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime() + 1);
listScaleTime.push_back(beg + 1);
}
if (isBlankTooBig)
{
......@@ -659,8 +668,10 @@ void SchedulableDevice::HW2HTML(std::ofstream &myfile) const
{
listScale.push_back(aBlanks);
tempString << tempBlanks;
if (aCurrTrans->getStartTime() > listScaleTime.back())
{
if (beg > listScaleTime.back()){
listScaleTime.push_back(beg);
}
if (aCurrTrans->getStartTime() > listScaleTime.back()){
listScaleTime.push_back(aCurrTrans->getStartTime());
}
if (isBlankTooBig)
......@@ -678,7 +689,10 @@ void SchedulableDevice::HW2HTML(std::ofstream &myfile) const
if (aLength != 0)
{
std::ostringstream title;
listScaleTime.push_back(listScaleTime.back() + aLength);
long back = listScaleTime.back() + aLength;
if(aBlanks==0){
listScaleTime.push_back(back);
}
if (checkLastTime->getEndTime() >= 250 && aLength > 10)
{
tempReduce += aLength - 10;
......@@ -706,9 +720,9 @@ void SchedulableDevice::HW2HTML(std::ofstream &myfile) const
}
writeHTMLColumn(myfile, aLength, cellClass, aCurrTrans->toShortString(), aCurrContent);
listScale.push_back(aLength);
if (aCurrTrans->getStartTime() > listScaleTime.back())
if (beg > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime());
listScaleTime.push_back(beg);
}
if (aCurrTrans->getEndTime() > listScaleTime.back())
{
......@@ -805,7 +819,9 @@ void SchedulableDevice::schedule2HTML(std::ofstream &myfile) const
std::cout << "CPU:calcSTL: html of CPU " << _name << ": " << (*i)->toString() << std::endl;
// if( (*i)->getTransactCoreNumber() == this->_cycleTime ){
TMLTransaction *aCurrTrans = *i;
unsigned int aBlanks = aCurrTrans->getStartTime() - aCurrTime;
unsigned int penLength = aCurrTrans->getPenalties();
unsigned long beg = aCurrTrans->getStartTime() - penLength;
unsigned int aBlanks = beg - aCurrTime;
bool isBlankTooBig = false;
std::ostringstream tempString;
int tempBlanks;
......@@ -823,9 +839,9 @@ void SchedulableDevice::schedule2HTML(std::ofstream &myfile) const
listScale.push_back(aBlanks + 1);
tempString << tempBlanks + 1;
if (aCurrTrans->getStartTime() + 1 > listScaleTime.back())
if (beg + 1 > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime() + 1);
listScaleTime.push_back(beg + 1);
}
if (isBlankTooBig)
{
......@@ -840,8 +856,10 @@ void SchedulableDevice::schedule2HTML(std::ofstream &myfile) const
{
listScale.push_back(aBlanks);
tempString << tempBlanks;
if (aCurrTrans->getStartTime() > listScaleTime.back())
{
if (beg > listScaleTime.back()){
listScaleTime.push_back(beg);
}
if (aCurrTrans->getStartTime() > listScaleTime.back()){
listScaleTime.push_back(aCurrTrans->getStartTime());
}
if (isBlankTooBig)
......@@ -859,7 +877,10 @@ void SchedulableDevice::schedule2HTML(std::ofstream &myfile) const
if (aLength != 0)
{
std::ostringstream title;
listScaleTime.push_back(listScaleTime.back() + aLength);
long back = listScaleTime.back() + aLength;
if(aBlanks==0){
listScaleTime.push_back(back);
}
if (checkLastTime->getEndTime() >= 250 && aLength > 10)
{
tempReduce += aLength - 10;
......@@ -884,9 +905,9 @@ void SchedulableDevice::schedule2HTML(std::ofstream &myfile) const
}
writeHTMLColumn(myfile, aLength, cellClass, aCurrTrans->toShortString());
listScale.push_back(aLength);
if (aCurrTrans->getStartTime() > listScaleTime.back())
if (beg > listScaleTime.back())
{
listScaleTime.push_back(aCurrTrans->getStartTime());
listScaleTime.push_back(beg);
}
if (aCurrTrans->getEndTime() > listScaleTime.back())
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment