SCons: Support building without an ISA

This commit is contained in:
Ali Saidi 2010-11-19 18:00:39 -06:00
parent 92655b6399
commit e1b9a815dd
17 changed files with 62 additions and 12 deletions

2
build_opts/NOISA Normal file
View file

@ -0,0 +1,2 @@
TARGET_ISA = 'no'
CPU_MODELS = 'no'

4
src/arch/noisa/SConsopts Normal file
View file

@ -0,0 +1,4 @@
Import('*')
all_isa_list.append('no')

View file

@ -0,0 +1,6 @@
class BaseCPU
{
public:
static int numSimulatedInstructions() { return 0; }
};

View file

@ -56,6 +56,7 @@ Source('pollevent.cc')
Source('random.cc') Source('random.cc')
Source('random_mt.cc') Source('random_mt.cc')
Source('range.cc') Source('range.cc')
if env['TARGET_ISA'] != 'no':
Source('remote_gdb.cc') Source('remote_gdb.cc')
Source('sat_counter.cc') Source('sat_counter.cc')
Source('socket.cc') Source('socket.cc')

View file

@ -30,6 +30,9 @@
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
################################################################# #################################################################
# #
# Generate StaticInst execute() method signatures. # Generate StaticInst execute() method signatures.

4
src/cpu/nocpu/SConsopts Normal file
View file

@ -0,0 +1,4 @@
Import('*')
CpuModel('no', '', '', { '': '' })

View file

@ -31,6 +31,9 @@
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
if env['FULL_SYSTEM']: if env['FULL_SYSTEM']:
SimObject('BadDevice.py') SimObject('BadDevice.py')
SimObject('CopyEngine.py') SimObject('CopyEngine.py')

View file

@ -30,6 +30,9 @@
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
if env['FULL_SYSTEM']: if env['FULL_SYSTEM']:
Source('kernel_stats.cc') Source('kernel_stats.cc')
Source('system_events.cc') Source('system_events.cc')

View file

@ -33,21 +33,23 @@ Import('*')
SimObject('Bridge.py') SimObject('Bridge.py')
SimObject('Bus.py') SimObject('Bus.py')
SimObject('MemObject.py') SimObject('MemObject.py')
SimObject('PhysicalMemory.py')
Source('bridge.cc') Source('bridge.cc')
Source('bus.cc') Source('bus.cc')
Source('dram.cc')
Source('mem_object.cc') Source('mem_object.cc')
Source('packet.cc') Source('packet.cc')
Source('physical.cc')
Source('port.cc') Source('port.cc')
Source('tport.cc') Source('tport.cc')
Source('mport.cc') Source('mport.cc')
if env['TARGET_ISA'] != 'no':
SimObject('PhysicalMemory.py')
Source('dram.cc')
Source('physical.cc')
if env['FULL_SYSTEM']: if env['FULL_SYSTEM']:
Source('vport.cc') Source('vport.cc')
else: elif env['TARGET_ISA'] != 'no':
Source('page_table.cc') Source('page_table.cc')
Source('translating_port.cc') Source('translating_port.cc')

View file

@ -30,6 +30,9 @@
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
SimObject('BaseCache.py') SimObject('BaseCache.py')
Source('base.cc') Source('base.cc')

View file

@ -30,6 +30,9 @@
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
Source('base.cc') Source('base.cc')
Source('ghb.cc') Source('ghb.cc')
Source('stride.cc') Source('stride.cc')

View file

@ -30,6 +30,9 @@
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
Source('base.cc') Source('base.cc')
Source('fa_lru.cc') Source('fa_lru.cc')
Source('iic.cc') Source('iic.cc')

View file

@ -37,6 +37,9 @@ import SCons
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
if not env['RUBY']: if not env['RUBY']:
Return() Return()

View file

@ -31,10 +31,8 @@
#include <Python.h> #include <Python.h>
#include "base/types.hh" #include "base/types.hh"
#include "cpu/base.hh"
#include "sim/serialize.hh" #include "sim/serialize.hh"
#include "sim/sim_object.hh" #include "sim/sim_object.hh"
#include "sim/system.hh"
extern "C" SimObject *convertSwigSimObjectPtr(PyObject *); extern "C" SimObject *convertSwigSimObjectPtr(PyObject *);
SimObject *resolveSimObject(const std::string &name); SimObject *resolveSimObject(const std::string &name);

View file

@ -32,28 +32,30 @@ Import('*')
SimObject('BaseTLB.py') SimObject('BaseTLB.py')
SimObject('Root.py') SimObject('Root.py')
SimObject('System.py')
SimObject('InstTracer.py') SimObject('InstTracer.py')
Source('async.cc') Source('async.cc')
Source('core.cc') Source('core.cc')
Source('debug.cc') Source('debug.cc')
Source('eventq.cc') Source('eventq.cc')
Source('faults.cc')
Source('init.cc') Source('init.cc')
Source('main.cc', bin_only=True) Source('main.cc', bin_only=True)
Source('pseudo_inst.cc')
Source('root.cc') Source('root.cc')
Source('serialize.cc') Source('serialize.cc')
Source('sim_events.cc') Source('sim_events.cc')
Source('sim_object.cc') Source('sim_object.cc')
Source('simulate.cc') Source('simulate.cc')
Source('stat_control.cc') Source('stat_control.cc')
if env['TARGET_ISA'] != 'no':
SimObject('System.py')
Source('faults.cc')
Source('pseudo_inst.cc')
Source('system.cc') Source('system.cc')
if env['FULL_SYSTEM']: if env['FULL_SYSTEM']:
Source('arguments.cc') Source('arguments.cc')
else: elif env['TARGET_ISA'] != 'no':
Source('tlb.cc') Source('tlb.cc')
SimObject('Process.py') SimObject('Process.py')

View file

@ -39,7 +39,14 @@
#include "base/hostinfo.hh" #include "base/hostinfo.hh"
#include "base/statistics.hh" #include "base/statistics.hh"
#include "base/time.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" #include "cpu/base.hh"
#endif
#include "sim/eventq.hh" #include "sim/eventq.hh"
using namespace std; using namespace std;

View file

@ -30,6 +30,9 @@
Import('*') Import('*')
if env['TARGET_ISA'] == 'no':
Return()
UnitTest('bitvectest', 'bitvectest.cc') UnitTest('bitvectest', 'bitvectest.cc')
UnitTest('circletest', 'circletest.cc') UnitTest('circletest', 'circletest.cc')
UnitTest('cprintftest', 'cprintftest.cc') UnitTest('cprintftest', 'cprintftest.cc')