Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
H
hostCompiledSimulation
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
hostCompiledSimulation
Commits
b2014af1
Commit
b2014af1
authored
Aug 27, 2014
by
supriti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor modifications to cGrammar.py to preserve. Major changes coming next
parent
5368aadc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
cGrammar.py
instrument/cGrammar.py
+23
-9
No files found.
instrument/cGrammar.py
View file @
b2014af1
...
@@ -202,14 +202,23 @@ def parseStatement(line):
...
@@ -202,14 +202,23 @@ def parseStatement(line):
logging
.
debug
(
" Writing to variable
%
s"
%
var_name
)
logging
.
debug
(
" Writing to variable
%
s"
%
var_name
)
annotation
=
(
var_name
,
"simDCache((
%
s_addr),
\"
w
\"
);"
%
(
var_name
))
annotation
=
(
var_name
,
"simDCache((
%
s_addr),
\"
w
\"
);"
%
(
var_name
))
print
r
.
value
# Parse the Value Expression
try
:
r_value
=
expression
.
parseString
(
r
.
value
[
0
])
except
ParseException
,
e
:
logging
.
error
(
e
.
msg
,
e
.
line
)
logging
.
error
(
" Parsing Destination (LHS):
%
s"
%
e
.
msg
)
print
r_value
.
add
.
add_op
.
deref
.
deref_exp
logging
.
debug
(
" Annotation =
%
s"
%
annotation
[
1
])
logging
.
debug
(
" Annotation =
%
s"
%
annotation
[
1
])
return
annotation
return
annotation
if
__name__
==
"__main__"
:
def
test
()
:
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
lines
=
[
lines
=
[
"pcmdata[start - start_40] = *(short int*)((uintptr_t)ivtmp_28);"
"pcmdata[start - start_40] = *(short int*)((uintptr_t)ivtmp_28);"
,
"a = b + c;"
,
"a = b + c;"
,
"diff = (int) *(short int *)((uintptr_t)indata + (uintptr_t)ivtmp_28) - valpred;"
,
"diff = (int) *(short int *)((uintptr_t)indata + (uintptr_t)ivtmp_28) - valpred;"
,
"D_2252 = (unsigned int) j_76 + D_2263;"
,
"D_2252 = (unsigned int) j_76 + D_2263;"
...
@@ -217,12 +226,11 @@ if __name__ == "__main__":
...
@@ -217,12 +226,11 @@ if __name__ == "__main__":
,
"*(outp + i) = (signed char) (signed char) outputbuffer;"
,
"*(outp + i) = (signed char) (signed char) outputbuffer;"
]
]
annotations
=
[
annotations
=
[
"simDCache((pcmdata_addr + (start-start_40)),
\"
w
\"
);"
"simDCache((pcmdata_addr + (start-start_40)),
\"
w
\"
);"
,
"simDCache((a_addr),
\"
w
\"
);"
,
"simDCache((a_addr),
\"
w
\"
);"
,
"simDCache((diff_addr),
\"
w
\"
);"
,
"simDCache((diff_addr),
\"
w
\"
);"
,
"simDCache((D_2252_addr),
\"
w
\"
);"
,
"simDCache((D_2252_addr),
\"
w
\"
);"
,
"simDCache((outp_addr,
\"
w
\"
);"
,
"simDCache((outp_addr
)
,
\"
w
\"
);"
,
"simDCache((outp_addr + (+i)),
\"
w
\"
);"
,
"simDCache((outp_addr + (+i)),
\"
w
\"
);"
]
]
...
@@ -231,8 +239,14 @@ if __name__ == "__main__":
...
@@ -231,8 +239,14 @@ if __name__ == "__main__":
annotation
=
parseStatement
(
lines
[
i
])
annotation
=
parseStatement
(
lines
[
i
])
if
annotation
[
1
]
!=
annotations
[
i
]:
if
annotation
[
1
]
!=
annotations
[
i
]:
logging
.
error
(
" Line
%
d does not give expected results!"
%
i
)
logging
.
error
(
" Line
%
d does not give expected results!"
%
i
)
ex
it
qu
it
print
"
\n\n
All Tests Passed!"
print
"
\n\n
All Tests Passed!"
if
__name__
==
"__main__"
:
\ No newline at end of file
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
line
=
"pcmdata[start - start_40] = *(short int*)((uintptr_t)ivtmp_28);"
parseStatement
(
line
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment