Deleted Added
sdiff udiff text old ( 8706:b1838faf3bcc ) new ( 8853:0216ed80991b )
full compact
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 25 unchanged lines hidden (view full) ---

36 *
37 * Authors: Andreas Hansson
38 */
39
40/**
41 * @file
42 * PortProxy Object Declaration.
43 *
44 * Port proxies are used when non-structural entities need access to
45 * the memory system (or structural entities that want to peak into
46 * the memory system without making a real memory access).
47 *
48 * Proxy objects replace the previous FunctionalPort, TranslatingPort
49 * and VirtualPort objects, which provided the same functionality as
50 * the proxies, but were instances of ports not corresponding to real
51 * structural ports of the simulated system. Via the port proxies all
52 * the accesses go through an actual port (either the system port,
53 * e.g. for processes or initialisation, or a the data port of the
54 * CPU, e.g. for threads) and thus are transparent to a potentially
55 * distributed memory and automatically adhere to the memory map of
56 * the system.
57 */
58
59#ifndef __MEM_PORT_PROXY_HH__
60#define __MEM_PORT_PROXY_HH__
61
62#include "config/the_isa.hh"
63#if THE_ISA != NO_ISA
64 #include "arch/isa_traits.hh"
65#endif
66
67#include "mem/port.hh"
68#include "sim/byteswap.hh"
69
70/**
71 * This object is a proxy for a structural port, to be used for debug
72 * accesses.
73 *
74 * This proxy object is used when non structural entities
75 * (e.g. thread contexts, object file loaders) need access to the
76 * memory system. It calls the corresponding functions on the underlying
77 * structural port, and provides templatized convenience access functions.
78 *
79 * The addresses are interpreted as physical addresses.
80 *
81 * @sa SETranslatingProxy
82 * @sa FSTranslatingProxy
83 */
84class PortProxy
85{
86 private:
87
88 /** The actual physical port used by this proxy. */
89 Port &_port;
90
91 void blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd);
92
93 public:
94 PortProxy(Port &port) : _port(port) { }
95 virtual ~PortProxy() { }
96
97 /**
98 * Read size bytes memory at address and store in p.
99 */
100 virtual void readBlob(Addr addr, uint8_t* p, int size)
101 { blobHelper(addr, p, size, MemCmd::ReadReq); }
102
103 /**
104 * Write size bytes from p to address.
105 */
106 virtual void writeBlob(Addr addr, uint8_t* p, int size)
107 { blobHelper(addr, p, size, MemCmd::WriteReq); }
108
109 /**
110 * Fill size bytes starting at addr with byte value val.
111 */
112 virtual void memsetBlob(Addr addr, uint8_t v, int size);
113
114 /**
115 * Read sizeof(T) bytes from address and return as object T.
116 */
117 template <typename T>
118 T read(Addr address);
119
120 /**

--- 59 unchanged lines hidden ---