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
d32c0a1b
Commit
d32c0a1b
authored
Jul 01, 2021
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert logics with initial values to regs, not wires
parent
9de4a3c9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
11 additions
and
12 deletions
+11
-12
src/Convert/Logic.hs
+1
-1
test/core/const.v
+1
-1
test/core/foreach.v
+1
-1
test/core/inside_expr.v
+1
-2
test/core/interface_nested.v
+1
-1
test/core/interface_task.v
+2
-2
test/core/large_mux.v
+1
-1
test/core/struct_integer.v
+1
-1
test/core/struct_unit_array.v
+1
-1
test/core/unbased_unsized.v
+1
-1
No files found.
src/Convert/Logic.hs
View file @
d32c0a1b
...
@@ -172,7 +172,7 @@ rewriteDeclM (Variable d t x a e) = do
...
@@ -172,7 +172,7 @@ rewriteDeclM (Variable d t x a e) = do
let
location
=
map
accessName
accesses
let
location
=
map
accessName
accesses
usedAsReg
<-
lift
$
gets
$
Set
.
member
location
usedAsReg
<-
lift
$
gets
$
Set
.
member
location
blockLogic
<-
withinProcedureM
blockLogic
<-
withinProcedureM
if
usedAsReg
||
blockLogic
if
usedAsReg
||
blockLogic
||
e
/=
Nil
then
do
then
do
let
dir
=
if
d
==
Inout
then
Output
else
d
let
dir
=
if
d
==
Inout
then
Output
else
d
return
(
dir
,
IntegerVector
TReg
sg
rs
)
return
(
dir
,
IntegerVector
TReg
sg
rs
)
...
...
test/core/const.v
View file @
d32c0a1b
module
top
;
module
top
;
integer
w
=
11
;
integer
w
=
11
;
wire
[
63
:
0
]
x
=
{
32'd11
,
32'd12
};
reg
[
63
:
0
]
x
=
{
32'd11
,
32'd12
};
initial
$
display
(
"%b %b %b %b"
,
w
,
x
,
x
[
32
+:
32
]
,
x
[
0
+:
32
])
;
initial
$
display
(
"%b %b %b %b"
,
w
,
x
,
x
[
32
+:
32
]
,
x
[
0
+:
32
])
;
endmodule
endmodule
test/core/foreach.v
View file @
d32c0a1b
module
top
;
module
top
;
wire
[
7
:
0
]
foo
=
{
2'b10
,
2'b01
,
2'b11
,
2'b00
};
reg
[
7
:
0
]
foo
=
{
2'b10
,
2'b01
,
2'b11
,
2'b00
};
initial
begin
:
f
initial
begin
:
f
integer
x
;
integer
x
;
for
(
x
=
0
;
x
<=
3
;
x
=
x
+
1
)
for
(
x
=
0
;
x
<=
3
;
x
=
x
+
1
)
...
...
test/core/inside_expr.v
View file @
d32c0a1b
...
@@ -49,8 +49,7 @@ module top;
...
@@ -49,8 +49,7 @@ module top;
$
display
(
"test1: %b %b"
,
3'b0z1
,
test1
(
3'b0z1
))
;
$
display
(
"test1: %b %b"
,
3'b0z1
,
test1
(
3'b0z1
))
;
end
end
wire
[
0
:
2
][
31
:
0
]
arr
;
reg
[
0
:
2
][
31
:
0
]
arr
=
{
32'd60
,
32'd61
,
32'd63
};
assign
arr
=
{
32'd60
,
32'd61
,
32'd63
};
function
test2
;
function
test2
;
input
integer
inp
;
input
integer
inp
;
integer
i
;
integer
i
;
...
...
test/core/interface_nested.v
View file @
d32c0a1b
module
top
;
module
top
;
wire
x
=
1
;
reg
x
=
1
;
generate
generate
if
(
1
)
begin
:
f
if
(
1
)
begin
:
f
wire
x
;
wire
x
;
...
...
test/core/interface_task.v
View file @
d32c0a1b
...
@@ -3,8 +3,8 @@ module top;
...
@@ -3,8 +3,8 @@ module top;
input
reg
[
31
:
0
]
i
;
input
reg
[
31
:
0
]
i
;
$
display
(
"I x(%0d)"
,
i
)
;
$
display
(
"I x(%0d)"
,
i
)
;
endtask
endtask
wire
[
31
:
0
]
w
=
31
;
reg
[
31
:
0
]
w
=
31
;
wire
[
31
:
0
]
y
=
42
;
reg
[
31
:
0
]
y
=
42
;
task
x
;
task
x
;
input
reg
[
31
:
0
]
a
,
b
;
input
reg
[
31
:
0
]
a
,
b
;
$
display
(
"x('{%0d, %0d})"
,
a
,
b
)
;
$
display
(
"x('{%0d, %0d})"
,
a
,
b
)
;
...
...
test/core/large_mux.v
View file @
d32c0a1b
module
top
;
module
top
;
parameter
SVO_MODE
=
"768x576"
;
parameter
SVO_MODE
=
"768x576"
;
`include
"large_mux.vh"
`include
"large_mux.vh"
wire
[
31
:
0
]
DOUBLE_SVO_HOR_PIXELS
=
2
*
SVO_HOR_PIXELS
;
reg
[
31
:
0
]
DOUBLE_SVO_HOR_PIXELS
=
2
*
SVO_HOR_PIXELS
;
initial
begin
initial
begin
$
display
(
"%s"
,
SVO_MODE
)
;
$
display
(
"%s"
,
SVO_MODE
)
;
$
display
(
"%d"
,
SVO_HOR_PIXELS
)
;
$
display
(
"%d"
,
SVO_HOR_PIXELS
)
;
...
...
test/core/struct_integer.v
View file @
d32c0a1b
module
top
;
module
top
;
wire
[
32
*
3
-
1
:
0
]
s
=
{
32'd1
,
32'd2
,
32'd3
};
reg
[
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
])
;
initial
#
1
$
display
(
"%b %b %b %b"
,
s
,
s
[
64
+:
32
]
,
s
[
32
+:
32
]
,
s
[
0
+:
32
])
;
endmodule
endmodule
test/core/struct_unit_array.v
View file @
d32c0a1b
module
top
;
module
top
;
wire
[
2
:
0
]
s
=
3'b110
;
reg
[
2
:
0
]
s
=
3'b110
;
initial
#
1
$
display
(
"%b"
,
s
)
;
initial
#
1
$
display
(
"%b"
,
s
)
;
endmodule
endmodule
test/core/unbased_unsized.v
View file @
d32c0a1b
`define
TEST
(
value
)
\
`define
TEST
(
value
)
\
wire
[
63
:
0
]
val_
`
`value
=
{
64
{
1
'
b
`
`value
}};
\
reg
[
63
:
0
]
val_
`
`value
=
{
64
{
1
'
b
`
`value
}};
\
initial
$
display
(
`
"'value -> %b (%0d) %b (%0d)`"
,
\
initial
$
display
(
`
"'value -> %b (%0d) %b (%0d)`"
,
\
val_
`
`value
,
$
bits
(
val_
`
`value
)
,
\
val_
`
`value
,
$
bits
(
val_
`
`value
)
,
\
1
'
b
`
`value
,
$
bits
(
1
'
b
`
`value
)
\
1
'
b
`
`value
,
$
bits
(
1
'
b
`
`value
)
\
...
...
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