2006-01-31 18:12:49 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2002-2005 The Regents of The University of Michigan
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
* met: redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer;
|
|
|
|
* redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution;
|
|
|
|
* neither the name of the copyright holders nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived from
|
|
|
|
* this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2006-06-01 01:26:56 +02:00
|
|
|
*
|
|
|
|
* Authors: Ron Dreslinski
|
|
|
|
* Steve Reinhardt
|
|
|
|
* Ali Saidi
|
2006-01-31 18:12:49 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2006-08-15 01:25:07 +02:00
|
|
|
* @file
|
|
|
|
* Declaration of a request, the overall memory request consisting of
|
2006-01-31 18:12:49 +01:00
|
|
|
the parts of the request that are persistent throughout the transaction.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MEM_REQUEST_HH__
|
|
|
|
#define __MEM_REQUEST_HH__
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
#include <cassert>
|
|
|
|
|
2007-06-21 19:50:35 +02:00
|
|
|
#include "base/fast_alloc.hh"
|
2008-11-10 20:51:17 +01:00
|
|
|
#include "base/flags.hh"
|
2008-11-14 08:30:37 +01:00
|
|
|
#include "base/misc.hh"
|
2009-05-17 23:34:50 +02:00
|
|
|
#include "base/types.hh"
|
2007-03-06 20:13:43 +01:00
|
|
|
#include "sim/core.hh"
|
2006-02-15 20:21:09 +01:00
|
|
|
|
|
|
|
class Request;
|
|
|
|
|
|
|
|
typedef Request* RequestPtr;
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
class Request : public FastAlloc
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef uint32_t FlagsType;
|
|
|
|
typedef ::Flags<FlagsType> Flags;
|
|
|
|
|
|
|
|
/** ASI information for this request if it exists. */
|
|
|
|
static const FlagsType ASI_BITS = 0x000000FF;
|
2009-04-23 15:44:32 +02:00
|
|
|
/** The request was an instruction fetch. */
|
|
|
|
static const FlagsType INST_FETCH = 0x00000100;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** The virtual address is also the physical address. */
|
|
|
|
static const FlagsType PHYSICAL = 0x00000200;
|
|
|
|
/** The request is an ALPHA VPTE pal access (hw_ld). */
|
|
|
|
static const FlagsType VPTE = 0x00000400;
|
|
|
|
/** Use the alternate mode bits in ALPHA. */
|
|
|
|
static const FlagsType ALTMODE = 0x00000800;
|
|
|
|
/** The request is to an uncacheable address. */
|
|
|
|
static const FlagsType UNCACHEABLE = 0x00001000;
|
2009-04-23 15:44:32 +02:00
|
|
|
/** This request is to a memory mapped register. */
|
|
|
|
static const FlagsType MMAPED_IPR = 0x00002000;
|
2010-08-23 18:18:41 +02:00
|
|
|
/** This request is a clear exclusive. */
|
2010-10-13 10:57:31 +02:00
|
|
|
static const FlagsType CLEAR_LL = 0x00004000;
|
2009-04-23 15:44:32 +02:00
|
|
|
|
2009-02-25 19:15:34 +01:00
|
|
|
/** The request should not cause a memory access. */
|
2009-04-23 15:44:32 +02:00
|
|
|
static const FlagsType NO_ACCESS = 0x00080000;
|
2009-04-20 07:00:24 +02:00
|
|
|
/** This request will lock or unlock the accessed memory. When used with
|
|
|
|
* a load, the access locks the particular chunk of memory. When used
|
|
|
|
* with a store, it unlocks. The rule is that locked accesses have to be
|
|
|
|
* made up of a locked load, some operation on the data, and then a locked
|
|
|
|
* store.
|
|
|
|
*/
|
2009-04-23 15:44:32 +02:00
|
|
|
static const FlagsType LOCKED = 0x00100000;
|
|
|
|
/** The request is a Load locked/store conditional. */
|
|
|
|
static const FlagsType LLSC = 0x00200000;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** This request is for a memory swap. */
|
2009-04-23 15:44:32 +02:00
|
|
|
static const FlagsType MEM_SWAP = 0x00400000;
|
|
|
|
static const FlagsType MEM_SWAP_COND = 0x00800000;
|
|
|
|
|
2009-04-21 17:17:10 +02:00
|
|
|
/** The request is a prefetch. */
|
|
|
|
static const FlagsType PREFETCH = 0x01000000;
|
2009-04-23 15:44:32 +02:00
|
|
|
/** The request should be prefetched into the exclusive state. */
|
|
|
|
static const FlagsType PF_EXCLUSIVE = 0x02000000;
|
|
|
|
/** The request should be marked as LRU. */
|
|
|
|
static const FlagsType EVICT_NEXT = 0x04000000;
|
2006-06-28 23:28:33 +02:00
|
|
|
|
2009-04-21 03:40:00 +02:00
|
|
|
/** These flags are *not* cleared when a Request object is reused
|
|
|
|
(assigned a new address). */
|
2009-04-21 03:54:02 +02:00
|
|
|
static const FlagsType STICKY_FLAGS = INST_FETCH;
|
2009-04-21 03:40:00 +02:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
private:
|
2009-04-21 03:40:00 +02:00
|
|
|
typedef uint8_t PrivateFlagsType;
|
|
|
|
typedef ::Flags<PrivateFlagsType> PrivateFlags;
|
2007-02-12 19:06:30 +01:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Whether or not the size is valid. */
|
2009-04-21 03:40:00 +02:00
|
|
|
static const PrivateFlagsType VALID_SIZE = 0x00000001;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Whether or not paddr is valid (has been written yet). */
|
2009-04-21 03:40:00 +02:00
|
|
|
static const PrivateFlagsType VALID_PADDR = 0x00000002;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Whether or not the vaddr & asid are valid. */
|
2009-04-21 03:40:00 +02:00
|
|
|
static const PrivateFlagsType VALID_VADDR = 0x00000004;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Whether or not the pc is valid. */
|
2009-04-21 03:40:00 +02:00
|
|
|
static const PrivateFlagsType VALID_PC = 0x00000010;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Whether or not the context ID is valid. */
|
2009-04-21 03:40:00 +02:00
|
|
|
static const PrivateFlagsType VALID_CONTEXT_ID = 0x00000020;
|
|
|
|
static const PrivateFlagsType VALID_THREAD_ID = 0x00000040;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Whether or not the sc result is valid. */
|
2009-04-21 03:40:00 +02:00
|
|
|
static const PrivateFlagsType VALID_EXTRA_DATA = 0x00000080;
|
|
|
|
|
|
|
|
/** These flags are *not* cleared when a Request object is reused
|
|
|
|
(assigned a new address). */
|
|
|
|
static const PrivateFlagsType STICKY_PRIVATE_FLAGS =
|
|
|
|
VALID_CONTEXT_ID | VALID_THREAD_ID;
|
2006-02-15 20:53:02 +01:00
|
|
|
|
2006-04-07 21:54:48 +02:00
|
|
|
private:
|
2006-05-31 06:12:29 +02:00
|
|
|
/**
|
|
|
|
* The physical address of the request. Valid only if validPaddr
|
2008-11-10 20:51:17 +01:00
|
|
|
* is set.
|
|
|
|
*/
|
2009-08-02 07:50:10 +02:00
|
|
|
Addr _paddr;
|
2006-01-31 18:12:49 +01:00
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/**
|
|
|
|
* The size of the request. This field must be set when vaddr or
|
|
|
|
* paddr is written via setVirt() or setPhys(), so it is always
|
2008-11-10 20:51:17 +01:00
|
|
|
* valid as long as one of the address fields is valid.
|
|
|
|
*/
|
2009-08-02 07:50:10 +02:00
|
|
|
int _size;
|
2006-02-15 20:53:02 +01:00
|
|
|
|
2006-04-07 21:54:48 +02:00
|
|
|
/** Flag structure for the request. */
|
2009-08-02 07:50:10 +02:00
|
|
|
Flags _flags;
|
2006-01-31 20:20:39 +01:00
|
|
|
|
2009-04-21 03:40:00 +02:00
|
|
|
/** Private flags for field validity checking. */
|
|
|
|
PrivateFlags privateFlags;
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/**
|
|
|
|
* The time this request was started. Used to calculate
|
|
|
|
* latencies. This field is set to curTick any time paddr or vaddr
|
2008-11-10 20:51:17 +01:00
|
|
|
* is written.
|
|
|
|
*/
|
2009-05-30 00:30:16 +02:00
|
|
|
Tick _time;
|
2006-01-31 20:20:39 +01:00
|
|
|
|
|
|
|
/** The address space ID. */
|
2009-08-02 07:50:10 +02:00
|
|
|
int _asid;
|
2006-11-29 23:11:10 +01:00
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/** The virtual address of the request. */
|
2009-08-02 07:50:10 +02:00
|
|
|
Addr _vaddr;
|
2006-01-31 20:20:39 +01:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/**
|
|
|
|
* Extra data for the request, such as the return value of
|
2007-02-12 19:06:30 +01:00
|
|
|
* store conditional or the compare value for a CAS. */
|
2009-08-02 07:50:10 +02:00
|
|
|
uint64_t _extraData;
|
2006-01-31 18:12:49 +01:00
|
|
|
|
2008-11-03 03:57:07 +01:00
|
|
|
/** The context ID (for statistics, typically). */
|
|
|
|
int _contextId;
|
|
|
|
/** The thread ID (id within this CPU) */
|
|
|
|
int _threadId;
|
2006-01-31 18:12:49 +01:00
|
|
|
|
|
|
|
/** program counter of initiating access; for tracing/debugging */
|
2009-08-02 07:50:10 +02:00
|
|
|
Addr _pc;
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2006-04-07 21:54:48 +02:00
|
|
|
public:
|
2009-08-02 07:50:10 +02:00
|
|
|
/** Minimal constructor. No fields are initialized.
|
|
|
|
* (Note that _flags and privateFlags are cleared by Flags
|
|
|
|
* default constructor.)
|
|
|
|
*/
|
2006-05-31 06:12:29 +02:00
|
|
|
Request()
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor for physical (e.g. device) requests. Initializes
|
|
|
|
* just physical address, size, flags, and timestamp (to curTick).
|
2008-11-10 20:51:17 +01:00
|
|
|
* These fields are adequate to perform a request.
|
|
|
|
*/
|
|
|
|
Request(Addr paddr, int size, Flags flags)
|
|
|
|
{
|
|
|
|
setPhys(paddr, size, flags);
|
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2009-05-30 00:30:16 +02:00
|
|
|
Request(Addr paddr, int size, Flags flags, Tick time)
|
|
|
|
{
|
|
|
|
setPhys(paddr, size, flags, time);
|
|
|
|
}
|
|
|
|
|
2010-01-30 05:29:23 +01:00
|
|
|
Request(Addr paddr, int size, Flags flags, Tick time, Addr pc)
|
|
|
|
{
|
|
|
|
setPhys(paddr, size, flags, time);
|
|
|
|
privateFlags.set(VALID_PC);
|
|
|
|
_pc = pc;
|
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
Request(int asid, Addr vaddr, int size, Flags flags, Addr pc,
|
2009-05-26 18:23:13 +02:00
|
|
|
int cid, ThreadID tid)
|
2006-06-03 00:15:20 +02:00
|
|
|
{
|
2008-11-10 20:51:17 +01:00
|
|
|
setVirt(asid, vaddr, size, flags, pc);
|
2009-04-21 03:40:00 +02:00
|
|
|
setThreadContext(cid, tid);
|
2006-06-03 00:15:20 +02:00
|
|
|
}
|
|
|
|
|
2007-06-21 19:50:35 +02:00
|
|
|
~Request() {} // for FastAlloc
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/**
|
2008-11-10 20:51:17 +01:00
|
|
|
* Set up CPU and thread numbers.
|
|
|
|
*/
|
|
|
|
void
|
2009-05-26 18:23:13 +02:00
|
|
|
setThreadContext(int context_id, ThreadID tid)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2008-11-10 20:51:17 +01:00
|
|
|
_contextId = context_id;
|
2009-05-26 18:23:13 +02:00
|
|
|
_threadId = tid;
|
2009-04-21 03:40:00 +02:00
|
|
|
privateFlags.set(VALID_CONTEXT_ID|VALID_THREAD_ID);
|
2006-05-31 06:12:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set up a physical (e.g. device) request in a previously
|
2008-11-10 20:51:17 +01:00
|
|
|
* allocated Request object.
|
|
|
|
*/
|
|
|
|
void
|
2009-08-02 07:50:10 +02:00
|
|
|
setPhys(Addr paddr, int size, Flags flags, Tick time)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2009-08-02 07:50:10 +02:00
|
|
|
assert(size >= 0);
|
|
|
|
_paddr = paddr;
|
|
|
|
_size = size;
|
2009-05-30 00:30:16 +02:00
|
|
|
_time = time;
|
2008-11-10 20:51:17 +01:00
|
|
|
|
2009-08-02 07:50:10 +02:00
|
|
|
_flags.clear(~STICKY_FLAGS);
|
|
|
|
_flags.set(flags);
|
2009-04-21 03:40:00 +02:00
|
|
|
privateFlags.clear(~STICKY_PRIVATE_FLAGS);
|
|
|
|
privateFlags.set(VALID_PADDR|VALID_SIZE);
|
2006-05-31 06:12:29 +02:00
|
|
|
}
|
|
|
|
|
2009-05-30 00:30:16 +02:00
|
|
|
void
|
2009-08-02 07:50:10 +02:00
|
|
|
setPhys(Addr paddr, int size, Flags flags)
|
2009-05-30 00:30:16 +02:00
|
|
|
{
|
2009-08-02 07:50:10 +02:00
|
|
|
setPhys(paddr, size, flags, curTick);
|
2009-05-30 00:30:16 +02:00
|
|
|
}
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/**
|
|
|
|
* Set up a virtual (e.g., CPU) request in a previously
|
2008-11-10 20:51:17 +01:00
|
|
|
* allocated Request object.
|
|
|
|
*/
|
|
|
|
void
|
2009-08-02 07:50:10 +02:00
|
|
|
setVirt(int asid, Addr vaddr, int size, Flags flags, Addr pc)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2009-08-02 07:50:10 +02:00
|
|
|
assert(size >= 0);
|
|
|
|
_asid = asid;
|
|
|
|
_vaddr = vaddr;
|
|
|
|
_size = size;
|
|
|
|
_pc = pc;
|
2009-05-30 00:30:16 +02:00
|
|
|
_time = curTick;
|
2008-11-10 20:51:17 +01:00
|
|
|
|
2009-08-02 07:50:10 +02:00
|
|
|
_flags.clear(~STICKY_FLAGS);
|
|
|
|
_flags.set(flags);
|
2009-04-21 03:40:00 +02:00
|
|
|
privateFlags.clear(~STICKY_PRIVATE_FLAGS);
|
|
|
|
privateFlags.set(VALID_VADDR|VALID_SIZE|VALID_PC);
|
2006-05-31 06:12:29 +02:00
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/**
|
|
|
|
* Set just the physical address. This should only be used to
|
2006-05-31 06:12:29 +02:00
|
|
|
* record the result of a translation, and thus the vaddr must be
|
|
|
|
* valid before this method is called. Otherwise, use setPhys()
|
|
|
|
* to guarantee that the size and flags are also set.
|
|
|
|
*/
|
2008-11-10 20:51:17 +01:00
|
|
|
void
|
2009-08-02 07:50:10 +02:00
|
|
|
setPaddr(Addr paddr)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_VADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
_paddr = paddr;
|
2009-04-21 03:40:00 +02:00
|
|
|
privateFlags.set(VALID_PADDR);
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
2008-11-14 08:30:37 +01:00
|
|
|
/**
|
|
|
|
* Generate two requests as if this request had been split into two
|
|
|
|
* pieces. The original request can't have been translated already.
|
|
|
|
*/
|
|
|
|
void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2)
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_VADDR));
|
|
|
|
assert(privateFlags.noneSet(VALID_PADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
assert(split_addr > _vaddr && split_addr < _vaddr + _size);
|
2008-11-14 08:30:37 +01:00
|
|
|
req1 = new Request;
|
|
|
|
*req1 = *this;
|
|
|
|
req2 = new Request;
|
|
|
|
*req2 = *this;
|
2009-08-02 07:50:10 +02:00
|
|
|
req1->_size = split_addr - _vaddr;
|
|
|
|
req2->_vaddr = split_addr;
|
|
|
|
req2->_size = _size - req1->_size;
|
2008-11-14 08:30:37 +01:00
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/**
|
|
|
|
* Accessor for paddr.
|
|
|
|
*/
|
2009-04-21 03:40:00 +02:00
|
|
|
bool
|
|
|
|
hasPaddr()
|
|
|
|
{
|
|
|
|
return privateFlags.isSet(VALID_PADDR);
|
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
Addr
|
|
|
|
getPaddr()
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_PADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _paddr;
|
2006-05-31 06:12:29 +02:00
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/**
|
|
|
|
* Accessor for size.
|
|
|
|
*/
|
2009-04-21 03:40:00 +02:00
|
|
|
bool
|
|
|
|
hasSize()
|
|
|
|
{
|
|
|
|
return privateFlags.isSet(VALID_SIZE);
|
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
int
|
|
|
|
getSize()
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_SIZE));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _size;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
|
|
|
/** Accessor for time. */
|
2008-11-10 20:51:17 +01:00
|
|
|
Tick
|
2009-05-30 00:30:16 +02:00
|
|
|
time() const
|
|
|
|
{
|
|
|
|
assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
|
|
|
|
return _time;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
time(Tick time)
|
2008-11-10 20:51:17 +01:00
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
|
2009-05-30 00:30:16 +02:00
|
|
|
_time = time;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Accessor for flags. */
|
|
|
|
Flags
|
|
|
|
getFlags()
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _flags;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
2009-08-02 07:50:13 +02:00
|
|
|
/** Note that unlike other accessors, this function sets *specific
|
|
|
|
flags* (ORs them in); it does not assign its argument to the
|
|
|
|
_flags field. Thus this method should rightly be called
|
|
|
|
setFlags() and not just flags(). */
|
2008-11-10 20:51:17 +01:00
|
|
|
void
|
2009-08-02 07:50:10 +02:00
|
|
|
setFlags(Flags flags)
|
2008-11-10 20:51:17 +01:00
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
_flags.set(flags);
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/** Accessor function for vaddr.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
Addr
|
|
|
|
getVaddr()
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_VADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _vaddr;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
|
|
|
/** Accessor function for asid.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
int
|
|
|
|
getAsid()
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_VADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _asid;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2006-11-23 07:42:57 +01:00
|
|
|
/** Accessor function for asi.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
uint8_t
|
|
|
|
getAsi()
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_VADDR));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _flags & ASI_BITS;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
2006-11-29 23:11:10 +01:00
|
|
|
|
2006-06-06 20:06:30 +02:00
|
|
|
/** Accessor function to check if sc result is valid. */
|
2008-11-10 20:51:17 +01:00
|
|
|
bool
|
|
|
|
extraDataValid()
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
return privateFlags.isSet(VALID_EXTRA_DATA);
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/** Accessor function for store conditional return value.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
uint64_t
|
|
|
|
getExtraData() const
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_EXTRA_DATA));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _extraData;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/** Accessor function for store conditional return value.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
void
|
2009-08-02 07:50:10 +02:00
|
|
|
setExtraData(uint64_t extraData)
|
2008-11-10 20:51:17 +01:00
|
|
|
{
|
2009-08-02 07:50:10 +02:00
|
|
|
_extraData = extraData;
|
2009-04-21 03:40:00 +02:00
|
|
|
privateFlags.set(VALID_EXTRA_DATA);
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2009-03-11 01:37:15 +01:00
|
|
|
bool
|
|
|
|
hasContextId() const
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
return privateFlags.isSet(VALID_CONTEXT_ID);
|
2009-03-11 01:37:15 +01:00
|
|
|
}
|
|
|
|
|
2008-11-03 03:57:07 +01:00
|
|
|
/** Accessor function for context ID.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
int
|
|
|
|
contextId() const
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_CONTEXT_ID));
|
2008-11-10 20:51:17 +01:00
|
|
|
return _contextId;
|
|
|
|
}
|
|
|
|
|
2008-11-03 03:57:07 +01:00
|
|
|
/** Accessor function for thread ID. */
|
2008-11-10 20:51:17 +01:00
|
|
|
int
|
|
|
|
threadId() const
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_THREAD_ID));
|
2008-11-10 20:51:17 +01:00
|
|
|
return _threadId;
|
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2009-02-16 17:56:40 +01:00
|
|
|
bool
|
|
|
|
hasPC() const
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
return privateFlags.isSet(VALID_PC);
|
2009-02-16 17:56:40 +01:00
|
|
|
}
|
|
|
|
|
2009-03-11 01:37:15 +01:00
|
|
|
/** Accessor function for pc.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
Addr
|
|
|
|
getPC() const
|
|
|
|
{
|
2009-04-21 03:40:00 +02:00
|
|
|
assert(privateFlags.isSet(VALID_PC));
|
2009-08-02 07:50:10 +02:00
|
|
|
return _pc;
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
2006-04-07 21:54:48 +02:00
|
|
|
|
2009-08-02 07:50:13 +02:00
|
|
|
/** Accessor functions for flags. Note that these are for testing
|
|
|
|
only; setting flags should be done via setFlags(). */
|
2009-08-02 07:50:10 +02:00
|
|
|
bool isUncacheable() const { return _flags.isSet(UNCACHEABLE); }
|
|
|
|
bool isInstFetch() const { return _flags.isSet(INST_FETCH); }
|
|
|
|
bool isPrefetch() const { return _flags.isSet(PREFETCH); }
|
|
|
|
bool isLLSC() const { return _flags.isSet(LLSC); }
|
|
|
|
bool isLocked() const { return _flags.isSet(LOCKED); }
|
|
|
|
bool isSwap() const { return _flags.isSet(MEM_SWAP|MEM_SWAP_COND); }
|
|
|
|
bool isCondSwap() const { return _flags.isSet(MEM_SWAP_COND); }
|
2009-08-02 07:50:13 +02:00
|
|
|
bool isMmapedIpr() const { return _flags.isSet(MMAPED_IPR); }
|
2010-10-13 10:57:31 +02:00
|
|
|
bool isClearLL() const { return _flags.isSet(CLEAR_LL); }
|
2006-01-31 20:20:39 +01:00
|
|
|
};
|
2006-01-31 18:12:49 +01:00
|
|
|
|
|
|
|
#endif // __MEM_REQUEST_HH__
|