Created new M5 instruction to allow an integer parameter (init_param) to be specified...
authorAndrew Schultz <alschult@umich.edu>
Tue, 21 Oct 2003 21:18:17 +0000 (17:18 -0400)
committerAndrew Schultz <alschult@umich.edu>
Tue, 21 Oct 2003 21:18:17 +0000 (17:18 -0400)
arch/alpha/isa_desc:
    Added new M5FUNC instruction to put allow reading of init_param inside simulator
kern/tru64/tru64_system.cc:
kern/tru64/tru64_system.hh:
sim/system.cc:
sim/system.hh:
    Added support for init_param

--HG--
extra : convert_revision : 8253f0b4239b194d4f04665c9deec1fcdf665c8a

arch/alpha/isa_desc
kern/tru64/tru64_system.cc
kern/tru64/tru64_system.hh
sim/system.cc
sim/system.hh

index b5536525d1f3ba2583a160fb575aa6949d4f9e61..f36413ad8bc94fa0f58a16a17aed7b3eab88c731 100644 (file)
@@ -2407,6 +2407,7 @@ decode OPCODE default Unknown::unknown() {
                if (!xc->misspeculating())
                    m5_exit();
            }}, No_OpClass);
+            0x30: initparam({{ Ra = xc->cpu->system->init_param; }});
        }
     }
 
index b31b82644fddcf8443cd97b1431cd9a7e8b0cbf6..0a4f8ae4ec250fcecb33e6d69151b8565fb6604e 100644 (file)
 
 using namespace std;
 
-Tru64System::Tru64System(const string _name, MemoryController *_memCtrl,
-                         PhysicalMemory *_physmem, const string &kernel_path,
-                         const string &console_path, const string &palcode,
-                         const string &boot_osflags)
-     : System(_name, _memCtrl, _physmem)
+Tru64System::Tru64System(const string _name, const int _init_param,
+                         MemoryController *_memCtrl, PhysicalMemory *_physmem,
+                         const string &kernel_path, const string &console_path,
+                         const string &palcode, const string &boot_osflags)
+     : System(_name, _init_param, _memCtrl, _physmem)
 {
     kernelSymtab = new SymbolTable;
     consoleSymtab = new SymbolTable;
@@ -208,6 +208,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System)
 
     SimObjectParam<MemoryController *> mem_ctl;
     SimObjectParam<PhysicalMemory *> physmem;
+    Param<int> init_param;
 
     Param<string> kernel_code;
     Param<string> console_code;
@@ -220,6 +221,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64System)
 
     INIT_PARAM(mem_ctl, "memory controller"),
     INIT_PARAM(physmem, "phsyical memory"),
+    INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0),
     INIT_PARAM(kernel_code, "file that contains the kernel code"),
     INIT_PARAM(console_code, "file that contains the console code"),
     INIT_PARAM(pal_code, "file that contains palcode"),
@@ -230,9 +232,9 @@ END_INIT_SIM_OBJECT_PARAMS(Tru64System)
 
 CREATE_SIM_OBJECT(Tru64System)
 {
-    Tru64System *sys = new Tru64System(getInstanceName(), mem_ctl, physmem,
-                                       kernel_code, console_code, pal_code,
-                                       boot_osflags);
+    Tru64System *sys = new Tru64System(getInstanceName(), init_param, mem_ctl,
+                                       physmem, kernel_code, console_code,
+                                       pal_code, boot_osflags);
 
     return sys;
 }
index 087ef038cfe23a6e7d3648b47d9b3f8754f5f0dc..7fd337eb59cf58f1fe28d5db68ffdfdbcd5cceb5 100644 (file)
@@ -79,6 +79,7 @@ class Tru64System : public System
 
   public:
     Tru64System(const std::string _name,
+                const int _init_param,
                 MemoryController *_memCtrl,
                 PhysicalMemory *_physmem,
                 const std::string &kernel_path,
index fd80e23c3706196ed46fa2920582972188ec19d8..e1e293c90a76da74b095b0be0c19eb4df5436e05 100644 (file)
@@ -37,9 +37,11 @@ vector<System *> System::systemList;
 int System::numSystemsRunning = 0;
 
 System::System(const std::string _name,
+               const int _init_param,
                MemoryController *_memCtrl,
                PhysicalMemory *_physmem)
     : SimObject(_name),
+      init_param(_init_param),
       memCtrl(_memCtrl),
       physmem(_physmem)
 {
index bec1011ced94b0f237a7109ff5779cf4a06e22e2..56a3d6a6f31de2c7bd5ed38ae8a675f099f01052 100644 (file)
@@ -46,6 +46,7 @@ class ExecContext;
 class System : public SimObject
 {
   public:
+    const int init_param;
     MemoryController *memCtrl;
     PhysicalMemory *physmem;
 
@@ -55,7 +56,8 @@ class System : public SimObject
     void registerExecContext(ExecContext *xc);
 
   public:
-    System(const std::string name, MemoryController *, PhysicalMemory *);
+    System(const std::string _name, const int _init_param,
+           MemoryController *, PhysicalMemory *);
     ~System();
 
     virtual void init(ExecContext *xc) = 0;