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
39f0e9b4
Commit
39f0e9b4
authored
Oct 19, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor perf optimization
parent
336b180d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
6 deletions
+5
-6
src/Convert/DimensionQuery.hs
+1
-2
src/Convert/Simplify.hs
+2
-0
src/Convert/SizeCast.hs
+1
-1
src/Convert/Traverse.hs
+1
-3
No files found.
src/Convert/DimensionQuery.hs
View file @
39f0e9b4
...
...
@@ -55,8 +55,7 @@ traverseStmtM :: Stmt -> State Info Stmt
traverseStmtM
stmt
=
traverseStmtExprsM
traverseExprM
stmt
traverseExprM
::
Expr
->
State
Info
Expr
traverseExprM
=
traverseNestedExprsM
$
stately
converter
where
converter
a
b
=
simplify
$
(
traverseNestedExprs
(
convertExpr
a
)
b
)
traverseExprM
=
traverseNestedExprsM
$
stately
convertExpr
-- elaborate integer atom types to have explicit dimensions
elaborateType
::
Type
->
Type
...
...
src/Convert/Simplify.hs
View file @
39f0e9b4
...
...
@@ -71,6 +71,8 @@ convertExpr info (Mux cc aa bb) =
where
before
=
substitute
info
cc
after
=
simplify
before
convertExpr
_
(
other
@
Repeat
{})
=
traverseNestedExprs
simplify
other
convertExpr
_
(
other
@
Concat
{})
=
simplify
other
convertExpr
_
other
=
other
substitute
::
Info
->
Expr
->
Expr
...
...
src/Convert/SizeCast.hs
View file @
39f0e9b4
...
...
@@ -76,7 +76,7 @@ castFn e sg =
Function
(
Just
Automatic
)
t
fnName
[
decl
]
[
Return
$
Ident
inp
]
where
inp
=
"inp"
r
=
(
BinOp
Sub
e
(
Number
"1"
),
Number
"0"
)
r
=
(
simplify
$
BinOp
Sub
e
(
Number
"1"
),
Number
"0"
)
t
=
IntegerVector
TLogic
sg
[
r
]
fnName
=
castFnName
e
sg
decl
=
Variable
Input
t
inp
[]
Nothing
...
...
src/Convert/Traverse.hs
View file @
39f0e9b4
...
...
@@ -349,9 +349,7 @@ traverseAssertionExprsM mapper = assertionMapper
propExprMapper
(
PropExprIff
p1
p2
)
=
ppMapper
PropExprIff
p1
p2
propSpecMapper
(
PropertySpec
ms
me
pe
)
=
do
me'
<-
case
me
of
Nothing
->
return
Nothing
Just
e
->
mapper
e
>>=
return
.
Just
me'
<-
maybeExprMapper
me
pe'
<-
propExprMapper
pe
return
$
PropertySpec
ms
me'
pe'
assertionExprMapper
(
Left
e
)
=
...
...
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