request.hh revision 2395
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/**
30 * @file Decleration of a request, the overall memory request consisting of
31 the parts of the request that are persistent throughout the transaction.
32 */
33
34#ifndef __MEM_REQUEST_HH__
35#define __MEM_REQUEST_HH__
36
37#include "targetarch/isa_traits.hh"
38
39class Request;
40class CpuRequest;
41
42typedef Request* RequestPtr;
43typedef CpuRequest* CpuRequestPtr;
44
45/** The request is a Load locked/store conditional. */
46const unsigned LOCKED		= 0x001;
47/** The virtual address is also the physical address. */
48const unsigned PHYSICAL		= 0x002;
49/** The request is an ALPHA VPTE pal access (hw_ld). */
50const unsigned VPTE		= 0x004;
51/** Use the alternate mode bits in ALPHA. */
52const unsigned ALTMODE		= 0x008;
53/** The request is to an uncacheable address. */
54const unsigned UNCACHEABLE	= 0x010;
55/** The request should not cause a page fault. */
56const unsigned NO_FAULT         = 0x020;
57
58class Request
59{
60    //@todo Make Accesor functions, make these private.
61  public:
62    /** The physical address of the request. */
63    Addr paddr;
64
65    /** whether this req came from the CPU or not  **DO we need this??***/
66    bool nicReq;
67
68    /** The size of the request. */
69    int size;
70
71    /** The time this request was started. Used to calculate latencies. */
72    Tick time;
73
74    /** Destination address if this is a block copy. */
75    Addr copyDest;
76
77    uint32_t flags;
78};
79
80class CpuRequest : public Request
81{
82    //@todo Make Accesor functions, make these private.
83  public:
84    /** The virtual address of the request. */
85    Addr vaddr;
86
87    /** The address space ID. */
88    int asid;
89
90    /** The return value of store conditional. */
91    uint64_t scResult;
92
93    /** The cpu number for statistics. */
94    int cpuNum;
95
96    /** The requesting  thread id. */
97    int  threadNum;
98
99    /** program counter of initiating access; for tracing/debugging */
100    Addr pc;
101};
102
103#endif // __MEM_REQUEST_HH__
104