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
db4c3963
Commit
db4c3963
authored
Feb 17, 2020
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor multi-packed verbosity improvement
parent
8f2d7dd5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/Convert/MultiplePacked.hs
+2
-2
src/Language/SystemVerilog/AST/Expr.hs
+7
-2
No files found.
src/Convert/MultiplePacked.hs
View file @
db4c3963
...
@@ -93,8 +93,8 @@ combineRanges r1 r2 = r
...
@@ -93,8 +93,8 @@ combineRanges r1 r2 = r
combine
(
s1
,
e1
)
(
s2
,
e2
)
=
combine
(
s1
,
e1
)
(
s2
,
e2
)
=
(
simplify
upper
,
simplify
lower
)
(
simplify
upper
,
simplify
lower
)
where
where
size1
=
rangeSize
(
s1
,
e1
)
size1
=
rangeSize
HiLo
(
s1
,
e1
)
size2
=
rangeSize
(
s2
,
e2
)
size2
=
rangeSize
HiLo
(
s2
,
e2
)
lower
=
BinOp
Add
e2
(
BinOp
Mul
e1
size2
)
lower
=
BinOp
Add
e2
(
BinOp
Mul
e1
size2
)
upper
=
BinOp
Add
(
BinOp
Mul
size1
size2
)
upper
=
BinOp
Add
(
BinOp
Mul
size1
size2
)
(
BinOp
Sub
lower
(
Number
"1"
))
(
BinOp
Sub
lower
(
Number
"1"
))
...
...
src/Language/SystemVerilog/AST/Expr.hs
View file @
db4c3963
...
@@ -19,6 +19,7 @@ module Language.SystemVerilog.AST.Expr
...
@@ -19,6 +19,7 @@ module Language.SystemVerilog.AST.Expr
,
showExprOrRange
,
showExprOrRange
,
simplify
,
simplify
,
rangeSize
,
rangeSize
,
rangeSizeHiLo
,
endianCondExpr
,
endianCondExpr
,
endianCondRange
,
endianCondRange
,
dimensionsSize
,
dimensionsSize
...
@@ -274,8 +275,12 @@ rangeSize :: Range -> Expr
...
@@ -274,8 +275,12 @@ rangeSize :: Range -> Expr
rangeSize
(
s
,
e
)
=
rangeSize
(
s
,
e
)
=
endianCondExpr
(
s
,
e
)
a
b
endianCondExpr
(
s
,
e
)
a
b
where
where
a
=
simplify
$
BinOp
Add
(
BinOp
Sub
s
e
)
(
Number
"1"
)
a
=
rangeSizeHiLo
(
s
,
e
)
b
=
simplify
$
BinOp
Add
(
BinOp
Sub
e
s
)
(
Number
"1"
)
b
=
rangeSizeHiLo
(
e
,
s
)
rangeSizeHiLo
::
Range
->
Expr
rangeSizeHiLo
(
hi
,
lo
)
=
simplify
$
BinOp
Add
(
BinOp
Sub
hi
lo
)
(
Number
"1"
)
-- chooses one or the other expression based on the endianness of the given
-- chooses one or the other expression based on the endianness of the given
-- range; [hi:lo] chooses the first expression
-- range; [hi:lo] chooses the first expression
...
...
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