arch: Resurrect the NOISA build target and rename it NULL
authorAndreas Hansson <andreas.hansson@arm.com>
Wed, 4 Sep 2013 17:22:57 +0000 (13:22 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Wed, 4 Sep 2013 17:22:57 +0000 (13:22 -0400)
This patch makes it possible to once again build gem5 without any
ISA. The main purpose is to enable work around the interconnect and
memory system without having to build any CPU models or device models.

The regress script is updated to include the NULL ISA target. Currently
no regressions make use of it, but all the testers could (and perhaps
should) transition to it.

--HG--
rename : build_opts/NOISA => build_opts/NULL
rename : src/arch/noisa/SConsopts => src/arch/null/SConsopts
rename : src/arch/noisa/cpu_dummy.hh => src/arch/null/cpu_dummy.hh
rename : src/cpu/intr_control.cc => src/cpu/intr_control_noisa.cc

39 files changed:
build_opts/NOISA [deleted file]
build_opts/NULL [new file with mode: 0644]
src/arch/generic/SConscript
src/arch/noisa/SConsopts [deleted file]
src/arch/noisa/cpu_dummy.hh [deleted file]
src/arch/null/SConscript [new file with mode: 0644]
src/arch/null/SConsopts [new file with mode: 0644]
src/arch/null/cpu_dummy.cc [new file with mode: 0644]
src/arch/null/cpu_dummy.hh [new file with mode: 0644]
src/arch/null/isa_traits.hh [new file with mode: 0644]
src/arch/null/registers.hh [new file with mode: 0644]
src/arch/null/remote_gdb.hh [new file with mode: 0644]
src/arch/null/types.hh [new file with mode: 0644]
src/arch/null/utility.hh [new file with mode: 0644]
src/base/SConscript
src/cpu/SConscript
src/cpu/base.hh
src/cpu/intr_control_noisa.cc [new file with mode: 0644]
src/dev/SConscript
src/dev/sinic.cc
src/kern/SConscript
src/mem/SConscript
src/mem/cache/SConscript
src/mem/cache/base.cc
src/mem/cache/prefetch/SConscript
src/mem/cache/tags/SConscript
src/mem/cache/tags/base.cc
src/mem/fs_translating_port_proxy.cc
src/mem/fs_translating_port_proxy.hh
src/mem/port_proxy.hh
src/mem/ruby/SConscript
src/python/swig/pyobject.cc
src/sim/SConscript
src/sim/arguments.hh
src/sim/stat_control.cc
src/sim/system.cc
src/sim/system.hh
src/unittest/SConscript
util/regress

diff --git a/build_opts/NOISA b/build_opts/NOISA
deleted file mode 100644 (file)
index dd1f82a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-TARGET_ISA = 'no'
-CPU_MODELS = 'no'
diff --git a/build_opts/NULL b/build_opts/NULL
new file mode 100644 (file)
index 0000000..5d85833
--- /dev/null
@@ -0,0 +1,2 @@
+TARGET_ISA = 'null'
+CPU_MODELS = ''
index f2edc805d740eedd44fd78256dbb40e3f8087423..3dfc509a437042577f91487dc903f9886edd69d2 100644 (file)
@@ -28,4 +28,7 @@
 
 Import('*')
 
+if env['TARGET_ISA'] == 'null':
+    Return()
+
 Source('decode_cache.cc')
diff --git a/src/arch/noisa/SConsopts b/src/arch/noisa/SConsopts
deleted file mode 100644 (file)
index fbfcf05..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Import('*')
-
-all_isa_list.append('no')
diff --git a/src/arch/noisa/cpu_dummy.hh b/src/arch/noisa/cpu_dummy.hh
deleted file mode 100644 (file)
index 0d494d6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-class BaseCPU
-{
-  public:
-    static int numSimulatedInsts() { return 0; }
-    static int numSimulatedOps() { return 0; }
-};
diff --git a/src/arch/null/SConscript b/src/arch/null/SConscript
new file mode 100644 (file)
index 0000000..e64b69c
--- /dev/null
@@ -0,0 +1,43 @@
+# -*- mode:python -*-
+
+# Copyright (c) 2013 ARM Limited
+# All rights reserved
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Andreas Hansson
+
+Import('*')
+
+if env['TARGET_ISA'] == 'null':
+    Source('cpu_dummy.cc')
diff --git a/src/arch/null/SConsopts b/src/arch/null/SConsopts
new file mode 100644 (file)
index 0000000..e377564
--- /dev/null
@@ -0,0 +1,42 @@
+# -*- mode:python -*-
+
+# Copyright (c) 2013 ARM Limited
+# All rights reserved
+#
+# The license below extends only to copyright in the software and shall
+# not be construed as granting a license to any other intellectual
+# property including but not limited to intellectual property relating
+# to a hardware implementation of the functionality of the software
+# licensed hereunder.  You may use the software subject to the license
+# terms below provided that you ensure that this notice is replicated
+# unmodified and in its entirety in all distributions of the software,
+# modified or unmodified, in source code or in binary form.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Andreas Hansson
+
+Import('*')
+
+all_isa_list.append('null')
diff --git a/src/arch/null/cpu_dummy.cc b/src/arch/null/cpu_dummy.cc
new file mode 100644 (file)
index 0000000..4c78bf7
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Andreas Hansson
+ */
+
+/**
+ * Provide the actual storage for maxThreadsPerCPU which is declared
+ * extern and normally provided by src/cpu/base.cc
+ */
+int maxThreadsPerCPU = 1;
diff --git a/src/arch/null/cpu_dummy.hh b/src/arch/null/cpu_dummy.hh
new file mode 100644 (file)
index 0000000..ed6f6d1
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Andreas Hansson
+ */
+
+#ifndef __ARCH_NULL_CPU_DUMMY_HH__
+#define __ARCH_NULL_CPU_DUMMY_HH__
+
+#include "sim/core.hh"
+
+class BaseCPU
+{
+  public:
+    static int numSimulatedInsts() { return 0; }
+    static int numSimulatedOps() { return 0; }
+};
+
+#endif // __ARCH_NULL_CPU_DUMMY_HH__
diff --git a/src/arch/null/isa_traits.hh b/src/arch/null/isa_traits.hh
new file mode 100644 (file)
index 0000000..d09b1e8
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Andreas Hansson
+ */
+
+#ifndef __ARCH_NULL_ISA_TRAITS_HH__
+#define __ARCH_NULL_ISA_TRAITS_HH__
+
+#include "base/types.hh"
+
+namespace LittleEndianGuest {}
+
+namespace NullISA
+{
+    using namespace LittleEndianGuest;
+
+    const Addr PageShift = 12;
+    const Addr PageBytes = ULL(1) << PageShift;
+
+    const int LogVMPageSize = 12;       // 4K bytes
+    const int VMPageSize = (1 << LogVMPageSize);
+
+}
+
+#endif //__ARCH_NULL_ISA_TRAITS_HH__
diff --git a/src/arch/null/registers.hh b/src/arch/null/registers.hh
new file mode 100644 (file)
index 0000000..f33b7e5
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Andreas Hansson
+ */
+
+#ifndef __ARCH_NULL_REGISTERS_HH__
+#define __ARCH_NULL_REGISTERS_HH__
+
+#include "base/types.hh"
+
+namespace NullISA {
+
+typedef uint64_t IntReg;
+typedef uint32_t FloatRegBits;
+typedef float FloatReg;
+typedef uint64_t MiscReg;
+
+}
+
+#endif // __ARCH_NULL_REGISTERS_HH__
diff --git a/src/arch/null/remote_gdb.hh b/src/arch/null/remote_gdb.hh
new file mode 100644 (file)
index 0000000..dddebce
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Andreas Hansson
+ */
+
+#ifndef __ARCH_NULL_REMOTE_GDB_HH__
+#define __ARCH_NULL_REMOTE_GDB_HH__
+
+class ThreadContext;
+
+class BaseRemoteGDB
+{
+
+  public:
+
+    bool breakpoint() { return false; }
+    void replaceThreadContext(ThreadContext *tc) {}
+
+    virtual ~BaseRemoteGDB() {}
+};
+
+#endif // __ARCH_NULL_REMOTE_GDB_H__
diff --git a/src/arch/null/types.hh b/src/arch/null/types.hh
new file mode 100644 (file)
index 0000000..b62b8f2
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Andreas Hansson
+ */
+
+#ifndef __ARCH_NULL_TYPES_HH__
+#define __ARCH_NULL_TYPES_HH__
+
+#include "arch/generic/types.hh"
+
+namespace NullISA
+{
+    typedef uint32_t MachInst;
+
+    class PCState : public GenericISA::UPCState<MachInst>
+    {
+      protected:
+
+        typedef GenericISA::UPCState<MachInst> Base;
+    };
+
+}
+
+#endif // __ARCH_NULL_TYPES_HH__
diff --git a/src/arch/null/utility.hh b/src/arch/null/utility.hh
new file mode 100644 (file)
index 0000000..cf65ef5
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Andreas Hansson
+ */
+
+#ifndef __ARCH_NULL_UTILITY_HH__
+#define __ARCH_NULL_UTILITY_HH__
+
+#include "base/types.hh"
+#include "cpu/thread_context.hh"
+
+namespace NullISA {
+
+inline uint64_t getArgument(ThreadContext *tc, int &number, uint16_t size,
+                            bool fp) { return 0; }
+
+inline void startupCPU(ThreadContext *tc, int cpuId) {}
+
+}
+
+#endif // __ARCH_NULL_UTILITY_HH__
index b2a348f1544a2a8081f91cc5eb722af679656163..8c32bb3c9ef179c239b7fa32321df7eba363dc70 100644 (file)
@@ -52,7 +52,7 @@ Source('output.cc')
 Source('pollevent.cc')
 Source('random.cc')
 Source('random_mt.cc')
-if env['TARGET_ISA'] != 'no':
+if env['TARGET_ISA'] != 'null':
     Source('remote_gdb.cc')
 Source('socket.cc')
 Source('statistics.cc')
index c52dbc53b38ab12f66fc744aae51fb87fe8c6b1c..999de1e4998ba12e5470dad4dfbf8f9dc64bc751 100644 (file)
@@ -30,7 +30,9 @@
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
+if env['TARGET_ISA'] == 'null':
+    SimObject('IntrControl.py')
+    Source('intr_control_noisa.cc')
     Return()
 
 #################################################################
index 9e7198763950e5ff4aa5c2c508fa01833f54cc80..540c728336666ed6a43ac7be0aeff02b6cb7a179 100644 (file)
 
 #include <vector>
 
+// Before we do anything else, check if this build is the NULL ISA,
+// and if so stop here
+#include "config/the_isa.hh"
+#if THE_ISA == NULL_ISA
+#include "arch/null/cpu_dummy.hh"
+#else
 #include "arch/interrupts.hh"
 #include "arch/isa_traits.hh"
 #include "arch/microcode_rom.hh"
 #include "base/statistics.hh"
-#include "config/the_isa.hh"
 #include "mem/mem_object.hh"
 #include "sim/eventq.hh"
 #include "sim/full_system.hh"
@@ -476,4 +481,6 @@ class BaseCPU : public MemObject
     Stats::Scalar numWorkItemsCompleted;
 };
 
+#endif // THE_ISA == NULL_ISA
+
 #endif // __CPU_BASE_HH__
diff --git a/src/cpu/intr_control_noisa.cc b/src/cpu/intr_control_noisa.cc
new file mode 100644 (file)
index 0000000..ff49976
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2002-2005 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution;
+ * neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Nathan Binkert
+ *          Ron Dreslinski
+ */
+
+#include "cpu/intr_control.hh"
+
+using namespace std;
+
+IntrControl::IntrControl(const Params *p)
+    : SimObject(p), sys(p->sys)
+{}
+
+void
+IntrControl::post(int cpu_id, int int_num, int index)
+{
+}
+
+void
+IntrControl::clear(int cpu_id, int int_num, int index)
+{
+}
+
+IntrControl *
+IntrControlParams::create()
+{
+    return new IntrControl(this);
+}
index cba821f874c9623fe406d7dabbeebb05d05e2864..1bcddb6eef87ca622dae161f3b318c7d86be057f 100644 (file)
@@ -31,7 +31,7 @@
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
+if env['TARGET_ISA'] == 'null':
     Return()
 
 SimObject('BadDevice.py')
index 02eb8a11360700d998a06883fb9226384c3d441e..7da70c482f9d79e4e1b4aa82ed220b35ecf3b108 100644 (file)
@@ -32,7 +32,9 @@
 #include <limits>
 #include <string>
 
+#ifdef SINIC_VTOPHYS
 #include "arch/vtophys.hh"
+#endif
 #include "base/compiler.hh"
 #include "base/debug.hh"
 #include "base/inet.hh"
index 38734e650a68d1e9244f59863e215d66bbd489e5..2f4d70a486bb827e862a535cafb44b7230e8393f 100644 (file)
@@ -30,7 +30,7 @@
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
+if env['TARGET_ISA'] == 'null':
     Return()
 
 Source('kernel_stats.cc')
index ca89418b54ebd8d3a0bc8619ef2d58221755f608..02d0aee739af436e3ff3b6b657f1554ca7ebf22c 100644 (file)
@@ -36,11 +36,15 @@ if env['HAVE_PROTOBUF']:
     SimObject('CommMonitor.py')
     Source('comm_monitor.cc')
 
+SimObject('AbstractMemory.py')
 SimObject('AddrMapper.py')
 SimObject('Bridge.py')
 SimObject('Bus.py')
 SimObject('MemObject.py')
+SimObject('SimpleMemory.py')
+SimObject('SimpleDRAM.py')
 
+Source('abstract_mem.cc')
 Source('addr_mapper.cc')
 Source('bridge.cc')
 Source('bus.cc')
@@ -53,18 +57,14 @@ Source('port.cc')
 Source('packet_queue.cc')
 Source('tport.cc')
 Source('port_proxy.cc')
-Source('fs_translating_port_proxy.cc')
-Source('se_translating_port_proxy.cc')
+Source('simple_mem.cc')
+Source('physical.cc')
+Source('simple_dram.cc')
 
-if env['TARGET_ISA'] != 'no':
-    SimObject('AbstractMemory.py')
-    SimObject('SimpleMemory.py')
-    SimObject('SimpleDRAM.py')
-    Source('abstract_mem.cc')
-    Source('simple_mem.cc')
+if env['TARGET_ISA'] != 'null':
+    Source('fs_translating_port_proxy.cc')
+    Source('se_translating_port_proxy.cc')
     Source('page_table.cc')
-    Source('physical.cc')
-    Source('simple_dram.cc')
 
 DebugFlag('BaseBus')
 DebugFlag('BusAddrRanges')
index 8323602d2c8410f6fa532bcf33183ed7dd7cfe3d..a4fbe04c0bc59ddc44a910152024f1325dd9b3cd 100644 (file)
@@ -30,9 +30,6 @@
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
-    Return()
-
 SimObject('BaseCache.py')
 
 Source('base.cc')
index 03b4d5dc1ffa4b0f997f15c8d4757725ef434cad..af324527fdf8eba91b51849b6fc20778246a6ea4 100644 (file)
@@ -45,8 +45,6 @@
  * Definition of BaseCache functions.
  */
 
-#include "cpu/base.hh"
-#include "cpu/smt.hh"
 #include "debug/Cache.hh"
 #include "debug/Drain.hh"
 #include "mem/cache/tags/fa_lru.hh"
index 2310940c18493ff56432df8cb35edc08399cac51..61291f715e789c4cf93ca137c87d04d8cad99a85 100644 (file)
@@ -30,8 +30,6 @@
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
-    Return()
 SimObject('Prefetcher.py')
 
 Source('base.cc')
index de835c1d0252d030828c1e7784d3c5a67c9ff200..dca8d3bd876e6dc45ac74e8a3db5bcf8ef4bb096 100644 (file)
@@ -30,9 +30,6 @@
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
-    Return()
-
 SimObject('Tags.py')
 
 Source('base.cc')
index d9909f5de68230a5b81db3571cef1a528c10d4f7..947bd05dedeb74340237f16b14a71759696bf21d 100644 (file)
@@ -46,6 +46,7 @@
  * Definitions of BaseTags.
  */
 
+#include "config/the_isa.hh"
 #include "cpu/smt.hh" //maxThreadsPerCPU
 #include "mem/cache/tags/base.hh"
 #include "mem/cache/base.hh"
index 8fb9b91effe434a03183787c3698e9d8fccadd54..52e8b49d812bdb26c0f998bf118d3d13c5dbe3fe 100644 (file)
@@ -46,6 +46,7 @@
  * Port object definitions.
  */
 
+#include "arch/vtophys.hh"
 #include "base/chunk_generator.hh"
 #include "cpu/base.hh"
 #include "cpu/thread_context.hh"
index 2a922305099d7967d26f2ab509bc99e11bdb59b9..c8f099d2c978266ea08bffa990e069f818daedd3 100644 (file)
 #ifndef __MEM_FS_PORT_PROXY_HH__
 #define __MEM_FS_PORT_PROXY_HH__
 
-#include "arch/vtophys.hh"
 #include "mem/port_proxy.hh"
 
+class ThreadContext;
+
 /**
  * A TranslatingPortProxy in FS mode translates a virtual address to a
  * physical address and then calls the read/write functions of the
index f1e01c385bd27745fc922425b635bb60e335c7dd..1213daafa51181ee94d0b6543c4da7b8f848223c 100644 (file)
@@ -60,7 +60,7 @@
 #define __MEM_PORT_PROXY_HH__
 
 #include "config/the_isa.hh"
-#if THE_ISA != NO_ISA
+#if THE_ISA != NULL_ISA
     #include "arch/isa_traits.hh"
 #endif
 
@@ -127,7 +127,7 @@ class PortProxy
     template <typename T>
     void write(Addr address, T data) const;
 
-#if THE_ISA != NO_ISA
+#if THE_ISA != NULL_ISA
     /**
      * Read sizeof(T) bytes from address and return as object T.
      * Performs Guest to Host endianness transform.
@@ -161,7 +161,7 @@ PortProxy::write(Addr address, T data) const
     writeBlob(address, (uint8_t*)&data, sizeof(T));
 }
 
-#if THE_ISA != NO_ISA
+#if THE_ISA != NULL_ISA
 template <typename T>
 T
 PortProxy::readGtoH(Addr address) const
index 086c2f764ec6bdf444e7d420fe19ea61906c07bc..b655caa7d5b0a3e2a036d36b5a5c2a7681ad8e29 100644 (file)
@@ -37,7 +37,7 @@ import SCons
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
+if env['TARGET_ISA'] == 'null':
     Return()
 
 if env['PROTOCOL'] == 'None':
index f534623f8fa1bdd3f94806cb7c3705e8781333ae..fe849ec885deeb78b2048e29f9d32644a690b800 100644 (file)
 
 #include "base/inifile.hh"
 #include "base/output.hh"
+#include "config/the_isa.hh"
+#if THE_ISA != NULL_ISA
 #include "dev/etherdevice.hh"
 #include "dev/etherobject.hh"
+#endif
 #include "mem/mem_object.hh"
-#include "mem/port.hh"
 #include "python/swig/pyobject.hh"
 #include "sim/full_system.hh"
 #include "sim/sim_object.hh"
 
 using namespace std;
 
+#if THE_ISA != NULL_ISA
 EtherInt *
 lookupEthPort(SimObject *so, const std::string &name, int i)
 {
@@ -61,6 +64,7 @@ lookupEthPort(SimObject *so, const std::string &name, int i)
         p = ed->getEthPort(name, i);
     return p;
 }
+#endif
 
 /**
  * Connect the described MemObject ports.  Called from Python via SWIG.
@@ -71,6 +75,7 @@ int
 connectPorts(SimObject *o1, const std::string &name1, int i1,
              SimObject *o2, const std::string &name2, int i2)
 {
+#if THE_ISA != NULL_ISA
     if (FullSystem) {
         EtherObject *eo1, *eo2;
         EtherDevice *ed1, *ed2;
@@ -92,6 +97,7 @@ connectPorts(SimObject *o1, const std::string &name1, int i1,
             }
         }
     }
+#endif
     MemObject *mo1, *mo2;
     mo1 = dynamic_cast<MemObject*>(o1);
     mo2 = dynamic_cast<MemObject*>(o2);
index 90d77848b182040f760ee148b477ae2b144e9f3f..850af230e4a86a0bbf9c3c2642ec5e498fc2fb9a 100644 (file)
@@ -33,9 +33,9 @@ Import('*')
 SimObject('BaseTLB.py')
 SimObject('ClockedObject.py')
 SimObject('Root.py')
-SimObject('InstTracer.py')
 SimObject('ClockDomain.py')
 SimObject('VoltageDomain.py')
+SimObject('System.py')
 
 Source('arguments.cc')
 Source('async.cc')
@@ -51,19 +51,17 @@ Source('sim_events.cc')
 Source('sim_object.cc')
 Source('simulate.cc')
 Source('stat_control.cc')
-Source('syscall_emul.cc')
 Source('clock_domain.cc')
 Source('voltage_domain.cc')
+Source('system.cc')
 
-if env['TARGET_ISA'] != 'no':
+if env['TARGET_ISA'] != 'null':
+    SimObject('InstTracer.py')
     SimObject('Process.py')
-    SimObject('System.py')
     Source('faults.cc')
     Source('process.cc')
     Source('pseudo_inst.cc')
-    Source('system.cc')
-
-if env['TARGET_ISA'] != 'no':
+    Source('syscall_emul.cc')
     Source('tlb.cc')
 
 DebugFlag('Checkpoint')
index fad95599968396eb7ba5a80f646a04f7f45b1849..58a43852cf6df4d1a8b6e5bf31e5252f1c4997a1 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <cassert>
 
-#include "arch/vtophys.hh"
 #include "base/refcnt.hh"
 #include "base/types.hh"
 #include "mem/fs_translating_port_proxy.hh"
index 5429861d6ffec211554e9d6ba1f975fd00a30ab8..7a8d48ae2ae2beb22c0b7d952755964c04748606 100644 (file)
 #include "base/hostinfo.hh"
 #include "base/statistics.hh"
 #include "base/time.hh"
-#include "config/the_isa.hh"
-#if THE_ISA == NO_ISA
-#include "arch/noisa/cpu_dummy.hh"
-#else
 #include "cpu/base.hh"
-#endif
-
 #include "sim/eventq_impl.hh"
 #include "sim/stat_control.hh"
 
index 24f9dfbada59ccf773a566715f1bd5799f18ea89..7de483216bbd30b90ff6671214a4e87b3995ca93 100644 (file)
@@ -48,7 +48,6 @@
 #include "arch/isa_traits.hh"
 #include "arch/remote_gdb.hh"
 #include "arch/utility.hh"
-#include "arch/vtophys.hh"
 #include "base/loader/object_file.hh"
 #include "base/loader/symtab.hh"
 #include "base/str.hh"
@@ -228,6 +227,7 @@ System::registerThreadContext(ThreadContext *tc, int assigned)
     threadContexts[id] = tc;
     _numContexts++;
 
+#if THE_ISA != NULL_ISA
     int port = getRemoteGDBPort();
     if (port) {
         RemoteGDB *rgdb = new RemoteGDB(this, tc);
@@ -243,6 +243,7 @@ System::registerThreadContext(ThreadContext *tc, int assigned)
 
         remoteGDB[id] = rgdb;
     }
+#endif
 
     activeCpus.push_back(false);
 
index 5058e7b26fbe991f575f1575f8a9276dab90f3af..5b166eabf31f3603ccbd15433554fcc68f3ecaae 100644 (file)
@@ -184,7 +184,9 @@ class System : public MemObject
      */
     unsigned int cacheLineSize() const { return _cacheLineSize; }
 
+#if THE_ISA != NULL_ISA
     PCEventQueue pcEventQueue;
+#endif
 
     std::vector<ThreadContext *> threadContexts;
     int _numContexts;
@@ -380,11 +382,13 @@ class System : public MemObject
     {
         Addr addr = 0; // initialize only to avoid compiler warning
 
+#if THE_ISA != NULL_ISA
         if (symtab->findAddress(lbl, addr)) {
             T *ev = new T(&pcEventQueue, desc, fixFuncEventAddr(addr),
                           std::forward<Args>(args)...);
             return ev;
         }
+#endif
 
         return NULL;
     }
index 841cbb8a65468491dbc3008446e7c943a87a454c..4cb14a29010248c81aaf346fad44b58440bd78a2 100644 (file)
@@ -30,9 +30,6 @@
 
 Import('*')
 
-if env['TARGET_ISA'] == 'no':
-    Return()
-
 Source('unittest.cc')
 
 UnitTest('bitvectest', 'bitvectest.cc')
index b17da87971baab6f347bc976311a5db45f4e1d3d..2ed2b6970704f02f3da0c246515bd56e6f910c18 100755 (executable)
@@ -45,6 +45,7 @@ add_option('--builds',
            'ALPHA_MOESI_CMP_directory,' \
            'ALPHA_MOESI_CMP_token,' \
            'MIPS,' \
+           'NULL,' \
            'POWER,' \
            'SPARC,' \
            'X86,X86_MESI_CMP_directory,' \