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"
|
2006-08-15 11:07:15 +02:00
|
|
|
#include "sim/host.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
|
|
|
|
{
|
2008-11-14 13:55:30 +01:00
|
|
|
friend class Packet;
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
public:
|
|
|
|
typedef uint32_t FlagsType;
|
|
|
|
typedef ::Flags<FlagsType> Flags;
|
|
|
|
|
|
|
|
/** ASI information for this request if it exists. */
|
|
|
|
static const FlagsType ASI_BITS = 0x000000FF;
|
|
|
|
/** The request is a Load locked/store conditional. */
|
2009-04-19 13:25:01 +02:00
|
|
|
static const FlagsType LLSC = 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;
|
|
|
|
/** The request should not cause a page fault. */
|
|
|
|
static const FlagsType NO_FAULT = 0x00002000;
|
2009-02-25 19:15:34 +01:00
|
|
|
/** The request should not cause a memory access. */
|
|
|
|
static const FlagsType NO_ACCESS = 0x00004000;
|
2008-11-10 20:51:17 +01:00
|
|
|
/** The request should be prefetched into the exclusive state. */
|
|
|
|
static const FlagsType PF_EXCLUSIVE = 0x00010000;
|
|
|
|
/** The request should be marked as LRU. */
|
|
|
|
static const FlagsType EVICT_NEXT = 0x00020000;
|
|
|
|
/** The request should ignore unaligned access faults */
|
|
|
|
static const FlagsType NO_ALIGN_FAULT = 0x00040000;
|
|
|
|
/** The request was an instruction read. */
|
|
|
|
static const FlagsType INST_READ = 0x00080000;
|
|
|
|
/** This request is for a memory swap. */
|
|
|
|
static const FlagsType MEM_SWAP = 0x00100000;
|
|
|
|
static const FlagsType MEM_SWAP_COND = 0x00200000;
|
|
|
|
/** The request should ignore unaligned access faults */
|
|
|
|
static const FlagsType NO_HALF_WORD_ALIGN_FAULT = 0x00400000;
|
|
|
|
/** This request is to a memory mapped register. */
|
|
|
|
static const FlagsType MMAPED_IPR = 0x00800000;
|
2006-06-28 23:28:33 +02:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
private:
|
|
|
|
static const FlagsType PUBLIC_FLAGS = 0x00FF3FFF;
|
|
|
|
static const FlagsType PRIVATE_FLAGS = 0xFF000000;
|
2007-02-12 19:06:30 +01:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Whether or not the size is valid. */
|
|
|
|
static const FlagsType VALID_SIZE = 0x01000000;
|
|
|
|
/** Whether or not paddr is valid (has been written yet). */
|
|
|
|
static const FlagsType VALID_PADDR = 0x02000000;
|
|
|
|
/** Whether or not the vaddr & asid are valid. */
|
|
|
|
static const FlagsType VALID_VADDR = 0x04000000;
|
|
|
|
/** Whether or not the pc is valid. */
|
|
|
|
static const FlagsType VALID_PC = 0x10000000;
|
|
|
|
/** Whether or not the context ID is valid. */
|
|
|
|
static const FlagsType VALID_CONTEXT_ID = 0x20000000;
|
|
|
|
static const FlagsType VALID_THREAD_ID = 0x40000000;
|
|
|
|
/** Whether or not the sc result is valid. */
|
|
|
|
static const FlagsType VALID_EXTRA_DATA = 0x80000000;
|
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.
|
|
|
|
*/
|
2006-01-31 18:12:49 +01:00
|
|
|
Addr paddr;
|
|
|
|
|
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.
|
|
|
|
*/
|
2006-01-31 18:12:49 +01:00
|
|
|
int size;
|
2006-02-15 20:53:02 +01:00
|
|
|
|
2006-04-07 21:54:48 +02:00
|
|
|
/** Flag structure for the request. */
|
2008-11-10 20:51:17 +01:00
|
|
|
Flags flags;
|
2006-01-31 20:20:39 +01:00
|
|
|
|
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.
|
|
|
|
*/
|
2006-05-31 06:12:29 +02:00
|
|
|
Tick time;
|
2006-01-31 20:20:39 +01:00
|
|
|
|
|
|
|
/** The address space ID. */
|
|
|
|
int asid;
|
2006-11-29 23:11:10 +01:00
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/** The virtual address of the request. */
|
|
|
|
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. */
|
|
|
|
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 */
|
|
|
|
Addr pc;
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2006-04-07 21:54:48 +02:00
|
|
|
public:
|
2006-05-31 06:12:29 +02:00
|
|
|
/** Minimal constructor. No fields are initialized. */
|
|
|
|
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
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
Request(int asid, Addr vaddr, int size, Flags flags, Addr pc,
|
|
|
|
int cid, int tid)
|
2006-06-03 00:15:20 +02:00
|
|
|
{
|
2008-11-10 20:51:17 +01:00
|
|
|
setThreadContext(cid, tid);
|
|
|
|
setVirt(asid, vaddr, size, flags, pc);
|
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
|
|
|
|
setThreadContext(int context_id, int thread_id)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2008-11-10 20:51:17 +01:00
|
|
|
_contextId = context_id;
|
|
|
|
_threadId = thread_id;
|
|
|
|
flags.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
|
|
|
|
setPhys(Addr _paddr, int _size, Flags _flags)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2008-11-10 23:11:07 +01:00
|
|
|
assert(_size >= 0);
|
2006-05-31 06:12:29 +02:00
|
|
|
paddr = _paddr;
|
|
|
|
size = _size;
|
|
|
|
time = curTick;
|
2008-11-10 20:51:17 +01:00
|
|
|
|
|
|
|
flags.set(VALID_PADDR|VALID_SIZE);
|
|
|
|
flags.clear(VALID_VADDR|VALID_PC|VALID_EXTRA_DATA|MMAPED_IPR);
|
|
|
|
flags.update(_flags, PUBLIC_FLAGS);
|
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
|
|
|
|
setVirt(int _asid, Addr _vaddr, int _size, Flags _flags, Addr _pc)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2008-11-10 23:11:07 +01:00
|
|
|
assert(_size >= 0);
|
2006-05-31 06:12:29 +02:00
|
|
|
asid = _asid;
|
|
|
|
vaddr = _vaddr;
|
|
|
|
size = _size;
|
|
|
|
pc = _pc;
|
|
|
|
time = curTick;
|
2008-11-10 20:51:17 +01:00
|
|
|
|
|
|
|
flags.set(VALID_VADDR|VALID_SIZE|VALID_PC);
|
|
|
|
flags.clear(VALID_PADDR|VALID_EXTRA_DATA|MMAPED_IPR);
|
|
|
|
flags.update(_flags, PUBLIC_FLAGS);
|
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
|
|
|
|
setPaddr(Addr _paddr)
|
2006-05-31 06:12:29 +02:00
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_VADDR));
|
2006-05-31 06:12:29 +02:00
|
|
|
paddr = _paddr;
|
2008-11-10 20:51:17 +01:00
|
|
|
flags.set(VALID_PADDR);
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_VADDR));
|
|
|
|
assert(flags.noneSet(VALID_PADDR));
|
2008-11-14 08:30:37 +01:00
|
|
|
assert(split_addr > vaddr && split_addr < vaddr + size);
|
|
|
|
req1 = new Request;
|
|
|
|
*req1 = *this;
|
|
|
|
req2 = new Request;
|
|
|
|
*req2 = *this;
|
|
|
|
req1->size = split_addr - vaddr;
|
|
|
|
req2->vaddr = split_addr;
|
|
|
|
req2->size = size - req1->size;
|
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/**
|
|
|
|
* Accessor for paddr.
|
|
|
|
*/
|
|
|
|
Addr
|
|
|
|
getPaddr()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
return paddr;
|
2006-05-31 06:12:29 +02:00
|
|
|
}
|
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/**
|
|
|
|
* Accessor for size.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
getSize()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_SIZE));
|
2008-11-10 20:51:17 +01:00
|
|
|
return size;
|
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
|
|
|
/** Accessor for time. */
|
2008-11-10 20:51:17 +01:00
|
|
|
Tick
|
|
|
|
getTime()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
return time;
|
|
|
|
}
|
|
|
|
|
2008-10-09 13:58:24 +02:00
|
|
|
void
|
|
|
|
setTime(Tick when)
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
2008-10-09 13:58:24 +02:00
|
|
|
time = when;
|
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
/** Accessor for flags. */
|
|
|
|
Flags
|
|
|
|
getFlags()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
return flags & PUBLIC_FLAGS;
|
|
|
|
}
|
|
|
|
|
|
|
|
Flags
|
|
|
|
anyFlags(Flags _flags)
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
|
|
|
assert(_flags.noneSet(~PUBLIC_FLAGS));
|
|
|
|
return flags.isSet(_flags);
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Flags
|
|
|
|
allFlags(Flags _flags)
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
|
|
|
assert(_flags.noneSet(~PUBLIC_FLAGS));
|
|
|
|
return flags.allSet(_flags);
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/** Accessor for flags. */
|
2008-11-10 20:51:17 +01:00
|
|
|
void
|
|
|
|
setFlags(Flags _flags)
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
|
|
|
assert(_flags.noneSet(~PUBLIC_FLAGS));
|
2008-11-10 20:51:17 +01:00
|
|
|
flags.set(_flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
clearFlags(Flags _flags)
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
|
|
|
assert(_flags.noneSet(~PUBLIC_FLAGS));
|
2008-11-10 20:51:17 +01:00
|
|
|
flags.clear(_flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
clearFlags()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
flags.clear(PUBLIC_FLAGS);
|
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
|
|
|
/** Accessor function for vaddr.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
Addr
|
|
|
|
getVaddr()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_VADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
return vaddr;
|
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
|
|
|
/** Accessor function for asid.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
int
|
|
|
|
getAsid()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_VADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
return asid;
|
|
|
|
}
|
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()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_VADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
return flags & ASI_BITS;
|
|
|
|
}
|
2006-11-29 23:11:10 +01:00
|
|
|
|
2006-11-23 07:42:57 +01:00
|
|
|
/** Accessor function for asi.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
void
|
|
|
|
setAsi(uint8_t a)
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_VADDR));
|
2008-11-10 20:51:17 +01:00
|
|
|
flags.update(a, ASI_BITS);
|
|
|
|
}
|
2006-11-23 07:42:57 +01:00
|
|
|
|
|
|
|
/** Accessor function for asi.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
bool
|
|
|
|
isMmapedIpr()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PADDR));
|
|
|
|
return flags.isSet(MMAPED_IPR);
|
2008-11-10 20:51:17 +01:00
|
|
|
}
|
2006-11-29 23:11:10 +01:00
|
|
|
|
2006-11-23 07:42:57 +01:00
|
|
|
/** Accessor function for asi.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
void
|
|
|
|
setMmapedIpr(bool r)
|
|
|
|
{
|
|
|
|
assert(VALID_VADDR);
|
|
|
|
flags.set(MMAPED_IPR);
|
|
|
|
}
|
2006-11-23 07:42:57 +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()
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
return flags.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
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_EXTRA_DATA));
|
2008-11-10 20:51:17 +01:00
|
|
|
return extraData;
|
|
|
|
}
|
|
|
|
|
2006-05-31 06:12:29 +02:00
|
|
|
/** Accessor function for store conditional return value.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
void
|
|
|
|
setExtraData(uint64_t _extraData)
|
|
|
|
{
|
|
|
|
extraData = _extraData;
|
|
|
|
flags.set(VALID_EXTRA_DATA);
|
|
|
|
}
|
2006-05-31 06:12:29 +02:00
|
|
|
|
2009-03-11 01:37:15 +01:00
|
|
|
bool
|
|
|
|
hasContextId() const
|
|
|
|
{
|
|
|
|
return flags.isSet(VALID_CONTEXT_ID);
|
|
|
|
}
|
|
|
|
|
2008-11-03 03:57:07 +01:00
|
|
|
/** Accessor function for context ID.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
int
|
|
|
|
contextId() const
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.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
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.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
|
|
|
|
{
|
|
|
|
return flags.isSet(VALID_PC);
|
|
|
|
}
|
|
|
|
|
2009-03-11 01:37:15 +01:00
|
|
|
/** Accessor function for pc.*/
|
2008-11-10 20:51:17 +01:00
|
|
|
Addr
|
|
|
|
getPC() const
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
assert(flags.isSet(VALID_PC));
|
2008-11-10 20:51:17 +01:00
|
|
|
return pc;
|
|
|
|
}
|
2006-04-07 21:54:48 +02:00
|
|
|
|
2006-06-28 20:35:00 +02:00
|
|
|
/** Accessor Function to Check Cacheability. */
|
2008-12-06 23:18:18 +01:00
|
|
|
bool isUncacheable() const { return flags.isSet(UNCACHEABLE); }
|
|
|
|
bool isInstRead() const { return flags.isSet(INST_READ); }
|
2009-04-19 13:25:01 +02:00
|
|
|
bool isLlsc() const { return flags.isSet(LLSC); }
|
2008-12-06 23:18:18 +01:00
|
|
|
bool isSwap() const { return flags.isSet(MEM_SWAP|MEM_SWAP_COND); }
|
|
|
|
bool isCondSwap() const { return flags.isSet(MEM_SWAP_COND); }
|
2008-11-10 20:51:17 +01:00
|
|
|
|
|
|
|
bool
|
|
|
|
isMisaligned() const
|
|
|
|
{
|
2008-12-06 23:18:18 +01:00
|
|
|
if (flags.isSet(NO_ALIGN_FAULT))
|
2008-11-10 20:51:17 +01:00
|
|
|
return false;
|
2006-10-08 19:53:24 +02:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
if ((vaddr & 0x1))
|
|
|
|
return true;
|
2006-06-30 16:25:25 +02:00
|
|
|
|
2008-12-06 23:18:18 +01:00
|
|
|
if (flags.isSet(NO_HALF_WORD_ALIGN_FAULT))
|
2008-11-10 20:51:17 +01:00
|
|
|
return false;
|
2007-02-12 19:06:30 +01:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
if ((vaddr & 0x2))
|
|
|
|
return true;
|
2007-02-12 19:06:30 +01:00
|
|
|
|
2008-11-10 20:51:17 +01:00
|
|
|
return false;
|
|
|
|
}
|
2006-01-31 20:20:39 +01:00
|
|
|
};
|
2006-01-31 18:12:49 +01:00
|
|
|
|
|
|
|
#endif // __MEM_REQUEST_HH__
|