Remove Enable Signal from Generated HDL #2425
Answered
by
rowanG077
ThePerfectComputer
asked this question in
Q&A
-
I have the following haskell code which when lowered to Verilog, will leave the enable signal unconnected(using exposeEnable), but how can I eliminate it entirely from the netlist? module Example.Blinky(topEntity, main) where
import Clash.Prelude
blinky :: HiddenClockResetEnable dom => Signal dom (BitVector 1)
blinky = register 0 (fmap toggle curr_state)
where curr_state = blinky
toggle state = case state of
0 -> 1
1 -> 0
_ -> 0
sim_results = sampleN @System 4 blinky
topEntity ::
HiddenClockResetEnable System => Signal System (BitVector 1)
topEntity =
exposeEnable blinky enableGen
main :: IO ()
main = do
putStrLn "Simulating Blinky"
putStrLn $ show sim_results |
Beta Was this translation helpful? Give feedback.
Answered by
rowanG077
Feb 21, 2023
Replies: 1 comment 1 reply
-
Your topEntity ::
Clock System -> Reset System -> Signal System (BitVector 1)
topEntity clk rst = exposeClockResetEnable blinky clk rst enableGen This should rid it of any enable signals. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ThePerfectComputer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your
TopEntity
still has an unused enable as an input because it still hasHidden*Enable
. Generally I don't use hidden arguments on thetopEntity
. So for you I would write it like this:This should rid it of any enable signals.