OpenASIP 2.2
Loading...
Searching...
No Matches
RemoteMemory.hh
Go to the documentation of this file.
1/*
2 This file is part of TTA-Based Codesign Environment (TCE).
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23/**
24 * @file RemoteMemory.hh
25 *
26 * Declaration of RemoteMemory class.
27 *
28 * @author Kalle Raiskila 2013
29 */
30
31#ifndef TTA_REMOTE_MEMORY_H
32#define TTA_REMOTE_MEMORY_H
33
34#include "Memory.hh"
35#include "RemoteController.hh"
36#include "AddressSpace.hh"
37
39
40/**
41 * RemoteMemory is a proxy class for a physical memory.
42 *
43 * This class adapts a physical memory on a FPGA or ASIC,
44 * as seen through a debug interface, to the main TCE system.
45 * The RemoteMemory is used only in the Simulator parts of TCE.
46 * All accesses to the physical memories RemoteMemory objects do
47 * go through the RemoteController that implements the debugging
48 * interface.
49 */
50class RemoteMemory : public Memory {
51public:
52 // TODO: hoist AddressSpace-based constructor to parent class?
53 RemoteMemory(const AddressSpace &space, bool littleEndian) :
54 Memory(space.start(), space.end(), space.width(), littleEndian),
55 controller_(NULL), addressspace_(space) {}
56
57 /**
58 * Set SimulationController for memory.
59 *
60 * The RemoteMemory accesses physical memories via this controller object.
61 */
63 controller_ = con;
64 }
65
66 // overload the pure viruals of Memory
67 virtual void write(ULongWord address, MAU data) override;
68 virtual Memory::MAU read(ULongWord address) override;
69
70private:
73
74};
75
76#endif
unsigned long ULongWord
Definition BaseType.hh:51
MinimumAddressableUnit MAU
virtual ULongWord end()
Definition Memory.hh:117
virtual ULongWord start()
Definition Memory.hh:116
MinimumAddressableUnit MAU
Definition Memory.hh:76
const AddressSpace & addressspace_
void setController(RemoteController *con)
RemoteController * controller_
RemoteMemory(const AddressSpace &space, bool littleEndian)