Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
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
lvzhengyang
sv2v
Commits
74a10a8e
Commit
74a10a8e
authored
May 23, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix else branch association in verbose mode
parent
fbde7aac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
24 deletions
+37
-24
src/Language/SystemVerilog/AST/Stmt.hs
+1
-0
test/lib/functions.sh
+31
-21
test/siloed/run.sh
+5
-3
No files found.
src/Language/SystemVerilog/AST/Stmt.hs
View file @
74a10a8e
...
@@ -128,6 +128,7 @@ showBlockedBranch stmt =
...
@@ -128,6 +128,7 @@ showBlockedBranch stmt =
Forever
{}
->
True
Forever
{}
->
True
Foreach
{}
->
True
Foreach
{}
->
True
Timing
_
subStmt
->
isControl
subStmt
Timing
_
subStmt
->
isControl
subStmt
Block
Seq
""
[]
[
CommentStmt
{},
subStmt
]
->
isControl
subStmt
_
->
False
_
->
False
showElseBranch
::
Stmt
->
String
showElseBranch
::
Stmt
->
String
...
...
test/lib/functions.sh
View file @
74a10a8e
...
@@ -54,8 +54,6 @@ assertConverts() {
...
@@ -54,8 +54,6 @@ assertConverts() {
assertTrue
"2nd conversion of
$ac_file
failed"
$?
assertTrue
"2nd conversion of
$ac_file
failed"
$?
diff
$ac_tmpa
$ac_tmpb
>
/dev/null
diff
$ac_tmpa
$ac_tmpb
>
/dev/null
assertTrue
"conversion of
$ac_file
not stable after the first iteration"
$?
assertTrue
"conversion of
$ac_file
not stable after the first iteration"
$?
$SV2V
-v
$ac_file
2> /dev/null
>
/dev/null
assertTrue
"verbose conversion of
$ac_file
failed"
$?
# using sed to remove quoted strings and integer unsigned
# using sed to remove quoted strings and integer unsigned
filtered
=
`
sed
-E
-e
's/"([^"]|\")+"//g'
-e
's/integer unsigned/integer/g'
$ac_tmpa
`
filtered
=
`
sed
-E
-e
's/"([^"]|\")+"//g'
-e
's/integer unsigned/integer/g'
$ac_tmpa
`
# check for various things iverilog accepts which we don't want to output
# check for various things iverilog accepts which we don't want to output
...
@@ -104,34 +102,46 @@ simpleTest() {
...
@@ -104,34 +102,46 @@ simpleTest() {
assertConverts
$tb
assertConverts
$tb
fi
fi
c
v
=
$SHUNIT_TMPDIR
/conv
.v
c
s
=
$SHUNIT_TMPDIR
/cs
.v
convert
$c
v
$sv
convert
$c
s
$sv
simulateAndCompare
$ve
$cv
$tb
cv
=
$SHUNIT_TMPDIR
/cv.v
convert
$cv
$sv
-v
simulateAndCompare
$ve
$cs
$cv
$tb
}
}
simulateAndCompare
()
{
simulateAndCompare
()
{
ve
=
$1
ve
=
$1
# reference verilog
cv
=
$2
cs
=
$2
# converted succinct
tb
=
$3
cv
=
$3
# converted verbose
tb
=
$4
# testbench
ref_vcd
=
$SHUNIT_TMPDIR
/ref.vcd
ref_vcd
=
$SHUNIT_TMPDIR
/ref.vcd
gen_vcd
=
$SHUNIT_TMPDIR
/gen.vcd
cvs_vcd
=
$SHUNIT_TMPDIR
/cvs.vcd
cvv_vcd
=
$SHUNIT_TMPDIR
/cvv.vcd
ref_log
=
$SHUNIT_TMPDIR
/ref.log
ref_log
=
$SHUNIT_TMPDIR
/ref.log
gen_log
=
$SHUNIT_TMPDIR
/gen.log
cvs_log
=
$SHUNIT_TMPDIR
/cvs.log
cvv_log
=
$SHUNIT_TMPDIR
/cvv.log
# simulate
and compare the two
files
# simulate
the three
files
simulate
$ref_vcd
$ref_log
top
$ve
$tb
simulate
$ref_vcd
$ref_log
top
$ve
$tb
simulate
$gen_vcd
$gen_log
top
$cv
$tb
simulate
$cvs_vcd
$cvs_log
top
$cs
$tb
output
=
`
diff
$ref_vcd
$gen_vcd
`
simulate
$cvv_vcd
$cvv_log
top
$cv
$tb
assertTrue
"VCDs are different:
\n
$output
"
$?
output
=
`
diff
$ref_log
$gen_log
`
# compare reference verilog to converted succinct
assertTrue
"Simulation outputs differ:
\n
$output
"
$?
output
=
`
diff
$ref_vcd
$cvs_vcd
`
assertTrue
"VE/CS VCDs are different:
\n
$output
"
$?
rm
-f
$ref_vcd
output
=
`
diff
$ref_log
$cvs_log
`
rm
-f
$gen_vcd
assertTrue
"VE/CS simulation outputs differ:
\n
$output
"
$?
rm
-f
$ref_log
rm
-f
$gen_log
# compare converted verbose to converted succinct
output
=
`
diff
$cvv_vcd
$cvs_vcd
`
assertTrue
"CV/CS VCDs are different:
\n
$output
"
$?
output
=
`
diff
$cvv_log
$cvs_log
`
assertTrue
"CV/CS simulation outputs differ:
\n
$output
"
$?
rm
-f
$ref_vcd
$cvs_vcd
$cvv_vcd
$ref_log
$cvs_log
$cvv_log
}
}
runTest
()
{
runTest
()
{
...
...
test/siloed/run.sh
View file @
74a10a8e
#!/bin/bash
#!/bin/bash
test_default
()
{
test_default
()
{
cv
=
"
$SHUNIT_TMPDIR
/conv.v"
cs
=
$SHUNIT_TMPDIR
/cs.v
convert
"
$cv
"
package.svh module.sv
cv
=
$SHUNIT_TMPDIR
/cv.v
simulateAndCompare
"reference.v"
"
$cv
"
"
$SCRIPT_DIR
/empty.v"
convert
$cs
package.svh module.sv
convert
$cv
package.svh module.sv
-v
simulateAndCompare reference.v
$cs
$cv
"
$SCRIPT_DIR
/empty.v"
}
}
test_siloed
()
{
test_siloed
()
{
...
...
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