Closed lmbollen closed 9 months ago
I think it's a bug if the starter project doesn't enable by default the extensions that we enable by default for compiling with clash
. If I understand correctly, that would mean using clash
directly accepts more or different stuff than using a starter project, which if anything is the reverse of what we want.
Also, I'm working on a PR where for use inside clash-compiler
, we enable all extensions that are GHC2021 blessed. I think it would also be okay to enable them all by default for Clash designs as well.
Note your example is slightly flawed in that instead of HiddenClockResetEnable System
you can actually write SystemClockResetEnable
;-). But if you replace all occurences of System
by XilinxSystem
then your point stands. Or any other domain for that matter.
I'm looking into the GHC2021 extensions, there are some we don't want such as StarIsType
(we already have NoStarIsType
enabled so that checks out) since using StarIsType
breaks type level multiplication.
Furthermore using NamedWildCards
causes errors in bittide without enabling PartialTypeSignatures
. Specifically in combination with the circuit-notation
plugin for circuits that are ignored.
I don't think just enabling the GHC2021 blessed extensions is a great idea and we should just see what encounter and selectively enable extensions based on that.
A quick search in bittide shows that we enable the following extensions commonly on a per module basis:
RecordWildCards
NamedFieldPuns
FlexibleContexts
(I'm personally guilty of introducing most of those) I'd prefer just adding those.
Solved by #33
When creating for example a small counter:
counter
already requires a domain to be sampled. If you´d want to make this a counter forSystem
. You can´t make the type simplySignal System (Unsigned 8)
becauseregister
requiresHiddenClockResetEnable dom
.For
System
, you now have to explicitly supplyHiddenClockResetEnable System
, which you can't becauseFlexibleContexts
is not enabled by default. Now the user must also figure out whatLANGUAGE
pragmas are and how to setFlexibleContexts
.I think all these steps introduce a lot of friction and our template projects should maybe show how to deal with more of these situations.