You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With clash-ghc-1.8.0 and GHC 9.2.8, a simple entity using my axi-register package builds fine when built in conjunction with axi-register in a single compilation:
$ clash --vhdl Test.hs -isrc -XRecordWildCards -XUndecidableInstances
GHC: Setting up GHC took: 0.567s
GHC: Compiling and loading modules took: 3.945s
Clash: Parsing and compiling primitives took 0.160s
GHC+Clash: Loading modules cumulatively took 7.201s
Clash: Compiling CDAS.topEntity
Clash: Normalization took 0.002s
Clash: Netlist generation took 0.000s
Clash: Compiling CDAS.topEntity took 0.012s
Clash: Total compilation took 7.214s
However, if we use Cabal to build axi-register and then compile the same testcase using the unfoldings contained in the interface files we have the following error:
$ clash --vhdl Test.hs
GHC: Setting up GHC took: 0.514s
GHC: Compiling and loading modules took: 1.324s
Clash: Parsing and compiling primitives took 0.138s
GHC+Clash: Loading modules cumulatively took 2.071s
Clash: Compiling CDAS.topEntity
Clash: Normalization took 0.010s
<no location info>: error:
Clash error call:
Clash.Netlist(1041): Under-applied constructor
CallStack (from HasCallStack):
error, called at src/Clash/Netlist.hs:1041:17 in clash-lib-1.8.0-K7LaVRc69b66OfA18pqV2I:Clash.Netlist
mkDcApplication, called at src/Clash/Netlist.hs:863:16 in clash-lib-1.8.0-K7LaVRc69b66OfA18pqV2I:Clash.Netlist
mkExpr, called at src/Clash/Netlist.hs:450:30 in clash-lib-1.8.0-K7LaVRc69b66OfA18pqV2I:Clash.Netlist
mkDeclarations', called at src/Clash/Netlist.hs:409:18 in clash-lib-1.8.0-K7LaVRc69b66OfA18pqV2I:Clash.Netlist
mkDeclarations, called at src/Clash/Netlist.hs:284:40 in clash-lib-1.8.0-K7LaVRc69b66OfA18pqV2I:Clash.Netlist
genComponentT, called at src/Clash/Netlist.hs:247:41 in clash-lib-1.8.0-K7LaVRc69b66OfA18pqV2I:Clash.Netlist
genComponent, called at src/Clash/Netlist.hs:125:9 in clash-lib-1.8.0-K7LaVRc69b66OfA18pqV2I:Clash.Netlist
$ git clone https://git.smart-cactus.org/ben/axi-register
$ cd axi-register
$ git checkout repro
$ nix develop ".#develop"# This will provide an environment with `clash-ghc`, `axi-register`, and its dependencies
$ clash --vhdl Test.hs # this works
$ clash --vhdl Test.hs -isrc -XRecordWildCards -XUndecidableInstances # This will fail
The text was updated successfully, but these errors were encountered:
I have minimized the issue quite significantly. The data constructor in question here appears to be Clash.Signal.Internal.(:-), which appears to be mentioned a few places in the "bad" case yet not at all in the "good". Given that :- isn't synthesizable, is it expected that it appear in programs compiled by Clash?
It appears that bundle in the example is being worker-wrapper'd. Perhaps this is the reason?
I can confirm that -fno-worker-worker avoids the issue. I have also seen that clash-cores disables worker-wrapper. Is this recommended practice? If so, it should probably be documented a bit more prominently.
With
clash-ghc-1.8.0
and GHC 9.2.8, a simple entity using myaxi-register
package builds fine when built in conjunction withaxi-register
in a single compilation:However, if we use
Cabal
to buildaxi-register
and then compile the same testcase using the unfoldings contained in the interface files we have the following error:This is very reminiscent of #2628
Reproducing
The text was updated successfully, but these errors were encountered: