OpenASIP 2.2
Loading...
Searching...
No Matches
IdealSRAM.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file IdealSRAM.hh
26 *
27 * Declaration of IdealSRAM class.
28 *
29 * @author Jussi Nykänen 2004 (nykanen-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_IDEAL_SRAM_HH
34#define TTA_IDEAL_SRAM_HH
35
36#include <vector>
37#include <map>
38
39#include "Memory.hh"
40
41class MemoryContents;
42
43/**
44 * Class that models an "ideal" memory.
45 *
46 * An ideal memory is defined as a memory with read latency zero.
47 * The data is available at the same cycle in which the load is initiated.
48 * Also, after a store is initiated, data is written into memory as soon as
49 * the clock advances.
50 *
51 * This implementation uses a "paged array" as the storage structure which
52 * avoids unnecessary allocation while providing O(1) access time. See
53 * PagedArray for more details.
54 */
55class IdealSRAM : public Memory {
56public:
57 IdealSRAM(ULongWord start, ULongWord end, Word MAUSize, bool littleEndian);
58 virtual ~IdealSRAM();
59
60 virtual void write(ULongWord address, MAU data) override;
61 virtual Memory::MAU read(ULongWord address) override;
62
63 using Memory::write;
64 using Memory::read;
65
66 virtual void fillWithZeros();
67
68private:
69 /// Copying not allowed.
71 /// Assignment not allowed.
73
74 /// Starting point of the address space.
76 /// End point of the address space.
78 /// Size of the minimum adressable unit.
80 /// Container for holding read/write requests.
82};
83
84#endif
unsigned long ULongWord
Definition BaseType.hh:51
Word UIntWord
Definition BaseType.hh:144
MemoryContents * data_
Container for holding read/write requests.
Definition IdealSRAM.hh:81
virtual Memory::MAU read(ULongWord address) override
Definition IdealSRAM.cc:96
UIntWord end_
End point of the address space.
Definition IdealSRAM.hh:77
Word MAUSize_
Size of the minimum adressable unit.
Definition IdealSRAM.hh:79
virtual void write(ULongWord address, MAU data) override
Definition IdealSRAM.cc:83
IdealSRAM(const IdealSRAM &)
Copying not allowed.
UIntWord start_
Starting point of the address space.
Definition IdealSRAM.hh:75
virtual ~IdealSRAM()
Definition IdealSRAM.cc:69
IdealSRAM & operator=(const IdealSRAM &)
Assignment not allowed.
virtual void fillWithZeros()
Definition IdealSRAM.cc:107
virtual ULongWord end()
Definition Memory.hh:117
virtual void write(ULongWord address, MAU data)=0
Definition Memory.cc:95
virtual Memory::MAU read(ULongWord address)=0
Definition Memory.cc:160
virtual ULongWord MAUSize()
Definition Memory.hh:118
virtual ULongWord start()
Definition Memory.hh:116
MinimumAddressableUnit MAU
Definition Memory.hh:76