Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
f10a42b0
Commit
f10a42b0
authored
7 years ago
by
Dominique Blouin
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#4
: HTML Simulator Output Missing Style
parent
bae95e04
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
simulators/c++2/src_simulator/definitions.h
+65
-0
65 additions, 0 deletions
simulators/c++2/src_simulator/definitions.h
simulators/c++2/src_simulator/sim/Simulator.cpp
+23
-6
23 additions, 6 deletions
simulators/c++2/src_simulator/sim/Simulator.cpp
with
88 additions
and
6 deletions
simulators/c++2/src_simulator/definitions.h
+
65
−
0
View file @
f10a42b0
...
...
@@ -225,6 +225,71 @@ using std::max;
#define TAG_ENERGYo "<energy>"
#define TAG_ENERGYc "</energy>"
// Issue #4 HTML Trace Constants
#define SCHED_CSS_FILE_NAME "schedstyle.css"
#define SCHED_HTML_DOC "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
#define SCHED_HTML_BEG_HTML "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"
#define SCHED_HTML_END_HTML "</html>\n"
#define SCHED_HTML_BEG_HEAD "<head>\n"
#define SCHED_HTML_END_HEAD "</head>\n"
#define SCHED_HTML_META "<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />\n"
#define SCHED_HTML_BEG_TITLE "<title>"
#define SCHED_HTML_END_TITLE "</title>\n"
#define SCHED_HTML_BEG_BODY "<body>\n"
#define SCHED_HTML_END_BODY "</body>\n"
#define SCHED_HTML_BEG_STYLE "<style>\n"
#define SCHED_HTML_END_STYLE "</style>\n"
#define SCHED_HTML_CSS_LINK "<link rel=\"stylesheet\" type=\"text/css\" href=\""
#define SCHED_HTML_CSS_CONTENT "table{ \
border-collapse: collapse; \
empty-cells: show; \
margin: 0.4cm; \
} \
td{ \
padding: 10px 5px; \
border: 1px solid black; \
} \
th{ \
padding: 5px; \
border-left: 1px dotted black; \
border-right: 1px dotted black; \
} \
.sc{ \
border-style: none; \
padding: 0px; \
} \
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;} \
.t1{background-color: yellow;} \
.t2{background-color: purple;} \
.t3{background-color: red;} \
.t4{background-color: silver;} \
.t5{background-color: teal;} \
.t6{background-color: aqua;} \
.t7{background-color: olive;} \
.t8{background-color: navy;} \
.t9{background-color: maroon;} \
.t10{background-color: lime;} \
.t11{background-color: green;} \
.t12{background-color: gray;} \
.t13{background-color: fuchsia;} \
.t14{background-color: blue;} \
.t15{background-color: black;} \
.t16{background-color: white;}"
class
TMLTask
;
class
TMLTransaction
;
...
...
This diff is collapsed.
Click to expand it.
simulators/c++2/src_simulator/sim/Simulator.cpp
+
23
−
6
View file @
f10a42b0
...
...
@@ -282,14 +282,26 @@ void Simulator::latencies2XML(std::ostringstream& glob, int id1, int id2) {
}
}
void
Simulator
::
schedule2HTML
(
std
::
string
&
iTraceFileName
)
const
{
struct
timeval
aBegin
,
aEnd
;
gettimeofday
(
&
aBegin
,
NULL
);
std
::
ofstream
myfile
(
iTraceFileName
.
c_str
());
if
(
myfile
.
is_open
()){
myfile
<<
"<!DOCTYPE html PUBLIC
\"
-//W3C//DTD XHTML 1.0 Strict//EN
\"\n\"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
\"
>
\n
"
;
myfile
<<
"<html xmlns=
\"
http://www.w3.org/1999/xhtml
\"
xml:lang=
\"
en
\"
lang=
\"
en
\"
>
\n
<head>
\n
<link rel=
\"
stylesheet
\"
type=
\"
text/css
\"
href=
\"
schedstyle.css
\"
/>
\n
<meta http-equiv=
\"
content-type
\"
content=
\"
text/html; charset=ISO-8859-1
\"
/>
\n
<title>Scheduling</title>
\n
</head>
\n
<body>
\n
"
;
if
(
myfile
.
is_open
())
{
// DB: Issue #4
myfile
<<
SCHED_HTML_DOC
;
// <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n
myfile
<<
SCHED_HTML_BEG_HTML
;
// <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n
myfile
<<
SCHED_HTML_BEG_HEAD
;
// <head>\n
myfile
<<
SCHED_HTML_BEG_STYLE
;
// <style>\n";
myfile
<<
SCHED_HTML_CSS_CONTENT
;
myfile
<<
SCHED_HTML_END_STYLE
;
// <style>\n";
myfile
<<
SCHED_HTML_META
;
// <meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />\n
myfile
<<
SCHED_HTML_BEG_TITLE
;
// <title>
myfile
<<
"Scheduling"
;
myfile
<<
SCHED_HTML_END_TITLE
;
// </title>\n
myfile
<<
SCHED_HTML_END_HEAD
;
// </head>\n
myfile
<<
SCHED_HTML_BEG_BODY
;
// <body>\n
//for(CPUList::const_iterator i=_simComp->getCPUIterator(false); i != _simComp->getCPUIterator(true); ++i){
for
(
CPUList
::
const_iterator
i
=
_simComp
->
getCPUList
().
begin
();
i
!=
_simComp
->
getCPUList
().
end
();
++
i
){
(
*
i
)
->
schedule2HTML
(
myfile
);
...
...
@@ -299,11 +311,16 @@ void Simulator::schedule2HTML(std::string& iTraceFileName) const{
(
*
j
)
->
schedule2HTML
(
myfile
);
}
//for_each(iCPUlist.begin(), iCPUlist.end(),std::bind2nd(std::mem_fun(&CPU::schedule2HTML),myfile));
myfile
<<
"</body>
\n
</html>
\n
"
;
myfile
<<
SCHED_HTML_END_BODY
;
// </body>\n
myfile
<<
SCHED_HTML_END_HTML
;
// </html>\n
myfile
.
close
();
}
else
else
{
std
::
cout
<<
"Unable to open HTML output file."
<<
std
::
endl
;
}
gettimeofday
(
&
aEnd
,
NULL
);
std
::
cout
<<
"The HTML output took "
<<
getTimeDiff
(
aBegin
,
aEnd
)
<<
"usec. File: "
<<
iTraceFileName
<<
std
::
endl
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment