request.hh revision 2423
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 "arch/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/** The request should be prefetched into the exclusive state. */
58const unsigned PF_EXCLUSIVE	= 0x100;
59/** The request should be marked as LRU. */
60const unsigned EVICT_NEXT	= 0x200;
61
62class Request
63{
64    //@todo Make Accesor functions, make these private.
65  public:
66    /** The physical address of the request. */
67    Addr paddr;
68
69    /** whether this req came from the CPU or not  **DO we need this??***/
70    bool nicReq;
71
72    /** The size of the request. */
73    int size;
74
75    /** The time this request was started. Used to calculate latencies. */
76    Tick time;
77
78    /** Destination address if this is a block copy. */
79    Addr copyDest;
80
81    uint32_t flags;
82};
83
84class CpuRequest : public Request
85{
86    //@todo Make Accesor functions, make these private.
87  public:
88    /** The virtual address of the request. */
89    Addr vaddr;
90
91    /** The address space ID. */
92    int asid;
93
94    /** The return value of store conditional. */
95    uint64_t scResult;
96
97    /** The cpu number for statistics. */
98    int cpuNum;
99
100    /** The requesting  thread id. */
101    int  threadNum;
102
103    /** program counter of initiating access; for tracing/debugging */
104    Addr pc;
105};
106
107#endif // __MEM_REQUEST_HH__
108