Skip to content

Commit

Permalink
Merge pull request #2568 from clash-lang/fix_benchmark
Browse files Browse the repository at this point in the history
Fix clash normalization benchmark
  • Loading branch information
christiaanb authored Aug 29, 2023
2 parents 9b9cf4d + 133b936 commit c5a5c39
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
28 changes: 14 additions & 14 deletions benchmark/benchmark-normalization.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ benchFile idirs src =
env (setupEnv idirs src) $
\ ~(clashEnv, clashDesign, supplyN) -> do
let topEntities = fmap topId (designEntities clashDesign)
case topEntities of
topEntity:_ ->
bench ("normalization of " ++ src)
(nfIO
(normalizeEntity
clashEnv
(designBindings clashDesign)
(ghcTypeToHWType (opt_intWidth (envOpts clashEnv)))
ghcEvaluator
evaluator
topEntities
supplyN
topEntity))
_ -> error "no top entities"
topEntity = case topEntities of
t:_ -> t
_ -> error "no top entities"
bench ("normalization of " ++ src)
(nfIO
(normalizeEntity
clashEnv
(designBindings clashDesign)
(ghcTypeToHWType (opt_intWidth (envOpts clashEnv)))
ghcEvaluator
evaluator
topEntities
supplyN
topEntity))

setupEnv
:: [FilePath]
Expand Down
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ package clash-cores
-- so we're able to import its css file from the custom theme.
haddock-options: --theme=doc/linuwial-wrap-types.css --theme=Linuwial

package clash-benchmark
executable-dynamic: True

optional-packages:
./benchmark
./benchmark/profiling/prepare
Expand Down

0 comments on commit c5a5c39

Please sign in to comment.