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
79f9d21f
Commit
79f9d21f
authored
Oct 12, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
leave non-data-declarations at the end of modules
parent
c722e931
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
src/Convert/NestPI.hs
+8
-1
test/basic/size_cast.sv
+1
-1
test/basic/size_cast.v
+1
-1
No files found.
src/Convert/NestPI.hs
View file @
79f9d21f
...
@@ -46,7 +46,7 @@ collectDescriptionM _ = return ()
...
@@ -46,7 +46,7 @@ collectDescriptionM _ = return ()
-- nests packages items missing from modules
-- nests packages items missing from modules
convertDescription
::
PIs
->
Description
->
Description
convertDescription
::
PIs
->
Description
->
Description
convertDescription
pis
(
orig
@
Part
{})
=
convertDescription
pis
(
orig
@
Part
{})
=
Part
attrs
extern
kw
lifetime
name
ports
(
newItems
++
items
)
Part
attrs
extern
kw
lifetime
name
ports
items'
where
where
Part
attrs
extern
kw
lifetime
name
ports
items
=
orig
Part
attrs
extern
kw
lifetime
name
ports
items
=
orig
existingPIs
=
execWriter
$
collectModuleItemsM
collectPIsM
orig
existingPIs
=
execWriter
$
collectModuleItemsM
collectPIsM
orig
...
@@ -63,6 +63,13 @@ convertDescription pis (orig @ Part{}) =
...
@@ -63,6 +63,13 @@ convertDescription pis (orig @ Part{}) =
uniq
l
=
l'
where
(
l'
,
_
,
_
)
=
complex
l
uniq
l
=
l'
where
(
l'
,
_
,
_
)
=
complex
l
newItems
=
uniq
$
map
MIPackageItem
$
map
snd
$
newItems
=
uniq
$
map
MIPackageItem
$
map
snd
$
filter
(
\
(
x
,
_
)
->
Set
.
member
x
neededPIs
)
pis
filter
(
\
(
x
,
_
)
->
Set
.
member
x
neededPIs
)
pis
-- place data declarations at the beginning to obey declaration
-- ordering; everything else can go at the end
newItemsBefore
=
filter
isDecl
newItems
newItemsAfter
=
filter
(
not
.
isDecl
)
newItems
items'
=
newItemsBefore
++
items
++
newItemsAfter
isDecl
(
MIPackageItem
(
Decl
{}))
=
True
isDecl
_
=
False
convertDescription
_
other
=
other
convertDescription
_
other
=
other
-- writes down the names of package items
-- writes down the names of package items
...
...
test/basic/size_cast.sv
View file @
79f9d21f
...
@@ -2,5 +2,5 @@ module top;
...
@@ -2,5 +2,5 @@ module top;
localparam
BW
=
3
;
localparam
BW
=
3
;
logic
[
2
:
0
]
test
;
logic
[
2
:
0
]
test
;
assign
test
=
BW
'
(
0
)
;
assign
test
=
BW
'
(
0
)
;
initial
$
display
(
test
)
;
initial
#
1
$
display
(
test
)
;
endmodule
endmodule
test/basic/size_cast.v
View file @
79f9d21f
...
@@ -2,5 +2,5 @@ module top;
...
@@ -2,5 +2,5 @@ module top;
localparam
BW
=
3
;
localparam
BW
=
3
;
wire
[
2
:
0
]
test
;
wire
[
2
:
0
]
test
;
assign
test
=
0
;
assign
test
=
0
;
initial
$
display
(
test
)
;
initial
#
1
$
display
(
test
)
;
endmodule
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