Getting syntax error when going from combinational to sequentional circuits

9 views
Skip to first unread message

Mahshid Shahmohammadian

unread,
May 19, 2021, 1:08:57 PMMay 19
to Clash - Hardware Description Language

Hi,

I just started using Clash and went over the tutorial with the MAC example. When using the mealy machine without type annotation the compiler asks for type annotation, then I just use the type:

mac :: (Pack o, Num o) => (Signal o, Signal o) -> SignalP o
mac = macT <^> 0

Then I get this weird error which I think is related to installation:

Not in scope: type constructor or class ‘Pack’ ,
AND
Not in scope: type constructor or class ‘SignalP’

I have built the same MAC circuit in both linux and mac using stack with option B in the page below: (replaced the Example.Project with MAC source)


Before using the mealy machine it builds but when going sequential this happens. Can you advise me what is going on?

BTW, I have started to work with Clash so I'm going to ask many questions if that's fine with you :)

Thanks,
Mahshid

Rowan Goemans

unread,
May 19, 2021, 1:37:50 PMMay 19
to clash-l...@googlegroups.com
Hi Mahshid,

You are following an incredibly outdated Clash tutorial, those types
don't exist anymore. Please make sure you follow the one for the
version you have.
This is the tutorial for the most recent version:
http://hackage.haskell.org/package/clash-prelude-1.4.2/docs/Clash-Tutorial.html.

Best regards,

Rowan Goemans

Op wo 19 mei 2021 om 19:09 schreef Mahshid Shahmohammadian
<mahshi...@gmail.com>:
> --
> 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/14b33224-82d6-4f5b-8524-3dde983ac4adn%40googlegroups.com.

Christiaan Baaij

unread,
May 20, 2021, 5:09:37 AMMay 20
to clash-l...@googlegroups.com
Hi Mahshid,

As Rowan explained, you seem to be following an older version of a tutorial.
Could you give me the link to the tutorial you have been using so far?

Thanks,

Christiaan

Mahshid Shahmohammadian

unread,
May 20, 2021, 10:44:45 AMMay 20
to clash-l...@googlegroups.com
Hi Christiaan,

Yes, that fixed my issue. I did not notice the version of Clash in the tutorial is much older than the one in the stack.yaml and cabal files. I was using the first google search result for "Clash Haskell tutorial" which was the link below:


Then I switched to the link Rowan sent and everything is going good so far. Thanks for the follow-up.

Regards,
Mahshid



--
Mahshid Shahmohammadian
Ph.D. Candidate
Computer Science Department
Drexel University
Reply all
Reply to author
Forward
0 new messages