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
13b62fd8
Commit
13b62fd8
authored
Aug 11, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support structs of integers
parent
ddaa7ff6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
src/Convert/IntTypes.hs
+14
-0
test/basic/struct_integer.sv
+7
-0
test/basic/struct_integer.v
+4
-0
No files found.
src/Convert/IntTypes.hs
View file @
13b62fd8
...
...
@@ -17,6 +17,20 @@ convert =
traverseTypes
$
traverseNestedTypes
convertType
convertType
::
Type
->
Type
convertType
(
Struct
pk
fields
rs
)
=
Struct
pk
fields'
rs
where
fields'
=
convertStructFields
fields
convertType
(
Union
pk
fields
rs
)
=
Union
pk
fields'
rs
where
fields'
=
convertStructFields
fields
convertType
(
IntegerAtom
kw
sg
)
=
elaborateIntegerAtom
$
IntegerAtom
kw
sg
convertType
(
IntegerVector
TBit
sg
rs
)
=
IntegerVector
TLogic
sg
rs
convertType
other
=
other
convertStructFields
::
[(
Type
,
Identifier
)]
->
[(
Type
,
Identifier
)]
convertStructFields
fields
=
zip
(
map
(
convertStructFieldType
.
fst
)
fields
)
(
map
snd
fields
)
convertStructFieldType
::
Type
->
Type
convertStructFieldType
(
IntegerAtom
TInteger
sg
)
=
IntegerAtom
TInt
sg
convertStructFieldType
t
=
t
test/basic/struct_integer.sv
0 → 100644
View file @
13b62fd8
module
top
;
typedef
struct
packed
{
integer
a
,
b
,
c
;
}
S
;
S
s
=
'
{
a
:
1
,
b
:
2
,
c
:
3
};
initial
#
1
$
display
(
"%b %b %b %b"
,
s
,
s
.
a
,
s
.
b
,
s
.
c
)
;
endmodule
test/basic/struct_integer.v
0 → 100644
View file @
13b62fd8
module
top
;
wire
[
32
*
3
-
1
:
0
]
s
=
{
32'd1
,
32'd2
,
32'd3
};
initial
#
1
$
display
(
"%b %b %b %b"
,
s
,
s
[
64
+:
32
]
,
s
[
32
+:
32
]
,
s
[
0
+:
32
])
;
endmodule
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