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
cbe0071e
Commit
cbe0071e
authored
Jun 14, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bit param sizing (resolves #94)
parent
12be5697
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
src/Convert/Logic.hs
+2
-0
test/basic/bit.sv
+26
-0
test/basic/bit.v
+26
-0
No files found.
src/Convert/Logic.hs
View file @
cbe0071e
...
@@ -150,6 +150,8 @@ convertDescription ports orig =
...
@@ -150,6 +150,8 @@ convertDescription ports orig =
convertModuleItem
other
=
other
convertModuleItem
other
=
other
-- all other logics (i.e. inside of functions) become regs
-- all other logics (i.e. inside of functions) become regs
convertDecl
::
Decl
->
Decl
convertDecl
::
Decl
->
Decl
convertDecl
(
Param
s
(
IntegerVector
_
sg
[]
)
x
e
)
=
Param
s
(
Implicit
sg
[(
Number
"0"
,
Number
"0"
)])
x
e
convertDecl
(
Param
s
(
IntegerVector
_
sg
rs
)
x
e
)
=
convertDecl
(
Param
s
(
IntegerVector
_
sg
rs
)
x
e
)
=
Param
s
(
Implicit
sg
rs
)
x
e
Param
s
(
Implicit
sg
rs
)
x
e
convertDecl
(
Variable
d
(
IntegerVector
TLogic
sg
rs
)
x
a
e
)
=
convertDecl
(
Variable
d
(
IntegerVector
TLogic
sg
rs
)
x
a
e
)
=
...
...
test/basic/bit.sv
0 → 100644
View file @
cbe0071e
module
Example
;
parameter
bit
P
=
0
;
initial
$
display
(
"Example: %b"
,
P
)
;
endmodule
module
top
;
Example
a
()
;
Example
#(
0
)
b
()
;
Example
#(
1
)
c
()
;
Example
#(
2
)
d
()
;
Example
#(
3
)
e
()
;
function
bit
foo
;
input
bit
inp
;
return
inp
^
1
;
endfunction
initial
begin
$
display
(
"foo(0) = %b"
,
foo
(
0
))
;
$
display
(
"foo(1) = %b"
,
foo
(
1
))
;
$
display
(
"foo(2) = %b"
,
foo
(
2
))
;
$
display
(
"foo(3) = %b"
,
foo
(
3
))
;
end
bit
x
;
assign
x
=
1
;
endmodule
test/basic/bit.v
0 → 100644
View file @
cbe0071e
module
Example
;
parameter
[
0
:
0
]
P
=
0
;
initial
$
display
(
"Example: %b"
,
P
)
;
endmodule
module
top
;
Example
a
()
;
Example
#(
0
)
b
()
;
Example
#(
1
)
c
()
;
Example
#(
2
)
d
()
;
Example
#(
3
)
e
()
;
function
[
0
:
0
]
foo
;
input
[
0
:
0
]
inp
;
foo
=
inp
^
1
;
endfunction
initial
begin
$
display
(
"foo(0) = %b"
,
foo
(
0
))
;
$
display
(
"foo(1) = %b"
,
foo
(
1
))
;
$
display
(
"foo(2) = %b"
,
foo
(
2
))
;
$
display
(
"foo(3) = %b"
,
foo
(
3
))
;
end
wire
x
;
assign
x
=
1
;
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