Copyright | (C) 2015-2016 University of Twente 2017 Google Inc. 2019 Myrtle Software Ltd 2021-2022 QBayLogic B.V. |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | QBayLogic B.V. <devops@qbaylogic.com> |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Extensions |
|
Clash.Prelude.ROM
Description
ROMs
Synopsis
- asyncRom :: (KnownNat n, Enum addr) => Vec n a -> addr -> a
- asyncRomPow2 :: KnownNat n => Vec (2 ^ n) a -> Unsigned n -> a
- rom :: forall dom n m a. (NFDataX a, KnownNat n, KnownNat m, HiddenClock dom, HiddenEnable dom) => Vec n a -> Signal dom (Unsigned m) -> Signal dom a
- romPow2 :: forall dom n a. (KnownNat n, NFDataX a, HiddenClock dom, HiddenEnable dom) => Vec (2 ^ n) a -> Signal dom (Unsigned n) -> Signal dom a
- asyncRom# :: forall n a. KnownNat n => Vec n a -> Int -> a
Asynchronous ROM
Arguments
:: (KnownNat n, Enum addr) | |
=> Vec n a | ROM content, also determines the size, NB: MUST be a constant |
-> addr | Read address |
-> a | The value of the ROM at address |
An asynchronous/combinational ROM with space for n
elements
See also:
- See Clash.Sized.Fixed and Clash.Prelude.BlockRam for ideas on how to use ROMs and RAMs.
- A large
Vec
for the content may be too inefficient, depending on how it is constructed. SeeasyncRomFile
andasyncRomBlob
for different approaches that scale well.
Arguments
:: KnownNat n | |
=> Vec (2 ^ n) a | ROM content NB: MUST be a constant |
-> Unsigned n | Read address |
-> a | The value of the ROM at address |
An asynchronous/combinational ROM with space for 2^n
elements
See also:
- See Clash.Sized.Fixed and Clash.Prelude.BlockRam for ideas on how to use ROMs and RAMs.
- A large
Vec
for the content may be too inefficient, depending on how it is constructed. SeeasyncRomFilePow2
andasyncRomBlobPow2
for different approaches that scale well.
Synchronous ROM synchronized to an arbitrary clock
Arguments
:: forall dom n m a. (NFDataX a, KnownNat n, KnownNat m, HiddenClock dom, HiddenEnable dom) | |
=> Vec n a | ROM content, also determines the size, NB: MUST be a constant |
-> Signal dom (Unsigned m) | Read address |
-> Signal dom a | The value of the ROM at address |
A ROM with a synchronous read port, with space for n
elements
- NB: Read value is delayed by 1 cycle
- NB: Initial output value is undefined, reading it will throw an
XException
See also:
- See Clash.Sized.Fixed and Clash.Prelude.BlockRam for ideas on how to use ROMs and RAMs.
- A large
Vec
for the content may be too inefficient, depending on how it is constructed. SeeromFile
andromBlob
for different approaches that scale well.
Arguments
:: forall dom n a. (KnownNat n, NFDataX a, HiddenClock dom, HiddenEnable dom) | |
=> Vec (2 ^ n) a | ROM content NB: MUST be a constant |
-> Signal dom (Unsigned n) | Read address |
-> Signal dom a | The value of the ROM at address |
A ROM with a synchronous read port, with space for 2^n
elements
- NB: Read value is delayed by 1 cycle
- NB: Initial output value is undefined, reading it will throw an
XException
See also:
- See Clash.Sized.Fixed and Clash.Prelude.BlockRam for ideas on how to use ROMs and RAMs.
- A large
Vec
for the content may be too inefficient, depending on how it is constructed. SeeromFilePow2
andromBlobPow2
for different approaches that scale well.