regfile.hh (4172:141705d83494) regfile.hh (4329:52057dbec096)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 62 unchanged lines hidden (view full) ---

71 // be private eventually with some accessor functions.
72 public:
73 typedef typename Impl::O3CPU O3CPU;
74
75 /**
76 * Constructs a physical register file with the specified amount of
77 * integer and floating point registers.
78 */
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 62 unchanged lines hidden (view full) ---

71 // be private eventually with some accessor functions.
72 public:
73 typedef typename Impl::O3CPU O3CPU;
74
75 /**
76 * Constructs a physical register file with the specified amount of
77 * integer and floating point registers.
78 */
79 PhysRegFile(unsigned _numPhysicalIntRegs,
79 PhysRegFile(O3CPU *_cpu, unsigned _numPhysicalIntRegs,
80 unsigned _numPhysicalFloatRegs);
81
82 //Everything below should be pretty well identical to the normal
83 //register file that exists within AlphaISA class.
84 //The duplication is unfortunate but it's better than having
85 //different ways to access certain registers.
86
87 /** Reads an integer register. */

--- 175 unchanged lines hidden (view full) ---

263 int intrflag; // interrupt flag
264#endif
265
266 private:
267 /** CPU pointer. */
268 O3CPU *cpu;
269
270 public:
80 unsigned _numPhysicalFloatRegs);
81
82 //Everything below should be pretty well identical to the normal
83 //register file that exists within AlphaISA class.
84 //The duplication is unfortunate but it's better than having
85 //different ways to access certain registers.
86
87 /** Reads an integer register. */

--- 175 unchanged lines hidden (view full) ---

263 int intrflag; // interrupt flag
264#endif
265
266 private:
267 /** CPU pointer. */
268 O3CPU *cpu;
269
270 public:
271 /** Sets the CPU pointer. */
272 void setCPU(O3CPU *cpu_ptr) { cpu = cpu_ptr; }
273
274 /** Number of physical integer registers. */
275 unsigned numPhysicalIntRegs;
276 /** Number of physical floating point registers. */
277 unsigned numPhysicalFloatRegs;
278};
279
280template <class Impl>
271 /** Number of physical integer registers. */
272 unsigned numPhysicalIntRegs;
273 /** Number of physical floating point registers. */
274 unsigned numPhysicalFloatRegs;
275};
276
277template <class Impl>
281PhysRegFile::PhysRegFile(unsigned _numPhysicalIntRegs,
278PhysRegFile<Impl>::PhysRegFile(O3CPU *_cpu, unsigned _numPhysicalIntRegs,
282 unsigned _numPhysicalFloatRegs)
279 unsigned _numPhysicalFloatRegs)
283 : numPhysicalIntRegs(_numPhysicalIntRegs),
280 : cpu(_cpu), numPhysicalIntRegs(_numPhysicalIntRegs),
284 numPhysicalFloatRegs(_numPhysicalFloatRegs)
285{
286 intRegFile = new IntReg[numPhysicalIntRegs];
287 floatRegFile = new PhysFloatReg[numPhysicalFloatRegs];
288
289 for (int i = 0; i < Impl::MaxThreads; ++i) {
290 miscRegs[i].clear();
291 }
292
293 memset(intRegFile, 0, sizeof(IntReg) * numPhysicalIntRegs);
294 memset(floatRegFile, 0, sizeof(PhysFloatReg) * numPhysicalFloatRegs);
295}
296
297#endif
281 numPhysicalFloatRegs(_numPhysicalFloatRegs)
282{
283 intRegFile = new IntReg[numPhysicalIntRegs];
284 floatRegFile = new PhysFloatReg[numPhysicalFloatRegs];
285
286 for (int i = 0; i < Impl::MaxThreads; ++i) {
287 miscRegs[i].clear();
288 }
289
290 memset(intRegFile, 0, sizeof(IntReg) * numPhysicalIntRegs);
291 memset(floatRegFile, 0, sizeof(PhysFloatReg) * numPhysicalFloatRegs);
292}
293
294#endif