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
08c38e61
Commit
08c38e61
authored
Oct 06, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support time literals as expressions
parent
1a394cff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
0 deletions
+5
-0
src/Convert/Struct.hs
+1
-0
src/Convert/Traverse.hs
+1
-0
src/Language/SystemVerilog/AST/Expr.hs
+2
-0
src/Language/SystemVerilog/Parser/Parse.y
+1
-0
No files found.
src/Convert/Struct.hs
View file @
08c38e61
...
...
@@ -441,6 +441,7 @@ convertAsgn structs types (lhs, expr) =
(
Implicit
Unspecified
[]
,
Call
(
Just
x
)
f
args
)
convertSubExpr
(
String
s
)
=
(
Implicit
Unspecified
[]
,
String
s
)
convertSubExpr
(
Number
n
)
=
(
Implicit
Unspecified
[]
,
Number
n
)
convertSubExpr
(
Time
n
)
=
(
Implicit
Unspecified
[]
,
Time
n
)
convertSubExpr
(
PSIdent
x
y
)
=
(
Implicit
Unspecified
[]
,
PSIdent
x
y
)
convertSubExpr
(
Repeat
e
es
)
=
(
Implicit
Unspecified
[]
,
Repeat
e'
es'
)
...
...
src/Convert/Traverse.hs
View file @
08c38e61
...
...
@@ -426,6 +426,7 @@ traverseNestedExprsM mapper = exprMapper
exprMapper
e
>>=
return
.
Right
em
(
String
s
)
=
return
$
String
s
em
(
Number
s
)
=
return
$
Number
s
em
(
Time
s
)
=
return
$
Time
s
em
(
Ident
i
)
=
return
$
Ident
i
em
(
PSIdent
x
y
)
=
return
$
PSIdent
x
y
em
(
Range
e
m
(
e1
,
e2
))
=
do
...
...
src/Language/SystemVerilog/AST/Expr.hs
View file @
08c38e61
...
...
@@ -39,6 +39,7 @@ type TypeOrExpr = Either Type Expr
data
Expr
=
String
String
|
Number
String
|
Time
String
|
Ident
Identifier
|
PSIdent
Identifier
Identifier
|
Range
Expr
PartSelectMode
Range
...
...
@@ -62,6 +63,7 @@ data Expr
instance
Show
Expr
where
show
(
Nil
)
=
""
show
(
Number
str
)
=
str
show
(
Time
str
)
=
str
show
(
Ident
str
)
=
str
show
(
PSIdent
x
y
)
=
printf
"%s::%s"
x
y
show
(
String
str
)
=
printf
"
\"
%s
\"
"
str
...
...
src/Language/SystemVerilog/Parser/Parse.y
View file @
08c38e61
...
...
@@ -1085,6 +1085,7 @@ Expr :: { Expr }
: "(" Expr ")" { $2 }
| String { String $1 }
| Number { Number $1 }
| Time { Time $1 }
| Identifier CallArgs { Call (Nothing) $1 $2 }
| Identifier "::" Identifier CallArgs { Call (Just $1) $3 $4 }
| DimsFn "(" TypeOrExpr ")" { DimsFn $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