forsyde-shallow-3.4.0.0: ForSyDe's Haskell-embedded Domain Specific Language.

Copyright(c) ForSyDe Group KTH 2007-2008
LicenseBSD-style (see the file LICENSE)
Maintainerforsyde-dev@ict.kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

ForSyDe.Shallow.Utility.Memory

Description

This module contains the data structure and access functions for the memory model.

Synopsis

Documentation

data Memory a Source #

The data type Memory is modeled as a vector.

Constructors

Mem Adr (Vector (AbstExt a)) 
Instances
Eq a => Eq (Memory a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Memory

Methods

(==) :: Memory a -> Memory a -> Bool #

(/=) :: Memory a -> Memory a -> Bool #

Show a => Show (Memory a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Memory

Methods

showsPrec :: Int -> Memory a -> ShowS #

show :: Memory a -> String #

showList :: [Memory a] -> ShowS #

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.

Instances
Eq a => Eq (Access a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Memory

Methods

(==) :: Access a -> Access a -> Bool #

(/=) :: Access a -> Access a -> Bool #

Show a => Show (Access a) Source # 
Instance details

Defined in ForSyDe.Shallow.Utility.Memory

Methods

showsPrec :: Int -> Access a -> ShowS #

show :: Access a -> String #

showList :: [Access a] -> ShowS #

type Adr = Int Source #

newMem :: MemSize -> Memory a Source #

The function newMem creates a new memory, where the number of entries is given by a parameter.

memState :: Memory a -> Access a -> Memory a Source #

The function memState gives the new state of the memory, after an access to a memory. A Access operation leaves the memory unchanged.

memOutput :: Memory a -> Access a -> AbstExt a Source #

The function memOutput gives the output of the memory after an access to the memory. A Write operation gives an absent value as output.