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
2579bc83
Commit
2579bc83
authored
Nov 05, 2023
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
translate input reg to input wire
parent
6ffa31ff
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
2 deletions
+33
-2
CHANGELOG.md
+1
-0
src/Convert/Logic.hs
+10
-2
test/core/input_reg.sv
+6
-0
test/core/input_reg.v
+6
-0
test/core/input_reg_tb.v
+10
-0
No files found.
CHANGELOG.md
View file @
2579bc83
...
...
@@ -30,6 +30,7 @@
*
Added error checking for unresolved typenames
*
Added constant folding for
`||`
and
`&&`
*
`input reg`
module ports are now converted to
`input wire`
## v0.0.11
...
...
src/Convert/Logic.hs
View file @
2579bc83
...
...
@@ -168,8 +168,16 @@ rewriteDeclM locations (Variable d (IntegerVector TLogic sg rs) x a e) = do
let
t'
=
Implicit
sg
rs
insertElem
accesses
t'
return
$
Net
d
TWire
DefaultStrength
t'
x
a
e
rewriteDeclM
_
decl
@
(
Variable
_
t
x
_
_
)
=
insertElem
x
t
>>
return
decl
rewriteDeclM
locations
decl
@
(
Variable
d
t
x
a
e
)
=
do
inProcedure
<-
withinProcedureM
case
(
d
,
t
,
inProcedure
)
of
-- Reinterpret `input reg` module ports as `input logic`. We still don't
-- treat `logic` and `reg` as the same keyword, as specifying `reg`
-- explicitly is typically expected to flow downstream.
(
Input
,
IntegerVector
TReg
sg
rs
,
False
)
->
rewriteDeclM
locations
$
Variable
Input
t'
x
a
e
where
t'
=
IntegerVector
TLogic
sg
rs
_
->
insertElem
x
t
>>
return
decl
rewriteDeclM
_
(
Net
d
n
s
(
IntegerVector
_
sg
rs
)
x
a
e
)
=
insertElem
x
t
>>
return
(
Net
d
n
s
t
x
a
e
)
where
t
=
Implicit
sg
rs
...
...
test/core/input_reg.sv
0 → 100644
View file @
2579bc83
module
Example
(
input
reg
inp
,
output
reg
out
)
;
assign
out
=
~
inp
;
endmodule
test/core/input_reg.v
0 → 100644
View file @
2579bc83
module
Example
(
input
wire
inp
,
output
wire
out
)
;
assign
out
=
~
inp
;
endmodule
test/core/input_reg_tb.v
0 → 100644
View file @
2579bc83
module
top
;
reg
inp
;
wire
out
;
Example
e
(
inp
,
out
)
;
initial
repeat
(
5
)
begin
#
1
inp
=
0
;
#
1
inp
=
1
;
end
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