Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vdt-plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
vdt-plugin
Commits
eb6ffffc
Commit
eb6ffffc
authored
Jul 10, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More changes when working with cocotb
parent
e3c85766
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
9 deletions
+56
-9
parser_cocotb_icarus.py
parsers/parser_cocotb_icarus.py
+33
-3
Cocotb.xml
tools/Verilog/Cocotb.xml
+23
-6
No files found.
parsers/parser_cocotb_icarus.py
View file @
eb6ffffc
...
...
@@ -43,6 +43,10 @@ RAISED_EXCEPTION="raised exception:"
COMMA_LINE
=
", line"
state
=
None
# None - pass, cocotb - collecting Cocotb problem, python- just raw python problem
lines
=
[]
PATTERN_PS
=
re
.
compile
(
r"(\d+\.\d+) ps"
)
PATTERN_FILE_LINE
=
re
.
compile
(
'([
\
w/-]*
\
.[v|V][hH]?):
\
s*([0-9]+)'
)
TRUNCATE_PATH
=
True
NS_FORMAT
=
"
%10.3
fns"
def
report_python
(
lines
):
err_msg
=
lines
[
0
]
for
i
in
range
((
len
(
lines
)
-
1
)
//
2
):
...
...
@@ -59,6 +63,34 @@ def report_python(lines):
for
line
in
iter
(
sys
.
stdin
.
readline
,
''
):
sline
=
line
.
strip
()
#Replace picoseconds with nanoseconds
ps
=
PATTERN_PS
.
match
(
sline
)
while
ps
:
try
:
ns
=
NS_FORMAT
%
(
0.001
*
float
(
ps
.
group
(
1
)))
except
:
break
sline
=
sline
[:
ps
.
start
(
0
)]
+
ns
+
sline
[
ps
.
end
(
0
):]
ps
=
PATTERN_PS
.
match
(
sline
)
#Recognize verilog file:line and get rid of spaces between them
fl
=
PATTERN_FILE_LINE
.
search
(
sline
)
if
fl
:
if
fl
.
start
(
0
)
!=
0
:
#Icarus compiler output, keep as is (controlled by warnings/errors/sorry
#lsof -i TCP| fgrep LISTEN
fname
=
fl
.
group
(
1
)
if
TRUNCATE_PATH
:
try
:
lastSlashIndex
=
fname
.
rindex
(
'/'
)
fname
=
fname
[
lastSlashIndex
+
1
:]
except
:
pass
subl
=
"SIM:
%20
s:
%4
d in simulator "
%
(
fname
,
int
(
fl
.
group
(
2
)))
sline
=
sline
[:
fl
.
start
(
0
)]
+
subl
+
sline
[
fl
.
end
(
0
):]
if
state
==
"cocotb"
:
if
(
len
(
lines
)
%
2
==
0
)
or
sline
.
startswith
(
'File "'
):
lines
.
append
(
sline
)
...
...
@@ -87,11 +119,9 @@ for line in iter(sys.stdin.readline,''):
lines
=
[
sline
]
sys
.
stdout
.
write
(
line
)
continue
else
:
sys
.
stdout
.
write
(
line
)
sys
.
stdout
.
write
(
sline
+
"
\n
"
)
...
...
tools/Verilog/Cocotb.xml
View file @
eb6ffffc
...
...
@@ -265,6 +265,9 @@
<parameter
id=
"ShowInfo"
type=
"BoolYesNo"
format=
"None"
default=
"true"
label=
"Show info messages"
/>
<parameter
id=
"ShowSim"
type=
"BoolYesNo"
format=
"None"
default=
"true"
label=
"Show Simulator"
tooltip=
"Show simulator output with filename/line"
/>
<parameter
id=
"FilterParser"
type=
"BoolYesNo"
format=
"None"
default=
"true"
label=
"Filter simulation output with an external parser"
/>
...
...
@@ -316,7 +319,7 @@
default=
"(.*):([0-9]+): [a-z_\- ]*[warning|sorry]: (.*)"
visible=
"true"
type=
"String"
format=
"CopyValue"
/>
<parameter
id=
"PatternInfo"
label=
"Info"
tooltip=
"Regular expression for info messages"
default=
".*[\s.](
\w*\.py):
([0-9]+)\s*\S*\s*\S*\s*(.*)"
default=
".*[\s.](
[\w-]*\.py|[\w/-]*\.[v|V][hH]?):\s*
([0-9]+)\s*\S*\s*\S*\s*(.*)"
visible=
"true"
type=
"String"
format=
"CopyValue"
/>
...
...
@@ -388,6 +391,15 @@
format=
"CopyValue"
default=
""
visible=
"true"
/>
</if-not>
<if
ShowSim=
"true"
>
<parameter
id=
"GrepSim"
type=
"String"
label =
"GrepSim"
format=
"CopyValue"
default=
"|SIM:"
visible=
"true"
/>
</if>
<if-not
ShowSim=
"true"
>
<parameter
id=
"GrepSim"
type=
"String"
label =
"GrepSim"
format=
"CopyValue"
default=
""
visible=
"true"
/>
</if-not>
<if
ShowInfo=
"true"
>
<parameter
id=
"GrepInfo"
type=
"String"
label =
"GrepInfo"
format=
"CopyValue"
default=
"|info|INFO"
visible=
"true"
/>
...
...
@@ -408,8 +420,10 @@
<parameter
id=
"GrepEWI"
type=
"String"
label =
"GrepWarning"
format=
"GrepFindSyntax"
default=
"error|ERROR%GrepWarning%GrepInfo%GrepDebug"
visible=
"true"
readonly=
"true"
/>
format=
"GrepFindSyntax"
default=
"error|ERROR%GrepWarning%GrepInfo%GrepDebug
%GrepSim
"
visible=
"true"
readonly=
"true"
/>
<parameter
id=
"SIMULATION_PATH"
type=
"String"
format=
"MakefileExport"
default=
"%%ProjectPath/%SimulDir"
visible=
"false"
/>
<input>
...
...
@@ -446,6 +460,7 @@
"ShowNoProblem"
"ShowWarnings"
"ShowInfo"
"ShowSim"
"RemoveBugs"
"SaveLogsPreprocessor"
"SaveLogsSimulator"
...
...
@@ -508,9 +523,11 @@
errors=
"PatternErrors"
warnings=
"PatternWarnings"
info=
"PatternInfo"
failure =
"
ERROR|
CRITICAL"
failure =
"CRITICAL"
>
"%Param_Shell_Options"
<!-- failure = "ERROR|CRITICAL"
-->
"%Param_Shell_Options"
"%Param_PreExe"
<!-- MKDIR - ALWAYS -->
"mkdir -p"
...
...
@@ -528,7 +545,7 @@
"%%ProjectPath/%LogFileFull"
</if>
<if
FilterParser=
"true"
>
"|python -u %parsers_path
/
%parser_name"
"|python -u %parsers_path%parser_name"
</if>
<if
ShowNoProblem=
"false"
>
"%GrepEWI"
...
...
@@ -580,7 +597,7 @@
"%CocotbRANDOM_SEED"
"%COCOTB_DEBUG"
"%COCOTB_ANSI_OUTPUT"
"%SIMULATION_PATH"
"%CocotbVERILOG_SOURCES"
"%CocotbExtraFiles"
"%CocotbVHDL_SOURCES"
...
...
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