gem5/src/mem/request.hh

461 lines
13 KiB
C++
Raw Normal View History

/*
* 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.
*
* Authors: Ron Dreslinski
* Steve Reinhardt
* Ali Saidi
*/
/**
* @file
* Declaration of a request, the overall memory request consisting of
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>
#include "base/fast_alloc.hh"
2008-11-10 20:51:17 +01:00
#include "base/flags.hh"
#include "base/misc.hh"
#include "sim/host.hh"
#include "sim/core.hh"
class Request;
typedef Request* RequestPtr;
2008-11-10 20:51:17 +01:00
class Request : public FastAlloc
{
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. */
static const FlagsType LOCKED = 0x00000100;
/** 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;
/** 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;
2008-11-10 20:51:17 +01:00
private:
static const FlagsType PUBLIC_FLAGS = 0x00FF3FFF;
static const FlagsType PRIVATE_FLAGS = 0xFF000000;
rename store conditional stuff as extra data so it can be used for conditional swaps as well Add support for a twin 64 bit int load Add Memory barrier and write barrier flags as appropriate Make atomic memory ops atomic src/arch/alpha/isa/mem.isa: src/arch/alpha/locked_mem.hh: src/cpu/base_dyn_inst.hh: src/mem/cache/cache_blk.hh: src/mem/cache/cache_impl.hh: rename store conditional stuff as extra data so it can be used for conditional swaps as well src/arch/alpha/types.hh: src/arch/mips/types.hh: src/arch/sparc/types.hh: add a largest read data type for statically allocating read buffers in atomic simple cpu src/arch/isa_parser.py: Add support for a twin 64 bit int load src/arch/sparc/isa/decoder.isa: Make atomic memory ops atomic Add Memory barrier and write barrier flags as appropriate src/arch/sparc/isa/formats/mem/basicmem.isa: add post access code block and define a twinload format for twin loads src/arch/sparc/isa/formats/mem/blockmem.isa: remove old microcoded twin load coad src/arch/sparc/isa/formats/mem/mem.isa: swap.isa replaces the code in loadstore.isa src/arch/sparc/isa/formats/mem/util.isa: add a post access code block src/arch/sparc/isa/includes.isa: need bigint.hh for Twin64_t src/arch/sparc/isa/operands.isa: add a twin 64 int type src/cpu/simple/atomic.cc: src/cpu/simple/atomic.hh: src/cpu/simple/base.hh: src/cpu/simple/timing.cc: add support for twinloads add support for swap and conditional swap instructions rename store conditional stuff as extra data so it can be used for conditional swaps as well src/mem/packet.cc: src/mem/packet.hh: Add support for atomic swap memory commands src/mem/packet_access.hh: Add endian conversion function for Twin64_t type src/mem/physical.cc: src/mem/physical.hh: src/mem/request.hh: Add support for atomic swap memory commands Rename sc code to extradata --HG-- extra : convert_revision : 69d908512fb34a4e28b29a6e58b807fb1a6b1656
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;
private:
/**
* The physical address of the request. Valid only if validPaddr
2008-11-10 20:51:17 +01:00
* is set.
*/
Addr paddr;
/**
* 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.
*/
int size;
/** Flag structure for the request. */
2008-11-10 20:51:17 +01:00
Flags flags;
/**
* 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.
*/
Tick time;
/** The address space ID. */
int asid;
/** The virtual address of the request. */
Addr vaddr;
2008-11-10 20:51:17 +01:00
/**
* Extra data for the request, such as the return value of
rename store conditional stuff as extra data so it can be used for conditional swaps as well Add support for a twin 64 bit int load Add Memory barrier and write barrier flags as appropriate Make atomic memory ops atomic src/arch/alpha/isa/mem.isa: src/arch/alpha/locked_mem.hh: src/cpu/base_dyn_inst.hh: src/mem/cache/cache_blk.hh: src/mem/cache/cache_impl.hh: rename store conditional stuff as extra data so it can be used for conditional swaps as well src/arch/alpha/types.hh: src/arch/mips/types.hh: src/arch/sparc/types.hh: add a largest read data type for statically allocating read buffers in atomic simple cpu src/arch/isa_parser.py: Add support for a twin 64 bit int load src/arch/sparc/isa/decoder.isa: Make atomic memory ops atomic Add Memory barrier and write barrier flags as appropriate src/arch/sparc/isa/formats/mem/basicmem.isa: add post access code block and define a twinload format for twin loads src/arch/sparc/isa/formats/mem/blockmem.isa: remove old microcoded twin load coad src/arch/sparc/isa/formats/mem/mem.isa: swap.isa replaces the code in loadstore.isa src/arch/sparc/isa/formats/mem/util.isa: add a post access code block src/arch/sparc/isa/includes.isa: need bigint.hh for Twin64_t src/arch/sparc/isa/operands.isa: add a twin 64 int type src/cpu/simple/atomic.cc: src/cpu/simple/atomic.hh: src/cpu/simple/base.hh: src/cpu/simple/timing.cc: add support for twinloads add support for swap and conditional swap instructions rename store conditional stuff as extra data so it can be used for conditional swaps as well src/mem/packet.cc: src/mem/packet.hh: Add support for atomic swap memory commands src/mem/packet_access.hh: Add endian conversion function for Twin64_t type src/mem/physical.cc: src/mem/physical.hh: src/mem/request.hh: Add support for atomic swap memory commands Rename sc code to extradata --HG-- extra : convert_revision : 69d908512fb34a4e28b29a6e58b807fb1a6b1656
2007-02-12 19:06:30 +01:00
* store conditional or the compare value for a CAS. */
uint64_t extraData;
/** The context ID (for statistics, typically). */
int _contextId;
/** The thread ID (id within this CPU) */
int _threadId;
/** program counter of initiating access; for tracing/debugging */
Addr pc;
public:
/** 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);
}
2008-11-10 20:51:17 +01:00
Request(int asid, Addr vaddr, int size, Flags flags, Addr pc,
int cid, int tid)
Fixes to get compiling to work. This is mainly fixing up some includes; changing functions within the XCs; changing MemReqPtrs to Requests or Packets where appropriate. Currently the O3 and Ozone CPUs do not work in the new memory system; I still need to fix up the ports to work and handle responses properly. This check-in is so that the merge between m5 and newmem is no longer outstanding. src/SConscript: Need to include FU Pool for new CPU model. I'll try to figure out a cleaner way to handle this in the future. src/base/traceflags.py: Include new traces flags, fix up merge mess up. src/cpu/SConscript: Include the base_dyn_inst.cc as one of othe sources. Don't compile the Ozone CPU for now. src/cpu/base.cc: Remove an extra } from the merge. src/cpu/base_dyn_inst.cc: Fixes to make compiling work. Don't instantiate the OzoneCPU for now. src/cpu/base_dyn_inst.hh: src/cpu/o3/2bit_local_pred.cc: src/cpu/o3/alpha_cpu_builder.cc: src/cpu/o3/alpha_cpu_impl.hh: src/cpu/o3/alpha_dyn_inst.hh: src/cpu/o3/alpha_params.hh: src/cpu/o3/bpred_unit.cc: src/cpu/o3/btb.hh: src/cpu/o3/commit.hh: src/cpu/o3/commit_impl.hh: src/cpu/o3/cpu.cc: src/cpu/o3/cpu.hh: src/cpu/o3/fetch.hh: src/cpu/o3/fetch_impl.hh: src/cpu/o3/free_list.hh: src/cpu/o3/iew.hh: src/cpu/o3/iew_impl.hh: src/cpu/o3/inst_queue.hh: src/cpu/o3/inst_queue_impl.hh: src/cpu/o3/regfile.hh: src/cpu/o3/sat_counter.hh: src/cpu/op_class.hh: src/cpu/ozone/cpu.hh: src/cpu/checker/cpu.cc: src/cpu/checker/cpu.hh: src/cpu/checker/exec_context.hh: src/cpu/checker/o3_cpu_builder.cc: src/cpu/ozone/cpu_impl.hh: src/mem/request.hh: src/cpu/o3/fu_pool.hh: src/cpu/o3/lsq.hh: src/cpu/o3/lsq_unit.hh: src/cpu/o3/lsq_unit_impl.hh: src/cpu/o3/thread_state.hh: src/cpu/ozone/back_end.hh: src/cpu/ozone/dyn_inst.cc: src/cpu/ozone/dyn_inst.hh: src/cpu/ozone/front_end.hh: src/cpu/ozone/inorder_back_end.hh: src/cpu/ozone/lw_back_end.hh: src/cpu/ozone/lw_lsq.hh: src/cpu/ozone/ozone_impl.hh: src/cpu/ozone/thread_state.hh: Fixes to get compiling to work. src/cpu/o3/alpha_cpu.hh: Fixes to get compiling to work. Float reg accessors have changed, as well as MemReqPtrs to RequestPtrs. src/cpu/o3/alpha_dyn_inst_impl.hh: Fixes to get compiling to work. Pass in the packet to the completeAcc function. Fix up syscall function. --HG-- rename : cpu/activity.cc => src/cpu/activity.cc rename : cpu/activity.hh => src/cpu/activity.hh rename : cpu/checker/cpu.cc => src/cpu/checker/cpu.cc rename : cpu/checker/cpu.hh => src/cpu/checker/cpu.hh rename : cpu/checker/cpu_builder.cc => src/cpu/checker/cpu_builder.cc rename : cpu/checker/exec_context.hh => src/cpu/checker/exec_context.hh rename : cpu/checker/o3_cpu_builder.cc => src/cpu/checker/o3_cpu_builder.cc rename : cpu/o3/dep_graph.hh => src/cpu/o3/dep_graph.hh rename : cpu/o3/fu_pool.cc => src/cpu/o3/fu_pool.cc rename : cpu/o3/fu_pool.hh => src/cpu/o3/fu_pool.hh rename : cpu/o3/lsq.cc => src/cpu/o3/lsq.cc rename : cpu/o3/lsq.hh => src/cpu/o3/lsq.hh rename : cpu/o3/lsq_impl.hh => src/cpu/o3/lsq_impl.hh rename : cpu/o3/lsq_unit.cc => src/cpu/o3/lsq_unit.cc rename : cpu/o3/lsq_unit.hh => src/cpu/o3/lsq_unit.hh rename : cpu/o3/lsq_unit_impl.hh => src/cpu/o3/lsq_unit_impl.hh rename : cpu/o3/scoreboard.cc => src/cpu/o3/scoreboard.cc rename : cpu/o3/scoreboard.hh => src/cpu/o3/scoreboard.hh rename : cpu/o3/thread_state.hh => src/cpu/o3/thread_state.hh rename : cpu/ozone/back_end.cc => src/cpu/ozone/back_end.cc rename : cpu/ozone/back_end.hh => src/cpu/ozone/back_end.hh rename : cpu/ozone/back_end_impl.hh => src/cpu/ozone/back_end_impl.hh rename : cpu/ozone/cpu_builder.cc => src/cpu/ozone/cpu_builder.cc rename : cpu/ozone/dyn_inst.cc => src/cpu/ozone/dyn_inst.cc rename : cpu/ozone/dyn_inst.hh => src/cpu/ozone/dyn_inst.hh rename : cpu/ozone/dyn_inst_impl.hh => src/cpu/ozone/dyn_inst_impl.hh rename : cpu/ozone/front_end.cc => src/cpu/ozone/front_end.cc rename : cpu/ozone/front_end.hh => src/cpu/ozone/front_end.hh rename : cpu/ozone/front_end_impl.hh => src/cpu/ozone/front_end_impl.hh rename : cpu/ozone/inorder_back_end.cc => src/cpu/ozone/inorder_back_end.cc rename : cpu/ozone/inorder_back_end.hh => src/cpu/ozone/inorder_back_end.hh rename : cpu/ozone/inorder_back_end_impl.hh => src/cpu/ozone/inorder_back_end_impl.hh rename : cpu/ozone/inst_queue.cc => src/cpu/ozone/inst_queue.cc rename : cpu/ozone/inst_queue.hh => src/cpu/ozone/inst_queue.hh rename : cpu/ozone/inst_queue_impl.hh => src/cpu/ozone/inst_queue_impl.hh rename : cpu/ozone/lsq_unit.cc => src/cpu/ozone/lsq_unit.cc rename : cpu/ozone/lsq_unit.hh => src/cpu/ozone/lsq_unit.hh rename : cpu/ozone/lsq_unit_impl.hh => src/cpu/ozone/lsq_unit_impl.hh rename : cpu/ozone/lw_back_end.cc => src/cpu/ozone/lw_back_end.cc rename : cpu/ozone/lw_back_end.hh => src/cpu/ozone/lw_back_end.hh rename : cpu/ozone/lw_back_end_impl.hh => src/cpu/ozone/lw_back_end_impl.hh rename : cpu/ozone/lw_lsq.cc => src/cpu/ozone/lw_lsq.cc rename : cpu/ozone/lw_lsq.hh => src/cpu/ozone/lw_lsq.hh rename : cpu/ozone/lw_lsq_impl.hh => src/cpu/ozone/lw_lsq_impl.hh rename : cpu/ozone/null_predictor.hh => src/cpu/ozone/null_predictor.hh rename : cpu/ozone/ozone_impl.hh => src/cpu/ozone/ozone_impl.hh rename : cpu/ozone/rename_table.cc => src/cpu/ozone/rename_table.cc rename : cpu/ozone/rename_table.hh => src/cpu/ozone/rename_table.hh rename : cpu/ozone/rename_table_impl.hh => src/cpu/ozone/rename_table_impl.hh rename : cpu/ozone/simple_impl.hh => src/cpu/ozone/simple_impl.hh rename : cpu/ozone/simple_params.hh => src/cpu/ozone/simple_params.hh rename : cpu/ozone/thread_state.hh => src/cpu/ozone/thread_state.hh rename : cpu/quiesce_event.cc => src/cpu/quiesce_event.cc rename : cpu/quiesce_event.hh => src/cpu/quiesce_event.hh rename : cpu/thread_state.hh => src/cpu/thread_state.hh rename : python/m5/objects/FUPool.py => src/python/m5/objects/FUPool.py rename : python/m5/objects/OzoneCPU.py => src/python/m5/objects/OzoneCPU.py rename : python/m5/objects/SimpleOzoneCPU.py => src/python/m5/objects/SimpleOzoneCPU.py extra : convert_revision : ca7f0fbf65ee1a70d482fb4eda9a1840c7f9b8f8
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);
Fixes to get compiling to work. This is mainly fixing up some includes; changing functions within the XCs; changing MemReqPtrs to Requests or Packets where appropriate. Currently the O3 and Ozone CPUs do not work in the new memory system; I still need to fix up the ports to work and handle responses properly. This check-in is so that the merge between m5 and newmem is no longer outstanding. src/SConscript: Need to include FU Pool for new CPU model. I'll try to figure out a cleaner way to handle this in the future. src/base/traceflags.py: Include new traces flags, fix up merge mess up. src/cpu/SConscript: Include the base_dyn_inst.cc as one of othe sources. Don't compile the Ozone CPU for now. src/cpu/base.cc: Remove an extra } from the merge. src/cpu/base_dyn_inst.cc: Fixes to make compiling work. Don't instantiate the OzoneCPU for now. src/cpu/base_dyn_inst.hh: src/cpu/o3/2bit_local_pred.cc: src/cpu/o3/alpha_cpu_builder.cc: src/cpu/o3/alpha_cpu_impl.hh: src/cpu/o3/alpha_dyn_inst.hh: src/cpu/o3/alpha_params.hh: src/cpu/o3/bpred_unit.cc: src/cpu/o3/btb.hh: src/cpu/o3/commit.hh: src/cpu/o3/commit_impl.hh: src/cpu/o3/cpu.cc: src/cpu/o3/cpu.hh: src/cpu/o3/fetch.hh: src/cpu/o3/fetch_impl.hh: src/cpu/o3/free_list.hh: src/cpu/o3/iew.hh: src/cpu/o3/iew_impl.hh: src/cpu/o3/inst_queue.hh: src/cpu/o3/inst_queue_impl.hh: src/cpu/o3/regfile.hh: src/cpu/o3/sat_counter.hh: src/cpu/op_class.hh: src/cpu/ozone/cpu.hh: src/cpu/checker/cpu.cc: src/cpu/checker/cpu.hh: src/cpu/checker/exec_context.hh: src/cpu/checker/o3_cpu_builder.cc: src/cpu/ozone/cpu_impl.hh: src/mem/request.hh: src/cpu/o3/fu_pool.hh: src/cpu/o3/lsq.hh: src/cpu/o3/lsq_unit.hh: src/cpu/o3/lsq_unit_impl.hh: src/cpu/o3/thread_state.hh: src/cpu/ozone/back_end.hh: src/cpu/ozone/dyn_inst.cc: src/cpu/ozone/dyn_inst.hh: src/cpu/ozone/front_end.hh: src/cpu/ozone/inorder_back_end.hh: src/cpu/ozone/lw_back_end.hh: src/cpu/ozone/lw_lsq.hh: src/cpu/ozone/ozone_impl.hh: src/cpu/ozone/thread_state.hh: Fixes to get compiling to work. src/cpu/o3/alpha_cpu.hh: Fixes to get compiling to work. Float reg accessors have changed, as well as MemReqPtrs to RequestPtrs. src/cpu/o3/alpha_dyn_inst_impl.hh: Fixes to get compiling to work. Pass in the packet to the completeAcc function. Fix up syscall function. --HG-- rename : cpu/activity.cc => src/cpu/activity.cc rename : cpu/activity.hh => src/cpu/activity.hh rename : cpu/checker/cpu.cc => src/cpu/checker/cpu.cc rename : cpu/checker/cpu.hh => src/cpu/checker/cpu.hh rename : cpu/checker/cpu_builder.cc => src/cpu/checker/cpu_builder.cc rename : cpu/checker/exec_context.hh => src/cpu/checker/exec_context.hh rename : cpu/checker/o3_cpu_builder.cc => src/cpu/checker/o3_cpu_builder.cc rename : cpu/o3/dep_graph.hh => src/cpu/o3/dep_graph.hh rename : cpu/o3/fu_pool.cc => src/cpu/o3/fu_pool.cc rename : cpu/o3/fu_pool.hh => src/cpu/o3/fu_pool.hh rename : cpu/o3/lsq.cc => src/cpu/o3/lsq.cc rename : cpu/o3/lsq.hh => src/cpu/o3/lsq.hh rename : cpu/o3/lsq_impl.hh => src/cpu/o3/lsq_impl.hh rename : cpu/o3/lsq_unit.cc => src/cpu/o3/lsq_unit.cc rename : cpu/o3/lsq_unit.hh => src/cpu/o3/lsq_unit.hh rename : cpu/o3/lsq_unit_impl.hh => src/cpu/o3/lsq_unit_impl.hh rename : cpu/o3/scoreboard.cc => src/cpu/o3/scoreboard.cc rename : cpu/o3/scoreboard.hh => src/cpu/o3/scoreboard.hh rename : cpu/o3/thread_state.hh => src/cpu/o3/thread_state.hh rename : cpu/ozone/back_end.cc => src/cpu/ozone/back_end.cc rename : cpu/ozone/back_end.hh => src/cpu/ozone/back_end.hh rename : cpu/ozone/back_end_impl.hh => src/cpu/ozone/back_end_impl.hh rename : cpu/ozone/cpu_builder.cc => src/cpu/ozone/cpu_builder.cc rename : cpu/ozone/dyn_inst.cc => src/cpu/ozone/dyn_inst.cc rename : cpu/ozone/dyn_inst.hh => src/cpu/ozone/dyn_inst.hh rename : cpu/ozone/dyn_inst_impl.hh => src/cpu/ozone/dyn_inst_impl.hh rename : cpu/ozone/front_end.cc => src/cpu/ozone/front_end.cc rename : cpu/ozone/front_end.hh => src/cpu/ozone/front_end.hh rename : cpu/ozone/front_end_impl.hh => src/cpu/ozone/front_end_impl.hh rename : cpu/ozone/inorder_back_end.cc => src/cpu/ozone/inorder_back_end.cc rename : cpu/ozone/inorder_back_end.hh => src/cpu/ozone/inorder_back_end.hh rename : cpu/ozone/inorder_back_end_impl.hh => src/cpu/ozone/inorder_back_end_impl.hh rename : cpu/ozone/inst_queue.cc => src/cpu/ozone/inst_queue.cc rename : cpu/ozone/inst_queue.hh => src/cpu/ozone/inst_queue.hh rename : cpu/ozone/inst_queue_impl.hh => src/cpu/ozone/inst_queue_impl.hh rename : cpu/ozone/lsq_unit.cc => src/cpu/ozone/lsq_unit.cc rename : cpu/ozone/lsq_unit.hh => src/cpu/ozone/lsq_unit.hh rename : cpu/ozone/lsq_unit_impl.hh => src/cpu/ozone/lsq_unit_impl.hh rename : cpu/ozone/lw_back_end.cc => src/cpu/ozone/lw_back_end.cc rename : cpu/ozone/lw_back_end.hh => src/cpu/ozone/lw_back_end.hh rename : cpu/ozone/lw_back_end_impl.hh => src/cpu/ozone/lw_back_end_impl.hh rename : cpu/ozone/lw_lsq.cc => src/cpu/ozone/lw_lsq.cc rename : cpu/ozone/lw_lsq.hh => src/cpu/ozone/lw_lsq.hh rename : cpu/ozone/lw_lsq_impl.hh => src/cpu/ozone/lw_lsq_impl.hh rename : cpu/ozone/null_predictor.hh => src/cpu/ozone/null_predictor.hh rename : cpu/ozone/ozone_impl.hh => src/cpu/ozone/ozone_impl.hh rename : cpu/ozone/rename_table.cc => src/cpu/ozone/rename_table.cc rename : cpu/ozone/rename_table.hh => src/cpu/ozone/rename_table.hh rename : cpu/ozone/rename_table_impl.hh => src/cpu/ozone/rename_table_impl.hh rename : cpu/ozone/simple_impl.hh => src/cpu/ozone/simple_impl.hh rename : cpu/ozone/simple_params.hh => src/cpu/ozone/simple_params.hh rename : cpu/ozone/thread_state.hh => src/cpu/ozone/thread_state.hh rename : cpu/quiesce_event.cc => src/cpu/quiesce_event.cc rename : cpu/quiesce_event.hh => src/cpu/quiesce_event.hh rename : cpu/thread_state.hh => src/cpu/thread_state.hh rename : python/m5/objects/FUPool.py => src/python/m5/objects/FUPool.py rename : python/m5/objects/OzoneCPU.py => src/python/m5/objects/OzoneCPU.py rename : python/m5/objects/SimpleOzoneCPU.py => src/python/m5/objects/SimpleOzoneCPU.py extra : convert_revision : ca7f0fbf65ee1a70d482fb4eda9a1840c7f9b8f8
2006-06-03 00:15:20 +02:00
}
~Request() {} // for FastAlloc
/**
2008-11-10 20:51:17 +01:00
* Set up CPU and thread numbers.
*/
void
setThreadContext(int context_id, int thread_id)
{
2008-11-10 20:51:17 +01:00
_contextId = context_id;
_threadId = thread_id;
flags.set(VALID_CONTEXT_ID|VALID_THREAD_ID);
}
/**
* 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)
{
assert(_size >= 0);
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);
}
/**
* 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)
{
assert(_size >= 0);
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);
}
2008-11-10 20:51:17 +01:00
/**
* Set just the physical address. This should only be used to
* 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)
{
assert(flags.isSet(VALID_VADDR));
paddr = _paddr;
2008-11-10 20:51:17 +01:00
flags.set(VALID_PADDR);
}
/**
* 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)
{
assert(flags.isSet(VALID_VADDR));
assert(flags.noneSet(VALID_PADDR));
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()
{
assert(flags.isSet(VALID_PADDR));
2008-11-10 20:51:17 +01:00
return paddr;
}
2008-11-10 20:51:17 +01:00
/**
* Accessor for size.
*/
int
getSize()
{
assert(flags.isSet(VALID_SIZE));
2008-11-10 20:51:17 +01:00
return size;
}
/** Accessor for time. */
2008-11-10 20:51:17 +01:00
Tick
getTime()
{
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
2008-11-10 20:51:17 +01:00
return time;
}
void
setTime(Tick when)
{
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
time = when;
}
2008-11-10 20:51:17 +01:00
/** Accessor for flags. */
Flags
getFlags()
{
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
2008-11-10 20:51:17 +01:00
return flags & PUBLIC_FLAGS;
}
Flags
anyFlags(Flags _flags)
{
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)
{
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
assert(_flags.noneSet(~PUBLIC_FLAGS));
return flags.allSet(_flags);
2008-11-10 20:51:17 +01:00
}
/** Accessor for flags. */
2008-11-10 20:51:17 +01:00
void
setFlags(Flags _flags)
{
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)
{
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()
{
assert(flags.isSet(VALID_PADDR|VALID_VADDR));
2008-11-10 20:51:17 +01:00
flags.clear(PUBLIC_FLAGS);
}
/** Accessor function for vaddr.*/
2008-11-10 20:51:17 +01:00
Addr
getVaddr()
{
assert(flags.isSet(VALID_VADDR));
2008-11-10 20:51:17 +01:00
return vaddr;
}
/** Accessor function for asid.*/
2008-11-10 20:51:17 +01:00
int
getAsid()
{
assert(flags.isSet(VALID_VADDR));
2008-11-10 20:51:17 +01:00
return asid;
}
/** Accessor function for asi.*/
2008-11-10 20:51:17 +01:00
uint8_t
getAsi()
{
assert(flags.isSet(VALID_VADDR));
2008-11-10 20:51:17 +01:00
return flags & ASI_BITS;
}
/** Accessor function for asi.*/
2008-11-10 20:51:17 +01:00
void
setAsi(uint8_t a)
{
assert(flags.isSet(VALID_VADDR));
2008-11-10 20:51:17 +01:00
flags.update(a, ASI_BITS);
}
/** Accessor function for asi.*/
2008-11-10 20:51:17 +01:00
bool
isMmapedIpr()
{
assert(flags.isSet(VALID_PADDR));
return flags.isSet(MMAPED_IPR);
2008-11-10 20:51:17 +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);
}
/** Accessor function to check if sc result is valid. */
2008-11-10 20:51:17 +01:00
bool
extraDataValid()
{
return flags.isSet(VALID_EXTRA_DATA);
2008-11-10 20:51:17 +01:00
}
/** Accessor function for store conditional return value.*/
2008-11-10 20:51:17 +01:00
uint64_t
getExtraData() const
{
assert(flags.isSet(VALID_EXTRA_DATA));
2008-11-10 20:51:17 +01:00
return extraData;
}
/** 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);
}
/** Accessor function for context ID.*/
2008-11-10 20:51:17 +01:00
int
contextId() const
{
assert(flags.isSet(VALID_CONTEXT_ID));
2008-11-10 20:51:17 +01:00
return _contextId;
}
/** Accessor function for thread ID. */
2008-11-10 20:51:17 +01:00
int
threadId() const
{
assert(flags.isSet(VALID_THREAD_ID));
2008-11-10 20:51:17 +01:00
return _threadId;
}
/** Accessor function for pc.*/
2008-11-10 20:51:17 +01:00
Addr
getPC() const
{
assert(flags.isSet(VALID_PC));
2008-11-10 20:51:17 +01:00
return pc;
}
/** Accessor Function to Check Cacheability. */
bool isUncacheable() const { return flags.isSet(UNCACHEABLE); }
bool isInstRead() const { return flags.isSet(INST_READ); }
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); }
2008-11-10 20:51:17 +01:00
bool
isMisaligned() const
{
if (flags.isSet(NO_ALIGN_FAULT))
2008-11-10 20:51:17 +01:00
return false;
2008-11-10 20:51:17 +01:00
if ((vaddr & 0x1))
return true;
if (flags.isSet(NO_HALF_WORD_ALIGN_FAULT))
2008-11-10 20:51:17 +01:00
return false;
rename store conditional stuff as extra data so it can be used for conditional swaps as well Add support for a twin 64 bit int load Add Memory barrier and write barrier flags as appropriate Make atomic memory ops atomic src/arch/alpha/isa/mem.isa: src/arch/alpha/locked_mem.hh: src/cpu/base_dyn_inst.hh: src/mem/cache/cache_blk.hh: src/mem/cache/cache_impl.hh: rename store conditional stuff as extra data so it can be used for conditional swaps as well src/arch/alpha/types.hh: src/arch/mips/types.hh: src/arch/sparc/types.hh: add a largest read data type for statically allocating read buffers in atomic simple cpu src/arch/isa_parser.py: Add support for a twin 64 bit int load src/arch/sparc/isa/decoder.isa: Make atomic memory ops atomic Add Memory barrier and write barrier flags as appropriate src/arch/sparc/isa/formats/mem/basicmem.isa: add post access code block and define a twinload format for twin loads src/arch/sparc/isa/formats/mem/blockmem.isa: remove old microcoded twin load coad src/arch/sparc/isa/formats/mem/mem.isa: swap.isa replaces the code in loadstore.isa src/arch/sparc/isa/formats/mem/util.isa: add a post access code block src/arch/sparc/isa/includes.isa: need bigint.hh for Twin64_t src/arch/sparc/isa/operands.isa: add a twin 64 int type src/cpu/simple/atomic.cc: src/cpu/simple/atomic.hh: src/cpu/simple/base.hh: src/cpu/simple/timing.cc: add support for twinloads add support for swap and conditional swap instructions rename store conditional stuff as extra data so it can be used for conditional swaps as well src/mem/packet.cc: src/mem/packet.hh: Add support for atomic swap memory commands src/mem/packet_access.hh: Add endian conversion function for Twin64_t type src/mem/physical.cc: src/mem/physical.hh: src/mem/request.hh: Add support for atomic swap memory commands Rename sc code to extradata --HG-- extra : convert_revision : 69d908512fb34a4e28b29a6e58b807fb1a6b1656
2007-02-12 19:06:30 +01:00
2008-11-10 20:51:17 +01:00
if ((vaddr & 0x2))
return true;
rename store conditional stuff as extra data so it can be used for conditional swaps as well Add support for a twin 64 bit int load Add Memory barrier and write barrier flags as appropriate Make atomic memory ops atomic src/arch/alpha/isa/mem.isa: src/arch/alpha/locked_mem.hh: src/cpu/base_dyn_inst.hh: src/mem/cache/cache_blk.hh: src/mem/cache/cache_impl.hh: rename store conditional stuff as extra data so it can be used for conditional swaps as well src/arch/alpha/types.hh: src/arch/mips/types.hh: src/arch/sparc/types.hh: add a largest read data type for statically allocating read buffers in atomic simple cpu src/arch/isa_parser.py: Add support for a twin 64 bit int load src/arch/sparc/isa/decoder.isa: Make atomic memory ops atomic Add Memory barrier and write barrier flags as appropriate src/arch/sparc/isa/formats/mem/basicmem.isa: add post access code block and define a twinload format for twin loads src/arch/sparc/isa/formats/mem/blockmem.isa: remove old microcoded twin load coad src/arch/sparc/isa/formats/mem/mem.isa: swap.isa replaces the code in loadstore.isa src/arch/sparc/isa/formats/mem/util.isa: add a post access code block src/arch/sparc/isa/includes.isa: need bigint.hh for Twin64_t src/arch/sparc/isa/operands.isa: add a twin 64 int type src/cpu/simple/atomic.cc: src/cpu/simple/atomic.hh: src/cpu/simple/base.hh: src/cpu/simple/timing.cc: add support for twinloads add support for swap and conditional swap instructions rename store conditional stuff as extra data so it can be used for conditional swaps as well src/mem/packet.cc: src/mem/packet.hh: Add support for atomic swap memory commands src/mem/packet_access.hh: Add endian conversion function for Twin64_t type src/mem/physical.cc: src/mem/physical.hh: src/mem/request.hh: Add support for atomic swap memory commands Rename sc code to extradata --HG-- extra : convert_revision : 69d908512fb34a4e28b29a6e58b807fb1a6b1656
2007-02-12 19:06:30 +01:00
2008-11-10 20:51:17 +01:00
return false;
}
};
#endif // __MEM_REQUEST_HH__