From f58d85128dde9aebb5b161aa51799309d5c16d67 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Fri, 14 Jan 2005 18:34:56 -0500 Subject: Fixes so m5 compiles on gcc 3.4, which has much stricter syntax. Most changes come from templated code, which is evaluated slightly differently than in previous versions of gcc. arch/alpha/alpha_linux_process.cc: Alphabetize includes. arch/alpha/vptr.hh: Change the constants that are being used for alpha pagebytes to come from the ISA. base/random.hh: cpu/static_inst.cc: sim/param.cc: Fix up template syntax. base/range.hh: Include iostream for << operator. base/res_list.hh: base/statistics.hh: cpu/simple_cpu/simple_cpu.hh: cpu/static_inst.hh: sim/eventq.hh: sim/param.hh: Fixup for templated code to resolve different scope lookup in gcc 3.4. This defers the lookup of the function/variable until actual instantiation time by making it dependent on the templated class/function. base/trace.cc: Fix call to new. base/trace.hh: Fix up #define to have full path. cpu/base_cpu.cc: Fix up call to new. dev/etherlink.hh: dev/ns_gige.hh: dev/sinic.hh: Fixup for friend class/function declaration. g++ 3.4 no longer allows typedefs to be declared as a friend class. dev/pcidev.hh: Fix up re-definition of access level to params. kern/linux/linux_syscalls.hh: kern/tru64/tru64_syscalls.hh: Fix up header. Fix up template syntax. sim/serialize.cc: Include errno.h. sim/startup.cc: Change startupq. queue was getting destructed before all things had called ~StartupCallback(), which lead to a segfault. This puts startupq in global space, and we allocate it ourselves. Other code may be similar to this and may need changing in the future. sim/syscall_emul.hh: Include cpu/exec_context.hh and sim/process.hh, as forward declarations are no longer sufficient. sim/universe.cc: Include errno.h --HG-- extra : convert_revision : e49d08ee89eb06a28351f02bafc028ca6652d5af --- cpu/base_cpu.cc | 4 ++-- cpu/simple_cpu/simple_cpu.hh | 19 +++++++------------ cpu/static_inst.cc | 2 +- cpu/static_inst.hh | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) (limited to 'cpu') diff --git a/cpu/base_cpu.cc b/cpu/base_cpu.cc index 7605ff3c3..c4bb97ff8 100644 --- a/cpu/base_cpu.cc +++ b/cpu/base_cpu.cc @@ -76,7 +76,7 @@ BaseCPU::BaseCPU(const string &_name, int _number_of_threads, bool _def_reg, maxThreadsPerCPU = number_of_threads; // allocate per-thread instruction-based event queues - comInstEventQueue = new (EventQueue *)[number_of_threads]; + comInstEventQueue = new EventQueue *[number_of_threads]; for (int i = 0; i < number_of_threads; ++i) comInstEventQueue[i] = new EventQueue("instruction-based event queue"); @@ -101,7 +101,7 @@ BaseCPU::BaseCPU(const string &_name, int _number_of_threads, bool _def_reg, } // allocate per-thread load-based event queues - comLoadEventQueue = new (EventQueue *)[number_of_threads]; + comLoadEventQueue = new EventQueue *[number_of_threads]; for (int i = 0; i < number_of_threads; ++i) comLoadEventQueue[i] = new EventQueue("load-based event queue"); diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index 341a0da23..9b6e2423b 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -26,15 +26,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __SIMPLE_CPU_HH__ -#define __SIMPLE_CPU_HH__ +#ifndef __CPU_SIMPLE_CPU_SIMPLE_CPU_HH__ +#define __CPU_SIMPLE_CPU_SIMPLE_CPU_HH__ -#include "cpu/base_cpu.hh" -#include "sim/eventq.hh" -#include "cpu/pc_event.hh" #include "base/statistics.hh" +#include "cpu/base_cpu.hh" #include "cpu/exec_context.hh" +#include "cpu/pc_event.hh" #include "cpu/static_inst.hh" +#include "sim/eventq.hh" // forward declarations #ifdef FULL_SYSTEM @@ -103,12 +103,7 @@ class SimpleCPU : public BaseCPU private: Trace::InstRecord *traceData; template - void trace_data(T data) { - if (traceData) { - traceData->setData(data); - } - }; - + void trace_data(T data); public: // enum Status { @@ -346,4 +341,4 @@ class SimpleCPU : public BaseCPU ExecContext *xcBase() { return xc; } }; -#endif // __SIMPLE_CPU_HH__ +#endif // __CPU_SIMPLE_CPU_SIMPLE_CPU_HH__ diff --git a/cpu/static_inst.cc b/cpu/static_inst.cc index 4cb45a818..7069d89ec 100644 --- a/cpu/static_inst.cc +++ b/cpu/static_inst.cc @@ -85,4 +85,4 @@ StaticInst::hasBranchTarget(Addr pc, ExecContext *xc, Addr &tgt) // force instantiation of template function(s) above -template StaticInst; +template class StaticInst; diff --git a/cpu/static_inst.hh b/cpu/static_inst.hh index 46b2e4b19..c442ada35 100644 --- a/cpu/static_inst.hh +++ b/cpu/static_inst.hh @@ -456,7 +456,7 @@ class StaticInstPtr : public RefCountingPtr > /// Convert to pointer to StaticInstBase class. operator const StaticInstBasePtr() { - return get(); + return this->get(); } }; -- cgit v1.2.3 From f31a27a030d2e93fef2934aa8642609bb38974af Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Tue, 18 Jan 2005 11:43:45 -0500 Subject: Move trace data function to .cc file. --HG-- extra : convert_revision : 8180068747489978a2bbaa096dc73b0cfd14b052 --- cpu/simple_cpu/simple_cpu.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cpu') diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index d48f93663..e3cce28ae 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -74,6 +74,15 @@ using namespace std; +template +void +SimpleCPU::trace_data(T data) { + if (traceData) { + traceData->setData(data); + } +} + + SimpleCPU::TickEvent::TickEvent(SimpleCPU *c) : Event(&mainEventQueue, CPU_Tick_Pri), cpu(c), multiplier(1) { -- cgit v1.2.3 From 0aaf8ec6b83c65a60932fd9f9f4b81eca1bcce74 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Thu, 3 Feb 2005 20:47:11 -0500 Subject: Add support for CPU models to execute the effective address calculation and memory access portions separately. Not currently used by any CPU models, but Kevin says he needs this. Also clean up handling of execution tracing for memory accesses (move it all into isa_desc and out of CPU models). Got rid of some ancient unused code too. arch/alpha/isa_desc: Add execute() methods to EAComp and MemAcc portions of memory access instructions, to allow CPU models to execute the effective address calculation and memory access portions separately. Requires the execution context to remember the effective address across the two invocations. Added setEA() and getEA() methods to execution context to support this. A model that does not use the split execution model can panic if these methods are called. Also added hook to call traceData->setAddr() after EA computation on any load or store operation. arch/isa_parser.py: Call traceData->setData() on memory writes (stores). cpu/simple_cpu/simple_cpu.cc: Get rid of unused code. cpu/simple_cpu/simple_cpu.hh: Add (non-functional) setEA() and getEA() methods for new split memory access execution support. --HG-- extra : convert_revision : bc2d2c758c4ca753812b9fa81f21038e55929ff0 --- cpu/simple_cpu/simple_cpu.cc | 8 -------- cpu/simple_cpu/simple_cpu.hh | 8 ++++++-- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'cpu') diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index e3cce28ae..f292b25a5 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -74,14 +74,6 @@ using namespace std; -template -void -SimpleCPU::trace_data(T data) { - if (traceData) { - traceData->setData(data); - } -} - SimpleCPU::TickEvent::TickEvent(SimpleCPU *c) : Event(&mainEventQueue, CPU_Tick_Pri), cpu(c), multiplier(1) diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index 9b6e2423b..a81d6365b 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -102,8 +102,7 @@ class SimpleCPU : public BaseCPU private: Trace::InstRecord *traceData; - template - void trace_data(T data); + public: // enum Status { @@ -244,6 +243,11 @@ class SimpleCPU : public BaseCPU template Fault write(T data, Addr addr, unsigned flags, uint64_t *res); + // These functions are only used in CPU models that split + // effective address computation from the actual memory access. + void setEA(Addr EA) { panic("SimpleCPU::setEA() not implemented\n"); } + Addr getEA() { panic("SimpleCPU::getEA() not implemented\n"); } + void prefetch(Addr addr, unsigned flags) { // need to do this... -- cgit v1.2.3