Sample vs simulate behaviour #2029
-
Is this bahaviour expected (notice difference between test1 and test2 output )? Can I use sample to behave as simulate and that output does not start with 2 zeros? import Clash.Prelude
import qualified Prelude as P
test1 = P.take 10 $ sample
$ register @System (0 :: (Signed 5))
$ fromList
$ P.repeat 1
-- test1 == [0,0,1,1,1,1,1,1,1,1]
test2 = P.take 10 $ simulate
( register @System (0 :: (Signed 5)))
$ P.repeat 1
-- test2 == [0,1,1,1,1,1,1,1,1,1] My version is 1.4.2. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, insofar as that the documentation of sample says:
Documentation of simulate:
(It does look like the Haddock is missing this simulate documentation for some reason.)
No, insofar as that you didn't expect it, and I think it's a bit of a wart to have them behave differently.
Yes, use |
Beta Was this translation helpful? Give feedback.
Yes, insofar as that the documentation of sample says:
Documentation of simulate: