ForSyDe-3.0: ForSyDe's Haskell-embedded Domain Specific Language.Source codeContentsIndex
ForSyDe.Shallow.Memory
Portabilityportable
Stabilityexperimental
Maintainerforsyde-dev@ict.kth.se
Description
This module contains the data structure and access functions for the memory model.
Synopsis
data Memory a = Mem Adr (Vector (AbstExt a))
data Access a
= Read Adr
| Write Adr a
type MemSize = Int
type Adr = Int
newMem :: MemSize -> Memory a
memState :: Memory a -> Access a -> Memory a
memOutput :: Memory a -> Access a -> AbstExt a
Documentation
data Memory a Source
The data type Memory is modeled as a vector.
Constructors
Mem Adr (Vector (AbstExt a))
show/hide Instances
Eq a => Eq (Memory a)
Show a => Show (Memory a)
data Access a Source
The data type Access defines two access patterns.
Constructors
Read Adr'Read adr' reads an address from the memory.
Write Adr a'Write Adr a' writes a value into an address.
show/hide Instances
Eq a => Eq (Access a)
Show a => Show (Access a)
type MemSize = IntSource
type Adr = IntSource
newMem :: MemSize -> Memory aSource
The function newMem creates a new memory, where the number of entries is given by a parameter.
memState :: Memory a -> Access a -> Memory aSource
The function memState gives the new state of the memory, after an access to a memory. A Read operation leaves the memory unchanged.
memOutput :: Memory a -> Access a -> AbstExt aSource
The function memOutput gives the output of the memory after an access to the memory. A Write operation gives an absent value as output.
Produced by Haddock version 2.1.0