Skip to content

Commit 207cb91

Browse files
Merge pull request #2900 from clash-lang/add-nfdatax-simonly
Add `NFDataX (SimOnly a)`
2 parents db19820 + 773ae8d commit 207cb91

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ADDED: Added instance `NFDataX (SimOnly a)`

clash-prelude/src/Clash/Magic.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Refer to "Clash.Annotations.TopEntity" for controlling naming of entities
1717
-}
1818

1919
{-# LANGUAGE CPP #-}
20+
{-# LANGUAGE DeriveAnyClass #-}
2021
{-# LANGUAGE QuasiQuotes #-}
2122
{-# LANGUAGE TemplateHaskellQuotes #-}
2223

@@ -43,13 +44,15 @@ module Clash.Magic
4344
, clashCompileError
4445
) where
4546

47+
import Clash.Annotations.Primitive (Primitive(..), hasBlackBox)
48+
import Clash.NamedTypes ((:::))
49+
import Clash.Promoted.Symbol (SSymbol)
50+
import Clash.XException (NFDataX)
4651
import Data.String.Interpolate (__i)
52+
import GHC.Generics (Generic)
4753
import GHC.Magic (noinline)
4854
import GHC.Stack (HasCallStack, withFrozenCallStack)
49-
import Clash.NamedTypes ((:::))
5055
import GHC.TypeLits (Nat,Symbol)
51-
import Clash.Promoted.Symbol (SSymbol)
52-
import Clash.Annotations.Primitive (Primitive(..), hasBlackBox)
5356

5457
-- | Prefix instance and register names with the given 'Symbol'
5558
prefixName
@@ -272,7 +275,7 @@ clashSimulation = noinline True
272275
-- * Co-simulation state or meta-data
273276
-- * etc.
274277
data SimOnly a = SimOnly a
275-
deriving (Eq, Ord, Foldable, Traversable)
278+
deriving (Generic, Eq, Ord, Foldable, Traversable, NFDataX)
276279
{-# ANN SimOnly hasBlackBox #-}
277280

278281
instance Functor SimOnly where

0 commit comments

Comments
 (0)