clash-prelude-0.6.0.1: CAES Language for Synchronous Hardware - Prelude library

Safe HaskellNone
LanguageHaskell2010

CLaSH.Sized.Internal.Index

Contents

Synopsis

Datatypes

newtype Index n Source

Arbitrary-bounded unsigned integer represented by ceil(log_2(n)) bits.

Given an upper bound n, an Index n number has a range of: [0 .. n-1]

Constructors

I

The constructor, I, and the field, unsafeToInteger, are not synthesisable.

Instances

KnownNat n => Bounded (Index n) 
KnownNat n => Enum (Index n)

The functions: enumFrom, enumFromThen, enumFromTo, and enumFromThenTo, are not synthesisable.

Eq (Index n) 
KnownNat n => Integral (Index n) 
KnownNat n => Num (Index n)

Operators report an error on overflow and underflow

Ord (Index n) 
KnownNat n => Real (Index n) 
Show (Index n) 
KnownNat n => Default (Index n) 
KnownNat n => Lift (Index n) 
Bundle (Index n) 
Typeable (Nat -> *) Index 
type Unbundled clk (Index n) = CSignal clk (Index n) 

Type classes

Eq

eq# :: Index n -> Index n -> Bool Source

neq# :: Index n -> Index n -> Bool Source

Ord

lt# :: Index n -> Index n -> Bool Source

ge# :: Index n -> Index n -> Bool Source

gt# :: Index n -> Index n -> Bool Source

le# :: Index n -> Index n -> Bool Source

Enum (not synthesisable)

enumFromTo# :: KnownNat n => Index n -> Index n -> [Index n] Source

enumFromThenTo# :: KnownNat n => Index n -> Index n -> Index n -> [Index n] Source

Bounded

Num

(+#) :: KnownNat n => Index n -> Index n -> Index n Source

(-#) :: KnownNat n => Index n -> Index n -> Index n Source

(*#) :: KnownNat n => Index n -> Index n -> Index n Source

Integral

quot# :: KnownNat n => Index n -> Index n -> Index n Source

rem# :: KnownNat n => Index n -> Index n -> Index n Source

mod# :: KnownNat n => Index n -> Index n -> Index n Source