diff --git a/simulators/c++2/src_simulator/arch/CPU.cpp b/simulators/c++2/src_simulator/arch/CPU.cpp index d40f6221558777f0ffbfac457b6f9a2117fc3ede..c950f9eee66994ac9544b5ddae4843a69e2812b5 100644 --- a/simulators/c++2/src_simulator/arch/CPU.cpp +++ b/simulators/c++2/src_simulator/arch/CPU.cpp @@ -271,7 +271,11 @@ std::map<TMLTask*, std::string> CPU::HWTIMELINE2HTML(std::ostringstream& myfile, tempReduce += aLength - 10; aLength = 10; } - myfile << "<td colspan=\"" << aLength << "\" title=\"" << aCurrTrans->toShortString() << "\" class=\""<< cellClass <<"\">"<< aCurrContent <<"</td>"; + std::string aCurrFullTransName = aCurrTrans->toString(); + unsigned int indexTrans1 = aCurrFullTransName.find("len:"); + unsigned int indexTrans2 = aCurrFullTransName.find("params:"); + std::string transName = aCurrTransName.substr(0, indexTrans + 1) + " " + aCurrFullTransName.substr(0, indexTrans1) + " --Attributes " + aCurrFullTransName.substr(indexTrans2, aCurrFullTransName.length()); + myfile << "<td colspan=\"" << aLength << "\" title=\"" << transName << "\" class=\""<< cellClass <<"\">"<< aCurrContent <<"</td>"; // writeHTMLColumn( myfile, aLength, cellClass, aCurrTrans->toShortString(), aCurrContent ); listScale.push_back(aLength); if(aCurrTrans->getStartTime() > listScaleTime.back()){ diff --git a/simulators/c++2/src_simulator/arch/CPU.h b/simulators/c++2/src_simulator/arch/CPU.h index 83b73216e0cfd45838b9e0790228b98d1c5e9cdc..3f99ed6505b0bd0faf0094b9aa70da4970d05169 100755 --- a/simulators/c++2/src_simulator/arch/CPU.h +++ b/simulators/c++2/src_simulator/arch/CPU.h @@ -102,6 +102,7 @@ public: virtual void reset(){ SchedulableDevice::reset(); _lastTransaction=0; + resetMaxScale(); //_schedulingNeeded=false; } virtual std::string toString() const =0; @@ -123,6 +124,7 @@ public: void HW2HTML(std::ofstream& myfile) const; std::map<TMLTask*, std::string> HWTIMELINE2HTML(std::ostringstream& myfile,std::map<TMLTask*, std::string> taskCellClasses,unsigned int nextCellClassIndex, std::string& iTracetaskList); inline unsigned int getMaxScale() { return maxScale; } + inline void resetMaxScale() { maxScale = 0; } void schedule2HTML(std::ofstream& myfile) const; void schedule2XML(std::ostringstream& glob,std::ofstream& myfile) const; inline void setCoreNumberGraph(unsigned int n){ _coreNumberGraph=n;} diff --git a/simulators/c++2/src_simulator/arch/FPGA.cpp b/simulators/c++2/src_simulator/arch/FPGA.cpp index 1b175d9d2800430fa9e3dd1ee86fb9a96d7a5fc4..f96123047409cbcbe537b5dc1ec868817d84d52b 100644 --- a/simulators/c++2/src_simulator/arch/FPGA.cpp +++ b/simulators/c++2/src_simulator/arch/FPGA.cpp @@ -376,6 +376,7 @@ void FPGA::reset(){ _lastTransaction=0; _masterNextTransaction=0; _busyCycles=0; + maxScale = 0; } void FPGA::schedule2TXT(std::ofstream& myfile) const{ @@ -679,7 +680,11 @@ std::map<TMLTask*, std::string> FPGA::HWTIMELINE2HTML(std::ostringstream& myfile tempReduce += aLength - 10; aLength = 10; } - myfile << "<td colspan=\"" << aLength << "\" title=\"" << aCurrTrans->toShortString() << "\" class=\""<< cellClass <<"\">"<< aCurrContent <<"</td>"; + std::string aCurrFullTransName = aCurrTrans->toString(); + unsigned int indexTrans1 = aCurrFullTransName.find("len:"); + unsigned int indexTrans2 = aCurrFullTransName.find("params"); + std::string transName = aCurrTransName.substr(0, indexTrans + 1) + " " + aCurrFullTransName.substr(0, indexTrans1) + " --Attributes " + aCurrFullTransName.substr(indexTrans2, aCurrFullTransName.length()); + myfile << "<td colspan=\"" << aLength << "\" title=\"" << transName << "\" class=\""<< cellClass <<"\">"<< aCurrContent <<"</td>"; // writeHTMLColumn( myfile, aLength, cellClass, aCurrTrans->toShortString(), aCurrContent ); listScale.push_back(aLength); if(aCurrTrans->getStartTime() > listScaleTime.back()){ diff --git a/simulators/c++2/src_simulator/arch/SchedulableDevice.cpp b/simulators/c++2/src_simulator/arch/SchedulableDevice.cpp index 6dacfacb7a9191badb47a8d62e5b1ae53c3a43ff..632a8264c7162687e222178314d02cf6ebee76bf 100644 --- a/simulators/c++2/src_simulator/arch/SchedulableDevice.cpp +++ b/simulators/c++2/src_simulator/arch/SchedulableDevice.cpp @@ -76,6 +76,7 @@ std::ostream& SchedulableDevice::writeObject(std::ostream &os){ void SchedulableDevice::reset() { _endSchedule=0; _simulatedTime=0; + maxScale = 0; } ///Destructor @@ -397,7 +398,11 @@ std::map<TMLTask*, std::string> SchedulableDevice::HWTIMELINE2HTML(std::ostrings tempReduce += aLength - 10; aLength = 10; } - myfile << "<td colspan=\"" << aLength << "\" title=\"" << aCurrTrans->toShortString() << "\" class=\""<< cellClass <<"\">"<< aCurrContent <<"</td>"; + std::string aCurrFullTransName = aCurrTrans->toString(); + unsigned int indexTrans1 = aCurrFullTransName.find("len:"); + unsigned int indexTrans2 = aCurrFullTransName.find("params:"); + std::string transName = aCurrTransName.substr(0, indexTrans + 1) + " " + aCurrFullTransName.substr(0, indexTrans1) + " --Attributes " + aCurrFullTransName.substr(indexTrans2, aCurrFullTransName.length()); + myfile << "<td colspan=\"" << aLength << "\" title=\"" << transName << "\" class=\""<< cellClass <<"\">"<< aCurrContent <<"</td>"; // writeHTMLColumn( myfile, aLength, cellClass, aCurrTrans->toShortString(), aCurrContent); listScale.push_back(aLength); if(aCurrTrans->getStartTime() > listScaleTime.back()){ diff --git a/simulators/c++2/src_simulator/sim/Simulator.cpp b/simulators/c++2/src_simulator/sim/Simulator.cpp index 430b97b751cf678774d396c4042eca21aad12582..b40e8730422cda5a09c10ebd2e7a9d6a153093df 100644 --- a/simulators/c++2/src_simulator/sim/Simulator.cpp +++ b/simulators/c++2/src_simulator/sim/Simulator.cpp @@ -464,11 +464,12 @@ void Simulator::latencies2XML(std::ostringstream& glob, int id1, int id2) { void Simulator::timeline2HTML(std::string& iTracetaskList, std::ostringstream& myfile) const { std::map<TMLTask*, std::string> taskCellClasses; + std::ostringstream myfileTemp, myfileTemp1; myfile << "<!DOCTYPE html>"; // <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n myfile << "<html>"; // <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n myfile << "<head>"; // <head>\n - myfile << "<style>"; // <style>\n"; + myfile << "<style>"; // <style>\n; myfile << SCHED_HTML_CSS_CONTENT_TIMELINE; myfile << "</style>"; // <style>\n"; myfile << "<title>"; // <title> @@ -477,15 +478,10 @@ void Simulator::timeline2HTML(std::string& iTracetaskList, std::ostringstream& m myfile << "</head>"; // </head>\n myfile << SCHED_HTML_BEG_BODY; // <body>\n // myfile << "<h1>Task to show: " << iTracetaskList.c_str() <<"</h1>\n"; - myfile << "<table style=\"float: left;position: relative;\"><tr><td width=\"170px\" style=\"max-width: unset;min-width: 170px;border-style: none none none none;\"></td>" - << "<td class=\"notfirst\"></td>" - << "<td style=\"border-style: solid none none none; border-width: 2px;border-color: red;text-align:right\"colspan=\"500\"><b>Time</b></td></tr>" - << "<tr><th></th><th class=\"notfirst\"></th></tr>" - << "<div class = \"clear\"></div>"; unsigned int maxScale = 0; for(CPUList::const_iterator i=_simComp->getCPUList().begin(); i != _simComp->getCPUList().end(); ++i){ for(unsigned int j = 0; j < (*i)->getAmoutOfCore(); j++) { - taskCellClasses = (*i)->HWTIMELINE2HTML(myfile, taskCellClasses, taskCellClasses.size(), iTracetaskList); + taskCellClasses = (*i)->HWTIMELINE2HTML(myfileTemp, taskCellClasses, taskCellClasses.size(), iTracetaskList); if((*i)->getMaxScale() > maxScale) { maxScale = (*i)->getMaxScale(); } @@ -499,7 +495,7 @@ void Simulator::timeline2HTML(std::string& iTracetaskList, std::ostringstream& m (*j)->setStartFlagHTML(true); for(TaskList::const_iterator i = (*j)->getTaskList().begin(); i != (*j)->getTaskList().end(); ++i){ (*j)->setHtmlCurrTask(*i); - taskCellClasses = (*j)->HWTIMELINE2HTML(myfile, taskCellClasses, taskCellClasses.size(), iTracetaskList); + taskCellClasses = (*j)->HWTIMELINE2HTML(myfileTemp, taskCellClasses, taskCellClasses.size(), iTracetaskList); if((*j)->getMaxScale() > maxScale) { maxScale = (*j)->getMaxScale(); } @@ -508,21 +504,27 @@ void Simulator::timeline2HTML(std::string& iTracetaskList, std::ostringstream& m } for(BusList::const_iterator j=_simComp->getBusList().begin(); j != _simComp->getBusList().end(); ++j){ - taskCellClasses = (*j)->HWTIMELINE2HTML(myfile, taskCellClasses, taskCellClasses.size(), iTracetaskList); + taskCellClasses = (*j)->HWTIMELINE2HTML(myfileTemp, taskCellClasses, taskCellClasses.size(), iTracetaskList); if((*j)->getMaxScale() > maxScale) { maxScale = (*j)->getMaxScale(); } } - myfile << "</tr><tr><th></th><th class=\"notfirst\"></th></tr><div class = \"clear\"></div>"; + myfileTemp << "</tr><tr><th></th><th class=\"notfirst\"></th></tr><div class = \"clear\"></div>"; for ( unsigned int aLength = 0; aLength < maxScale; aLength++ ) { if( aLength == 1) { - myfile << "<th class=\"notfirst\">"; + myfileTemp << "<th class=\"notfirst\">"; } else { - myfile << "<th></th>"; + myfileTemp << "<th></th>"; } } - myfile << "</table><table><tr><td width=\"170px\" style=\"max-width: unset;min-width: 170px;border-style: none none none none;\"></td><td class=\"notlast\"></td><td class=\"notlast\"></td>"; + myfileTemp << "</table>"; + myfileTemp1 << "<table style=\"float: left;position: relative;\"><tr><td width=\"170px\" style=\"max-width: unset;min-width: 170px;border-style: none none none none;\"></td>" + << "<td class=\"notfirst\"></td>" + << "<td style=\"border-style: solid none none none; border-width: 2px;border-color: red;text-align:right\"colspan=\"" << maxScale << "\"><b>Time</b></td></tr>" + << "<tr><th></th><th class=\"notfirst\"></th></tr>" + << "<div class = \"clear\"></div>"; + myfile << "<table><tr><td width=\"170px\" style=\"max-width: unset;min-width: 170px;border-style: none none none none;\"></td><td class=\"notlast\"></td><td class=\"notlast\"></td>"; for( std::map<TMLTask*, std::string>::iterator taskColIt = taskCellClasses.begin(); taskColIt != taskCellClasses.end(); ++taskColIt ) { TMLTask* task = (*taskColIt).first; // Unset the default td max-width of 5px. For some reason setting the max-with on a specific t style does not work @@ -540,6 +542,8 @@ void Simulator::timeline2HTML(std::string& iTracetaskList, std::ostringstream& m } } myfile << "</tr></table>"; + myfile << myfileTemp1.str(); + myfile << myfileTemp.str(); myfile << "</body>"; // </body>\n myfile << "</html>"; // </html>\n } diff --git a/ttool/src/test/resources/tmltranslator/expected/expected_get_generated_timeline.txt b/ttool/src/test/resources/tmltranslator/expected/expected_get_generated_timeline.txt index 0e633f9c754cadca9deda98799cb0e42c6151add..1d6f152c444c4b32cc4774896297dbf65eb6ca12 100644 --- a/ttool/src/test/resources/tmltranslator/expected/expected_get_generated_timeline.txt +++ b/ttool/src/test/resources/tmltranslator/expected/expected_get_generated_timeline.txt @@ -1,5 +1,5 @@ <!DOCTYPE html><html><head><style>table{border-collapse: collapse;empty-cells: show;margin: 0.4cm;}td{padding: 10px 5px;border: 1px solid black;max-width: 5px;}th{padding: 5px;}.sc{border-style: none;padding: 0px;font-size: small;transform: rotate(45deg);transform-origin: left top;}.sc1{border-style: none;padding: 0px;font-size: small;color: red;transform: rotate(45deg);transform-origin: left top;}h2{border-bottom: 1px solid #666;}h2 span {position: relative;left: -0.3em;bottom: -0.6em;padding: 1px 0.5em;border-style: solid;border-width: 1px 1px 1px 0.8em;border-color: #666 #666 #666 #008;background-color: #ddd; } .space{border-style: none;} .not{background-color: white; text-align: center} .notfirst{background-color: white;border-width: 2px;border-color: red;border-style: none solid none none; } .notmid {background-color: white;text-align: right;border-style: solid none none none; } .notlast {background-color: white;width: 5px;border-style: none none none none; } .t0{background-color: yellow;} .t1{background-color: purple;} .t2{background-color: red;} .t3{background-color: silver;} .t4{background-color: teal;} .t5{background-color: aqua;} .t6{background-color: olive;} .t7{background-color: navy;} .t8{background-color: maroon;} .t9{background-color: lime;} .t10{background-color: green;} .t11{background-color: gray;} .t12{background-color: fuchsia;} .t13{background-color: blue;} .t14{background-color: darkred;}.wrapper {width: 256px;height: 256px; } .clear {clear:both}</style><title>Timeline Diagram</title></head><body> -<table style="float: left;position: relative;"><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td style="border-style: solid none none none; border-width: 2px;border-color: red;text-align:right"colspan="500"><b>Time</b></td></tr><tr><th></th><th class="notfirst"></th></tr><div class = "clear"></div><tr><td title = "Average load: 0.99; Utilization: 0.99" width="170px" style="max-width: unset;min-width: 170px;background-color: aqua;">FPGA1_1_core_0</td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" title="idle time" class="not"></td><td colspan="1" title="ApplicationSimple__T1: Wait ApplicationSimple__evtToT1__ApplicationSimple__evtToT1 params: t:1 l:1 (vl:1) params:(100(size)) Ch: ApplicationSimple__evtToT1__ApplicationSimple__evtToT1" class="t0"> W</td><td colspan="4" title="idle time" class="not"></td><td colspan="10" title="ApplicationSimple__T1: Read 400,ApplicationSimple__chToT1 t:6 l:400 (vl:400) params: Ch: ApplicationSimple__chToT1" class="t0"> R</td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" class="sc">0</td><td colspan="1" class="sc">1</td><td colspan="4" class="sc">2</td><td colspan="10" class="sc">6</td><td colspan="5" class="sc">406</td></tr><tr><th></th><th class="notfirst"><th></th></tr><div class = "clear"></div> -<tr><td title = "Average load: 1; Utilization: 0.015" width="170px" style="max-width: unset;min-width: 170px;background-color: aqua;">Src_1_core_0</td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" title="ApplicationSimple__Src: Send ApplicationSimple__evtToT1__ApplicationSimple__evtToT1(evtFB) len:2 content:0 params: t:0 l:1 (vl:1) params:(100(size)) Ch: ApplicationSimple__evtToT1__ApplicationSimple__evtToT1" class="t1"> S</td><td colspan="5" title="ApplicationSimple__Src: Write 400,ApplicationSimple__chToT1 t:1 l:5 (vl:400) params: Ch: ApplicationSimple__chToT1" class="t1"> W</td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" class="sc">0</td><td colspan="5" class="sc">1</td><td colspan="5" class="sc">6</td></tr><tr><th></th><th class="notfirst"><th></th></tr><div class = "clear"></div> -<tr><td title = "Average load: 0.83; Utilization: 0.012" width="170px" style="max-width: unset;min-width: 170px;background-color: aqua;">Bus0_0</td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" title="idle time" class="not"></td><td colspan="5" title="ApplicationSimple__Src: Write 400,ApplicationSimple__chToT1 t:1 l:5 (vl:400) params: Ch: ApplicationSimple__chToT1" class="t1"> W</td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" class="sc">0</td><td colspan="5" class="sc">1</td><td colspan="5" class="sc">6</td></tr><tr><th></th><th class="notfirst"><th></th></tr><div class = "clear"></div> -</tr><tr><th></th><th class="notfirst"></th></tr><div class = "clear"></div><th></th><th class="notfirst"><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></table><table><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notlast"></td><td class="notlast"></td><td class="t0"></td><td style="max-width: unset;min-width: 170px;">ApplicationSimple__T1</td><td class="space"></td><td class="t1"></td><td style="max-width: unset;min-width: 170px;">ApplicationSimple__Src</td><td class="space"></td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notlast"></td><td class="notlast"></td><td style="border-style: none none none none;"></td><td style="max-width: unset;min-width: 170px;border-style: none none none none;color:green"><b>Running</b></td><td class="space"></td><td style="border-style: none none none none;"></td><td style="max-width: unset;min-width: 170px;border-style: none none none none;color:red"><b>Terminated</b></td><td class="space"></td></tr></table></body></html> \ No newline at end of file +<table><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notlast"></td><td class="notlast"></td><td class="t0"></td><td style="max-width: unset;min-width: 170px;">ApplicationSimple__T1</td><td class="space"></td><td class="t1"></td><td style="max-width: unset;min-width: 170px;">ApplicationSimple__Src</td><td class="space"></td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notlast"></td><td class="notlast"></td><td style="border-style: none none none none;"></td><td style="max-width: unset;min-width: 170px;border-style: none none none none;color:green"><b>Running</b></td><td class="space"></td><td style="border-style: none none none none;"></td><td style="max-width: unset;min-width: 170px;border-style: none none none none;color:red"><b>Terminated</b></td><td class="space"></td></tr></table><table style="float: left;position: relative;"><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td style="border-style: solid none none none; border-width: 2px;border-color: red;text-align:right"colspan="18"><b>Time</b></td></tr><tr><th></th><th class="notfirst"></th></tr><div class = "clear"></div><tr><td title = "Average load: 0.99; Utilization: 0.99" width="170px" style="max-width: unset;min-width: 170px;background-color: aqua;">FPGA1_1_core_0</td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" title="idle time" class="not"></td><td colspan="1" title="ApplicationSimple__T1: Wait in ApplicationSimple__T1 --Attributes params:(100(size)) Ch: ApplicationSimple__evtToT1__ApplicationSimple__evtToT1" class="t0"> W</td><td colspan="4" title="idle time" class="not"></td><td colspan="10" title="ApplicationSimple__T1: Read in ApplicationSimple__T1 --Attributes params: Ch: ApplicationSimple__chToT1" class="t0"> R</td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" class="sc">0</td><td colspan="1" class="sc">1</td><td colspan="4" class="sc">2</td><td colspan="10" class="sc">6</td><td colspan="5" class="sc">406</td></tr><tr><th></th><th class="notfirst"><th></th></tr><div class = "clear"></div> +<tr><td title = "Average load: 1; Utilization: 0.015" width="170px" style="max-width: unset;min-width: 170px;background-color: aqua;">Src_1_core_0</td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" title="ApplicationSimple__Src: Send in ApplicationSimple__Src --Attributes params:(100(size)) Ch: ApplicationSimple__evtToT1__ApplicationSimple__evtToT1" class="t1"> S</td><td colspan="5" title="ApplicationSimple__Src: Write in ApplicationSimple__Src --Attributes params: Ch: ApplicationSimple__chToT1" class="t1"> W</td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" class="sc">0</td><td colspan="5" class="sc">1</td><td colspan="5" class="sc">6</td></tr><tr><th></th><th class="notfirst"><th></th></tr><div class = "clear"></div> +<tr><td title = "Average load: 0.83; Utilization: 0.012" width="170px" style="max-width: unset;min-width: 170px;background-color: aqua;">Bus0_0</td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" title="idle time" class="not"></td><td colspan="5" title="ApplicationSimple__Src: Write in ApplicationSimple__Src --Attributes params: Ch: ApplicationSimple__chToT1" class="t1"> W</td></tr><tr><td width="170px" style="max-width: unset;min-width: 170px;border-style: none none none none;"></td><td class="notfirst"></td><td class="notlast"></td><td colspan="1" class="sc">0</td><td colspan="5" class="sc">1</td><td colspan="5" class="sc">6</td></tr><tr><th></th><th class="notfirst"><th></th></tr><div class = "clear"></div> +</tr><tr><th></th><th class="notfirst"></th></tr><div class = "clear"></div><th></th><th class="notfirst"><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></table></body></html> \ No newline at end of file