11{-# LANGUAGE NoImplicitPrelude #-}
22{-# LANGUAGE DataKinds #-}
3+ {-# LANGUAGE DeriveAnyClass #-}
4+ {-# LANGUAGE DeriveGeneric #-}
35{-# LANGUAGE ScopedTypeVariables #-}
46{-# LANGUAGE TypeOperators #-}
57{-# LANGUAGE ViewPatterns #-}
@@ -28,7 +30,7 @@ vectorMux vf = mux (fromStrobe <$> vf) (pure $ pack $ NotLit $ Call 1)
2830-- space. They are disabled when an interrupt occurs. Currently, there is no
2931-- way to disable interrupts programatically.
3032singleIrqController
31- :: (HasClockReset d g s )
33+ :: (HiddenClockResetEnable d )
3234 => Signal d Bool -- ^ Interrupt input, active high, level-sensitive.
3335 -> Signal d Bool -- ^ CPU fetch signal, active high.
3436 -> Signal d (Maybe (BitVector 1 , Maybe Cell )) -- ^ I/O bus request.
@@ -67,7 +69,7 @@ data SIS = SIS
6769 , sisEnter :: Bool
6870 -- ^ Interrupt entry event strobe. Goes high on the cycle when a fetch
6971 -- is being replaced by a vector.
70- } deriving (Show )
72+ } deriving (Show , Generic , NFDataX )
7173
7274instance Default SIS where def = SIS False False
7375
@@ -96,7 +98,7 @@ instance Default SIS where def = SIS False False
9698-- interrupt. On writes, zero bits are ignored. Reads as the interrupt
9799-- enable mask (the same as IRQSE).
98100multiIrqController
99- :: (HasClockReset d g s )
101+ :: (HiddenClockResetEnable d )
100102 => Vec Width (Signal d Bool )
101103 -- ^ Interrupt inputs, active high, level-sensitive.
102104 -> Signal d Bool -- ^ CPU fetch signal, active high.
@@ -123,7 +125,7 @@ multiIrqController irqS fetchS reqS = (vfaS, vfdS, eiS, respS)
123125 -- Any write to the enable-trigger register enables.
124126 Just (0 , Just _) -> True
125127 -- The bottom bit of writes @ 1 gets copied into the enable bit.
126- Just (1 , Just v) -> unpack $ lsb v
128+ Just (1 , Just v) -> bitCoerce $ lsb v
127129 -- Anything else leaves matters unchanged.
128130 _ -> misEn s
129131
@@ -154,7 +156,7 @@ data MIS = MIS
154156 -- ^ Individual interrupt enable flags.
155157 , misEnter :: Bool
156158 -- ^ Vector fetch flag. Set during the cycle where we intercede in fetch.
157- } deriving (Show )
159+ } deriving (Show , Generic , NFDataX )
158160
159161instance Default MIS where
160162 def = MIS False (repeat False ) (repeat False ) False
0 commit comments