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
importClash.Prelude-- topEntity :: Clock "System" -> Reset "System" -> Signal System Bool -> Signal System Bool
topEntity clk rst = withClockResetEnable clk rst enableGen $ mealy @System f False
f s x = (x,s)
In comments is the inferred type for topEntity.
If this is uncommented everything works correctly.
When left commented it will still type check and simulate fine in clashi.
But when generating HDL clash will trip over some leftover type magic from the multiple hidden clocks and/or the associated custom type errors: Can't translate domain tagType.Errors.IfStuck8214565720323842538 ...
Full error:
NamingClashes.hs:4:1: error:
Clash.Netlist.Util(796): Can't translate domain tagType.Errors.IfStuck8214565720323842538
Clash.Class.HasDomain.HasSingleDomain.TryDomainResult8214565720323844496
GHC.Types.Symbol3674937295934325066
(Clash.Class.HasDomain.HasSingleDomain.TryDomain8214565720323844495
(Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744
-> Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744)
(Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744
-> Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744))
(GHC.TypeLits.TypeError3674937295934325088
GHC.Types.Symbol3674937295934325066
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.Text3891110078048108694
"Could not determine whether the following type contained a non-ambiguous domain:")
(GHC.TypeLits.Text3891110078048108694
""))
(GHC.TypeLits.:<>:3891110078048108697
(GHC.TypeLits.Text3891110078048108694
" ")
(GHC.TypeLits.ShowType3891110078048108703
(GHC.Prim.TYPE3674937295934324912
GHC.Types.LiftedRep3891110078048108766)
(Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744
-> Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744))))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694
"In the full type:"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.:<>:3891110078048108697
(GHC.TypeLits.Text3891110078048108694 " ")
(GHC.TypeLits.ShowType3891110078048108703
(GHC.Prim.TYPE3674937295934324912
GHC.Types.LiftedRep3891110078048108766)
(Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744
-> Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744))))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694
"Does it contain one?"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694 "------"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.Text3891110078048108694
"This might happen if an instance for TryDomain is missing. Try to determine")
(GHC.TypeLits.Text3891110078048108694
"which of the types miss an instance, and add them. Example implementations:"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694
" * type instance TryDomain t (MyVector n a) = TryDomain t a"))
(GHC.TypeLits.Text3891110078048108694
" * type instance TryDomain t (MyCircuit dom a) = Found dom"))
(GHC.TypeLits.Text3891110078048108694
" * type instance TryDomain t Terminal = NotFound"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694
"Alternatively, use one of the withSpecific* functions.")))
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.:$$:3891110078048108700
(GHC.TypeLits.Text3891110078048108694
"")
(GHC.TypeLits.Text3891110078048108694
"------"))
(GHC.TypeLits.Text3891110078048108694
""))
(GHC.TypeLits.Text3891110078048108694
"You tried to apply an explicitly routed clock, reset, or enable line"))
(GHC.TypeLits.Text3891110078048108694
"to a construct with, possibly, an implicitly routed one. Clash failed to"))
(GHC.TypeLits.Text3891110078048108694
"unambigously determine a single domain and could therefore not route it."))
(GHC.TypeLits.Text3891110078048108694
"You possibly used one of these sets of functions:"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694
" * with{ClockResetEnable,Clock,Reset,Enable}"))
(GHC.TypeLits.Text3891110078048108694
" * expose{ClockResetEnable,Clock,Reset,Enable}"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694
"These functions are suitable for components defined over a single domain"))
(GHC.TypeLits.Text3891110078048108694
"only. If you want to use multiple domains, use the following instead:"))
(GHC.TypeLits.Text3891110078048108694 ""))
(GHC.TypeLits.Text3891110078048108694
" * withSpecific{ClockResetEnable,Clock,Reset,Enable}"))
(GHC.TypeLits.Text3891110078048108694
" * exposeSpecific{ClockResetEnable,Clock,Reset,Enable}"))
(GHC.TypeLits.Text3891110078048108694 ""))))
(Fcf.Combinators.Pure8214565720323842537
GHC.Types.Symbol3674937295934325066
(Clash.Class.HasDomain.HasSingleDomain.ErrOnConflict8214565720323844488
(Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744
-> Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744)
(Clash.Class.HasDomain.HasSingleDomain.TryDomain8214565720323844495
(Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744
-> Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744)
(Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744
-> Clash.Signal.Internal.Signal8214565720323789597
"System"
GHC.Types.Bool3674937295934324744))))
NB: The source location of the error is not exact, only indicative, as it is acquired after optimisations.
The actual location of the error can be in a function that is inlined.
To prevent inlining of those functions, annotate them with a NOINLINE pragma.
|
4 | topEntity clk rst = withClockResetEnable clk rst enableGen $ mealy @System f False
| ^^^^^^^^^
The text was updated successfully, but these errors were encountered:
In comments is the inferred type for
topEntity
.If this is uncommented everything works correctly.
When left commented it will still type check and simulate fine in clashi.
But when generating HDL clash will trip over some leftover type magic from the multiple hidden clocks and/or the associated custom type errors:
Can't translate domain tagType.Errors.IfStuck8214565720323842538 ...
Full error:
The text was updated successfully, but these errors were encountered: