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
c6eedb9f
Commit
c6eedb9f
authored
Sep 30, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass through named events
parent
e2570303
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
src/Convert/Traverse.hs
+2
-2
src/Language/SystemVerilog/AST/Stmt.hs
+2
-2
src/Language/SystemVerilog/AST/Type.hs
+2
-0
src/Language/SystemVerilog/Parser/Parse.y
+4
-1
No files found.
src/Convert/Traverse.hs
View file @
c6eedb9f
...
...
@@ -251,7 +251,7 @@ traverseSinglyNestedStmtsM fullMapper = cs
cs
(
Timing
event
stmt
)
=
fullMapper
stmt
>>=
return
.
Timing
event
cs
(
Return
expr
)
=
return
$
Return
expr
cs
(
Subroutine
ps
f
exprs
)
=
return
$
Subroutine
ps
f
exprs
cs
(
Trigger
x
)
=
return
$
Trigger
x
cs
(
Trigger
blocks
x
)
=
return
$
Trigger
blocks
x
cs
(
Assertion
a
)
=
traverseAssertionStmtsM
fullMapper
a
>>=
return
.
Assertion
cs
(
Null
)
=
return
Null
...
...
@@ -703,7 +703,7 @@ traverseStmtExprsM exprMapper = flatStmtMapper
return
$
Subroutine
ps
f
(
Args
l'
p'
)
flatStmtMapper
(
Return
expr
)
=
exprMapper
expr
>>=
return
.
Return
flatStmtMapper
(
Trigger
x
)
=
return
$
Trigger
x
flatStmtMapper
(
Trigger
blocks
x
)
=
return
$
Trigger
blocks
x
flatStmtMapper
(
Assertion
a
)
=
do
a'
<-
traverseAssertionStmtsM
stmtMapper
a
a''
<-
traverseAssertionExprsM
exprMapper
a'
...
...
src/Language/SystemVerilog/AST/Stmt.hs
View file @
c6eedb9f
...
...
@@ -49,7 +49,7 @@ data Stmt
|
Timing
Timing
Stmt
|
Return
Expr
|
Subroutine
(
Maybe
Identifier
)
Identifier
Args
|
Trigger
Identifier
|
Trigger
Bool
Identifier
|
Assertion
Assertion
|
Null
deriving
Eq
...
...
@@ -94,7 +94,7 @@ instance Show Stmt where
show
(
If
u
a
b
c
)
=
printf
"%sif (%s) %s
\n
else %s"
(
maybe
""
showPad
u
)
(
show
a
)
(
show
b
)
(
show
c
)
show
(
Return
e
)
=
printf
"return %s;"
(
show
e
)
show
(
Timing
t
s
)
=
printf
"%s %s"
(
show
t
)
(
show
s
)
show
(
Trigger
x
)
=
printf
"-> %s;"
x
show
(
Trigger
b
x
)
=
printf
"->%s %s;"
(
if
b
then
""
else
">"
)
x
show
(
Assertion
a
)
=
show
a
show
(
Null
)
=
";"
...
...
src/Language/SystemVerilog/AST/Type.hs
View file @
c6eedb9f
...
...
@@ -148,6 +148,7 @@ data NonIntegerType
|
TReal
|
TRealtime
|
TString
|
TEvent
deriving
(
Eq
,
Ord
)
instance
Show
NetType
where
...
...
@@ -179,6 +180,7 @@ instance Show NonIntegerType where
show
TReal
=
"real"
show
TRealtime
=
"realtime"
show
TString
=
"string"
show
TEvent
=
"event"
data
Packing
=
Unpacked
...
...
src/Language/SystemVerilog/Parser/Parse.y
View file @
c6eedb9f
...
...
@@ -486,6 +486,7 @@ NonIntegerType :: { NonIntegerType }
| "real" { TReal }
| "realtime" { TRealtime }
| "string" { TString }
| "event" { TEvent }
EnumItems :: { [(Identifier, Maybe Expr)] }
: VariablePortIdentifiers { $1 }
...
...
@@ -915,7 +916,8 @@ StmtNonBlock :: { Stmt }
| "do" Stmt "while" "(" Expr ")" ";" { DoWhile $5 $2 }
| "forever" Stmt { Forever $2 }
| "foreach" "(" Identifier IdxVars ")" Stmt { Foreach $3 $4 $6 }
| "->" Identifier ";" { Trigger $2 }
| "->" Identifier ";" { Trigger True $2 }
| "->>" Identifier ";" { Trigger False $2 }
| AttributeInstance Stmt { StmtAttr $1 $2 }
| ProceduralAssertionStatement { Assertion $1 }
| IncOrDecOperator LHS ";" { AsgnBlk (AsgnOp $1) $2 (Number "1") }
...
...
@@ -1000,6 +1002,7 @@ EventControl :: { Sense }
: "@" "(" Senses ")" { $3 }
| "@" "(*)" { SenseStar }
| "@*" { SenseStar }
| "@" Identifier { Sense $ LHSIdent $2 }
Senses :: { Sense }
: Sense { $1 }
| Senses "or" Sense { SenseOr $1 $3 }
...
...
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