On 7 Jun 2021, at 15:35, L Bollen <luuc...@gmail.com> wrote:
Dear Devs,
I encountered a bug in the clash compiler that generates signals with illegal characters(namely * from the <*> function, see attached figure).
<bugReport.png>Code to reproduce this problem below:module BugReport whereimport Clash.Preludeimport qualified Clash.Signal.Delayed.Bundle as Dtype Clk = Clock Systemtype Rst = Reset Systemtype Sig = Signal Systeminfixl 4 <<*>>(<<*>>) :: (Applicative f, Applicative g) => f (g (a -> b)) -> f (g a) -> f (g b)(<<*>>) = liftA2 (<*>)infixl 4 <<$>>(<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)(<<$>>) = fmap . fmaptopEntity :: Clk -> Rst -> DSignal System 0 (Maybe (Signed 8),Maybe (Signed 8)) -> DSignal System 5 (Maybe Bool)topEntity clk rst input = exposeClockResetEnable (checkConditions2 a b) clk rst enableGenwhere(a,b) = D.unbundle inputcheckConditions2 :: HiddenClockResetEnable dom => DSignal dom 0 (Maybe (Signed 8)) -> DSignal dom 0 (Maybe (Signed 8)) -> DSignal dom 5 (Maybe Bool)checkConditions2 i ad = (&&) <<$>> (delayedI (Just False) inBounds) <<*>> adInrangewhereinBounds = (\i -> i>=0 && i < 100) <<$>> iadInrange = (delayN d5 Nothing $ (>) <<$>> (pure $ Just $ 12) <<*>> ad){-# NOINLINE checkConditions2 #-}
--
You received this message because you are subscribed to the Google Groups "Clash - Hardware Description Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clash-languag...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clash-language/64de6213-3b8d-4dc1-ba12-2414de9e08f8n%40googlegroups.com.
<bugReport.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/clash-language/660170c6-910f-4fa2-9f93-6e71812bd358n%40googlegroups.com.
It occurs to me maybe I should be clearer on this point for readers. The contents / format of the file are the same, but the extension is different. This was motivated by the fact that the format is not spec-compliant JSON (as JSON does not allow line breaks in strings, which is how the templates are typically written for clarity). It also means that Clash won't try and load JSON files which are in a project directory but are not primitives / black boxes. So migrating is simply a case of changing the file extension.
To view this discussion on the web visit https://groups.google.com/d/msgid/clash-language/a52aa5e1-ca03-4960-b2c9-25afd2a00465n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Clash - Hardware Description Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clash-language/mBSy3HKyoRA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clash-languag...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clash-language/deb4019d-8578-4884-9b7c-8e6fcf6005e7n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clash-language/CABzw7bUZFRBf8rHhEoV%2B9sDuDPkaz9-b-wE0emJsSj4uRPvKDg%40mail.gmail.com.