diff options
Diffstat (limited to 'src/cpu/o3/free_list.cc')
-rw-r--r-- | src/cpu/o3/free_list.cc | 41 |
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); } |