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
7267f94b
Commit
7267f94b
authored
Sep 16, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow signing on net types (closes #40)
parent
5d80c830
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
11 deletions
+11
-11
src/Convert/DimensionQuery.hs
+1
-1
src/Convert/Logic.hs
+2
-2
src/Convert/ParamType.hs
+1
-1
src/Convert/Traverse.hs
+1
-1
src/Convert/Typedef.hs
+2
-2
src/Language/SystemVerilog/AST/Type.hs
+3
-3
src/Language/SystemVerilog/Parser/Parse.y
+1
-1
No files found.
src/Convert/DimensionQuery.hs
View file @
7267f94b
...
@@ -147,7 +147,7 @@ convertBits _ (Left t) =
...
@@ -147,7 +147,7 @@ convertBits _ (Left t) =
case
elaborateType
t
of
case
elaborateType
t
of
IntegerVector
_
_
rs
->
dimensionsSize
rs
IntegerVector
_
_
rs
->
dimensionsSize
rs
Implicit
_
rs
->
dimensionsSize
rs
Implicit
_
rs
->
dimensionsSize
rs
Net
_
rs
->
dimensionsSize
rs
Net
_
_
rs
->
dimensionsSize
rs
_
->
DimsFn
FnBits
$
Left
t
_
->
DimsFn
FnBits
$
Left
t
convertBits
info
(
Right
e
)
=
convertBits
info
(
Right
e
)
=
case
e
of
case
e
of
...
...
src/Convert/Logic.hs
View file @
7267f94b
...
@@ -101,7 +101,7 @@ convertDescription ports orig =
...
@@ -101,7 +101,7 @@ convertDescription ports orig =
collectNestedExprsM
exprIdents
expr
collectNestedExprsM
exprIdents
expr
tmp
=
"sv2v_tmp_"
++
instanceName
++
"_"
++
portName
tmp
=
"sv2v_tmp_"
++
instanceName
++
"_"
++
portName
tmpExpr
=
Ident
tmp
tmpExpr
=
Ident
tmp
t
=
Net
TWire
[(
DimsFn
FnBits
$
Right
expr
,
Number
"1"
)]
t
=
Net
TWire
Unspecified
[(
DimsFn
FnBits
$
Right
expr
,
Number
"1"
)]
items
=
items
=
[
MIPackageItem
$
Decl
$
Variable
Local
t
tmp
[]
Nothing
[
MIPackageItem
$
Decl
$
Variable
Local
t
tmp
[]
Nothing
,
AlwaysC
AlwaysComb
$
AsgnBlk
AsgnOpEq
lhs
tmpExpr
]
,
AlwaysC
AlwaysComb
$
AsgnBlk
AsgnOpEq
lhs
tmpExpr
]
...
@@ -118,7 +118,7 @@ convertDescription ports orig =
...
@@ -118,7 +118,7 @@ convertDescription ports orig =
where
where
t
=
if
sg
/=
Unspecified
||
Set
.
member
ident
idents
t
=
if
sg
/=
Unspecified
||
Set
.
member
ident
idents
then
IntegerVector
TReg
sg
then
IntegerVector
TReg
sg
else
Net
TWire
else
Net
TWire
sg
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
...
...
src/Convert/ParamType.hs
View file @
7267f94b
...
@@ -218,7 +218,7 @@ isSimpleType :: Type -> Bool
...
@@ -218,7 +218,7 @@ isSimpleType :: Type -> Bool
isSimpleType
(
IntegerVector
_
_
_
)
=
True
isSimpleType
(
IntegerVector
_
_
_
)
=
True
isSimpleType
(
IntegerAtom
_
_
)
=
True
isSimpleType
(
IntegerAtom
_
_
)
=
True
isSimpleType
(
NonInteger
_
)
=
True
isSimpleType
(
NonInteger
_
)
=
True
isSimpleType
(
Net
_
_
)
=
True
isSimpleType
(
Net
_
_
_
)
=
True
isSimpleType
_
=
False
isSimpleType
_
=
False
-- attempt to rewrite instantiations with type parameters
-- attempt to rewrite instantiations with type parameters
...
...
src/Convert/Traverse.hs
View file @
7267f94b
...
@@ -808,7 +808,7 @@ traverseNestedTypesM mapper = fullMapper
...
@@ -808,7 +808,7 @@ traverseNestedTypesM mapper = fullMapper
where
where
fullMapper
t
=
tm
t
>>=
mapper
fullMapper
t
=
tm
t
>>=
mapper
tm
(
Alias
ps
xx
rs
)
=
return
$
Alias
ps
xx
rs
tm
(
Alias
ps
xx
rs
)
=
return
$
Alias
ps
xx
rs
tm
(
Net
kw
rs
)
=
return
$
Net
kw
rs
tm
(
Net
kw
sg
rs
)
=
return
$
Net
kw
sg
rs
tm
(
Implicit
sg
rs
)
=
return
$
Implicit
sg
rs
tm
(
Implicit
sg
rs
)
=
return
$
Implicit
sg
rs
tm
(
IntegerVector
kw
sg
rs
)
=
return
$
IntegerVector
kw
sg
rs
tm
(
IntegerVector
kw
sg
rs
)
=
return
$
IntegerVector
kw
sg
rs
tm
(
IntegerAtom
kw
sg
)
=
return
$
IntegerAtom
kw
sg
tm
(
IntegerAtom
kw
sg
)
=
return
$
IntegerAtom
kw
sg
...
...
src/Convert/Typedef.hs
View file @
7267f94b
...
@@ -71,7 +71,7 @@ resolveItem :: Types -> (Type, Identifier) -> (Type, Identifier)
...
@@ -71,7 +71,7 @@ resolveItem :: Types -> (Type, Identifier) -> (Type, Identifier)
resolveItem
types
(
t
,
x
)
=
(
resolveType
types
t
,
x
)
resolveItem
types
(
t
,
x
)
=
(
resolveType
types
t
,
x
)
resolveType
::
Types
->
Type
->
Type
resolveType
::
Types
->
Type
->
Type
resolveType
_
(
Net
kw
rs
)
=
Net
kw
rs
resolveType
_
(
Net
kw
sg
rs
)
=
Net
kw
sg
rs
resolveType
_
(
Implicit
sg
rs
)
=
Implicit
sg
rs
resolveType
_
(
Implicit
sg
rs
)
=
Implicit
sg
rs
resolveType
_
(
IntegerVector
kw
sg
rs
)
=
IntegerVector
kw
sg
rs
resolveType
_
(
IntegerVector
kw
sg
rs
)
=
IntegerVector
kw
sg
rs
resolveType
_
(
IntegerAtom
kw
sg
)
=
IntegerAtom
kw
sg
resolveType
_
(
IntegerAtom
kw
sg
)
=
IntegerAtom
kw
sg
...
@@ -86,7 +86,7 @@ resolveType types (Alias Nothing st rs1) =
...
@@ -86,7 +86,7 @@ resolveType types (Alias Nothing st rs1) =
if
Map
.
notMember
st
types
if
Map
.
notMember
st
types
then
Alias
Nothing
st
rs1
then
Alias
Nothing
st
rs1
else
case
resolveType
types
$
types
Map
.!
st
of
else
case
resolveType
types
$
types
Map
.!
st
of
(
Net
kw
rs2
)
->
Net
kw
$
rs1
++
rs2
(
Net
kw
sg
rs2
)
->
Net
kw
sg
$
rs1
++
rs2
(
Implicit
sg
rs2
)
->
Implicit
sg
$
rs1
++
rs2
(
Implicit
sg
rs2
)
->
Implicit
sg
$
rs1
++
rs2
(
IntegerVector
kw
sg
rs2
)
->
IntegerVector
kw
sg
$
rs1
++
rs2
(
IntegerVector
kw
sg
rs2
)
->
IntegerVector
kw
sg
$
rs1
++
rs2
(
Enum
t
v
rs2
)
->
Enum
t
v
$
rs1
++
rs2
(
Enum
t
v
rs2
)
->
Enum
t
v
$
rs1
++
rs2
...
...
src/Language/SystemVerilog/AST/Type.hs
View file @
7267f94b
...
@@ -33,7 +33,7 @@ data Type
...
@@ -33,7 +33,7 @@ data Type
=
IntegerVector
IntegerVectorType
Signing
[
Range
]
=
IntegerVector
IntegerVectorType
Signing
[
Range
]
|
IntegerAtom
IntegerAtomType
Signing
|
IntegerAtom
IntegerAtomType
Signing
|
NonInteger
NonIntegerType
|
NonInteger
NonIntegerType
|
Net
NetType
[
Range
]
|
Net
NetType
Signing
[
Range
]
|
Implicit
Signing
[
Range
]
|
Implicit
Signing
[
Range
]
|
Alias
(
Maybe
Identifier
)
Identifier
[
Range
]
|
Alias
(
Maybe
Identifier
)
Identifier
[
Range
]
|
Enum
(
Maybe
Type
)
[
Item
]
[
Range
]
|
Enum
(
Maybe
Type
)
[
Item
]
[
Range
]
...
@@ -44,7 +44,7 @@ data Type
...
@@ -44,7 +44,7 @@ data Type
instance
Show
Type
where
instance
Show
Type
where
show
(
Alias
ps
xx
rs
)
=
printf
"%s%s%s"
(
maybe
""
(
++
"::"
)
ps
)
xx
(
showRanges
rs
)
show
(
Alias
ps
xx
rs
)
=
printf
"%s%s%s"
(
maybe
""
(
++
"::"
)
ps
)
xx
(
showRanges
rs
)
show
(
Net
kw
rs
)
=
printf
"%s%s"
(
show
kw
)
(
showRanges
rs
)
show
(
Net
kw
sg
rs
)
=
printf
"%s%s%s"
(
show
kw
)
(
showPadBefore
sg
)
(
showRanges
rs
)
show
(
Implicit
sg
rs
)
=
printf
"%s%s"
(
showPad
sg
)
(
dropWhile
(
==
' '
)
$
showRanges
rs
)
show
(
Implicit
sg
rs
)
=
printf
"%s%s"
(
showPad
sg
)
(
dropWhile
(
==
' '
)
$
showRanges
rs
)
show
(
IntegerVector
kw
sg
rs
)
=
printf
"%s%s%s"
(
show
kw
)
(
showPadBefore
sg
)
(
showRanges
rs
)
show
(
IntegerVector
kw
sg
rs
)
=
printf
"%s%s%s"
(
show
kw
)
(
showPadBefore
sg
)
(
showRanges
rs
)
show
(
IntegerAtom
kw
sg
)
=
printf
"%s%s"
(
show
kw
)
(
showPadBefore
sg
)
show
(
IntegerAtom
kw
sg
)
=
printf
"%s%s"
(
show
kw
)
(
showPadBefore
sg
)
...
@@ -81,7 +81,7 @@ instance Ord (Signing -> [Range] -> Type) where
...
@@ -81,7 +81,7 @@ instance Ord (Signing -> [Range] -> Type) where
typeRanges
::
Type
->
([
Range
]
->
Type
,
[
Range
])
typeRanges
::
Type
->
([
Range
]
->
Type
,
[
Range
])
typeRanges
(
Alias
ps
xx
rs
)
=
(
Alias
ps
xx
,
rs
)
typeRanges
(
Alias
ps
xx
rs
)
=
(
Alias
ps
xx
,
rs
)
typeRanges
(
Net
kw
rs
)
=
(
Net
kw
,
rs
)
typeRanges
(
Net
kw
sg
rs
)
=
(
Net
kw
sg
,
rs
)
typeRanges
(
Implicit
sg
rs
)
=
(
Implicit
sg
,
rs
)
typeRanges
(
Implicit
sg
rs
)
=
(
Implicit
sg
,
rs
)
typeRanges
(
IntegerVector
kw
sg
rs
)
=
(
IntegerVector
kw
sg
,
rs
)
typeRanges
(
IntegerVector
kw
sg
rs
)
=
(
IntegerVector
kw
sg
,
rs
)
typeRanges
(
IntegerAtom
kw
sg
)
=
(
nullRange
$
IntegerAtom
kw
sg
,
[]
)
typeRanges
(
IntegerAtom
kw
sg
)
=
(
nullRange
$
IntegerAtom
kw
sg
,
[]
)
...
...
src/Language/SystemVerilog/Parser/Parse.y
View file @
7267f94b
...
@@ -432,7 +432,7 @@ Type :: { Type }
...
@@ -432,7 +432,7 @@ Type :: { Type }
TypeNonIdent :: { Type }
TypeNonIdent :: { Type }
: PartialType OptSigning Dimensions { $1 $2 $3 }
: PartialType OptSigning Dimensions { $1 $2 $3 }
PartialType :: { Signing -> [Range] -> Type }
PartialType :: { Signing -> [Range] -> Type }
: NetType {
\Unspecified ->
Net $1 }
: NetType {
Net $1 }
| IntegerVectorType { IntegerVector $1 }
| IntegerVectorType { IntegerVector $1 }
| IntegerAtomType { \sg -> \[] -> IntegerAtom $1 sg }
| IntegerAtomType { \sg -> \[] -> IntegerAtom $1 sg }
| NonIntegerType { \Unspecified -> \[] -> NonInteger $1 }
| NonIntegerType { \Unspecified -> \[] -> NonInteger $1 }
...
...
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