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
f4181aba
Commit
f4181aba
authored
Sep 24, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added pass-through support for strings
parent
bce438c8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
+10
-1
src/Convert/Struct.hs
+7
-1
src/Language/SystemVerilog/AST/Type.hs
+2
-0
src/Language/SystemVerilog/Parser/Parse.y
+1
-0
No files found.
src/Convert/Struct.hs
View file @
f4181aba
...
@@ -170,7 +170,9 @@ traverseDeclM structs origDecl = do
...
@@ -170,7 +170,9 @@ traverseDeclM structs origDecl = do
case
origDecl
of
case
origDecl
of
Variable
d
t
x
a
me
->
do
Variable
d
t
x
a
me
->
do
let
(
tf
,
rs
)
=
typeRanges
t
let
(
tf
,
rs
)
=
typeRanges
t
modify
$
Map
.
insert
x
(
tf
$
a
++
rs
)
if
isRangeable
t
then
modify
$
Map
.
insert
x
(
tf
$
a
++
rs
)
else
return
()
case
me
of
case
me
of
Nothing
->
return
origDecl
Nothing
->
return
origDecl
Just
e
->
do
Just
e
->
do
...
@@ -188,6 +190,10 @@ traverseDeclM structs origDecl = do
...
@@ -188,6 +190,10 @@ traverseDeclM structs origDecl = do
types
<-
get
types
<-
get
let
(
LHSIdent
_
,
e'
)
=
convertAsgn
structs
types
(
LHSIdent
x
,
e
)
let
(
LHSIdent
_
,
e'
)
=
convertAsgn
structs
types
(
LHSIdent
x
,
e
)
return
e'
return
e'
isRangeable
::
Type
->
Bool
isRangeable
(
IntegerAtom
_
_
)
=
False
isRangeable
(
NonInteger
_
)
=
False
isRangeable
_
=
True
-- produces a function which packs the components of a struct literal
-- produces a function which packs the components of a struct literal
packerFn
::
TypeFunc
->
ModuleItem
packerFn
::
TypeFunc
->
ModuleItem
...
...
src/Language/SystemVerilog/AST/Type.hs
View file @
f4181aba
...
@@ -146,6 +146,7 @@ data NonIntegerType
...
@@ -146,6 +146,7 @@ data NonIntegerType
=
TShortreal
=
TShortreal
|
TReal
|
TReal
|
TRealtime
|
TRealtime
|
TString
deriving
(
Eq
,
Ord
)
deriving
(
Eq
,
Ord
)
instance
Show
NetType
where
instance
Show
NetType
where
...
@@ -176,6 +177,7 @@ instance Show NonIntegerType where
...
@@ -176,6 +177,7 @@ instance Show NonIntegerType where
show
TShortreal
=
"shortreal"
show
TShortreal
=
"shortreal"
show
TReal
=
"real"
show
TReal
=
"real"
show
TRealtime
=
"realtime"
show
TRealtime
=
"realtime"
show
TString
=
"string"
data
Packing
data
Packing
=
Unpacked
=
Unpacked
...
...
src/Language/SystemVerilog/Parser/Parse.y
View file @
f4181aba
...
@@ -485,6 +485,7 @@ NonIntegerType :: { NonIntegerType }
...
@@ -485,6 +485,7 @@ NonIntegerType :: { NonIntegerType }
: "shortreal" { TShortreal }
: "shortreal" { TShortreal }
| "real" { TReal }
| "real" { TReal }
| "realtime" { TRealtime }
| "realtime" { TRealtime }
| "string" { TString }
EnumItems :: { [(Identifier, Maybe Expr)] }
EnumItems :: { [(Identifier, Maybe Expr)] }
: VariablePortIdentifiers { $1 }
: VariablePortIdentifiers { $1 }
...
...
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