summaryrefslogtreecommitdiff
path: root/src/cpu/o3/free_list.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2013-10-15 14:22:44 -0400
committerSteve Reinhardt <steve.reinhardt@amd.com>2013-10-15 14:22:44 -0400
commit552622184752dc798bc81f9b0b395db68aee9511 (patch)
treef8867449ca560470442878da448118277f561cbd /src/cpu/o3/free_list.cc
parent219c423f1fb0f9a559bfa87f9812426d5e2c3e29 (diff)
downloadgem5-552622184752dc798bc81f9b0b395db68aee9511.tar.xz
cpu/o3: clean up rename map and free list
Restructured rename map and free list to clean up some extraneous code and separate out common code that can be reused across different register classes (int and fp at this point). Both components now consist of a set of Simple* objects that are stand-alone rename map & free list for each class, plus a Unified* object that presents a unified interface across all register classes and then redirects accesses to the appropriate Simple* object as needed. Moved free list initialization to PhysRegFile to better isolate knowledge of physical register index mappings to that class (and remove the need to pass a number of parameters to the free list constructor). Causes a small change to these stats: cpu.rename.int_rename_lookups cpu.rename.fp_rename_lookups because they are now categorized on a per-operand basis rather than a per-instruction basis. That is, an instruction with mixed fp/int/misc operand types will have each operand categorized independently, where previously the lookup was categorized based on the instruction type.
Diffstat (limited to 'src/cpu/o3/free_list.cc')
-rw-r--r--src/cpu/o3/free_list.cc41
1 files changed, 7 insertions, 34 deletions
diff --git a/src/cpu/o3/free_list.cc b/src/cpu/o3/free_list.cc
index 4224d0e41..0c8a16d0d 100644
--- a/src/cpu/o3/free_list.cc
+++ b/src/cpu/o3/free_list.cc
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2004-2005 The Regents of The University of Michigan
+ * Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,41 +33,13 @@
#include "cpu/o3/free_list.hh"
#include "debug/FreeList.hh"
-SimpleFreeList::SimpleFreeList(ThreadID activeThreads,
- unsigned _numLogicalIntRegs,
- unsigned _numPhysicalIntRegs,
- unsigned _numLogicalFloatRegs,
- unsigned _numPhysicalFloatRegs)
- : numLogicalIntRegs(_numLogicalIntRegs),
- numPhysicalIntRegs(_numPhysicalIntRegs),
- numLogicalFloatRegs(_numLogicalFloatRegs),
- numPhysicalFloatRegs(_numPhysicalFloatRegs),
- numPhysicalRegs(numPhysicalIntRegs + numPhysicalFloatRegs)
+UnifiedFreeList::UnifiedFreeList(const std::string &_my_name,
+ PhysRegFile *_regFile)
+ : _name(_my_name), regFile(_regFile)
{
DPRINTF(FreeList, "Creating new free list object.\n");
- // Put all of the extra physical registers onto the free list. This
- // means excluding all of the base logical registers.
- for (PhysRegIndex i = numLogicalIntRegs * activeThreads;
- i < numPhysicalIntRegs; ++i)
- {
- freeIntRegs.push(i);
- }
-
- // Put all of the extra physical registers onto the free list. This
- // means excluding all of the base logical registers. Because the
- // float registers' indices start where the physical registers end,
- // some math must be done to determine where the free registers start.
- PhysRegIndex i = numPhysicalIntRegs + (numLogicalFloatRegs * activeThreads);
-
- for ( ; i < numPhysicalRegs; ++i)
- {
- freeFloatRegs.push(i);
- }
-}
-
-std::string
-SimpleFreeList::name() const
-{
- return "cpu.freelist";
+ // Have the register file initialize the free list since it knows
+ // about its internal organization
+ regFile->initFreeList(this);
}