-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad time complexity for VHDL, not Verilog #1557
Labels
Comments
The code can be further reduced while keeping the problematic behaviour: module LongVecCompl where
import Clash.Prelude
topEntity
:: SystemClockResetEnable
=> Signal System (Unsigned 8)
-> Signal System (Bool, Unsigned 8)
{-# NOINLINE topEntity #-}
topEntity = fmap (packetVecToStreamVec (replicate d25 0) !!)
packetVecToStreamVec pkt = map (\e -> (True, e)) (init pkt)
:< (False, last pkt) |
For some reason when compiling to Verilog the |
christiaanb
pushed a commit
that referenced
this issue
Jun 4, 2021
Clash was incorrectly trying to force the evaluator to evaluate the vector argument of the indexing operator in order to get the special primitive rule for indexing in verilog to fire, while it only needs the index argument to be evaluated to a literal when possible. Fixes #1557
christiaanb
pushed a commit
that referenced
this issue
Jun 4, 2021
Clash was incorrectly trying to force the evaluator to evaluate the vector argument of the indexing operator in order to get the special primitive rule for indexing in verilog to fire, while it only needs the index argument to be evaluated to a literal when possible. Fixes #1557
mergify bot
pushed a commit
that referenced
this issue
Jul 31, 2021
Clash was incorrectly trying to force the evaluator to evaluate the vector argument of the indexing operator in order to get the special primitive rule for indexing in verilog to fire, while it only needs the index argument to be evaluated to a literal when possible. Fixes #1557 (cherry picked from commit 5274238)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The file below exposes bad time complexity in the normalization phase of generating VHDL, whereas Verilog is near-instant. With a vector of length 25 as below, the numbers are:
VDHL:
Clash: Normalisation took 3.052s
Verilog:
Clash: Normalisation took 0.027s
More lengths:
VHDL:
Clash: Normalisation took 6.543s
Verilog:
Clash: Normalisation took 0.031s
VHDL:
Clash: Normalisation took 12.721s
Verilog:
Clash: Normalisation took 0.034s
VHDL:
Clash: Normalisation took 22.088s
Verilog:
Clash: Normalisation took 0.037s
This is with CλaSH
master
. Using1.2.4
seems to exhibit the same problem but less pronounced.The text was updated successfully, but these errors were encountered: