SConstruct (6814:cdf3b0523858) SConstruct (6994:c6951099a1cb)
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

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

607#
608# Collect all non-global variables
609#
610
611# Define the universe of supported ISAs
612all_isa_list = [ ]
613Export('all_isa_list')
614
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

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

607#
608# Collect all non-global variables
609#
610
611# Define the universe of supported ISAs
612all_isa_list = [ ]
613Export('all_isa_list')
614
615# Define the universe of supported CPU models
616all_cpu_list = [ ]
617default_cpus = [ ]
618Export('all_cpu_list', 'default_cpus')
615class CpuModel(object):
616 '''The CpuModel class encapsulates everything the ISA parser needs to
617 know about a particular CPU model.'''
619
618
619 # Dict of available CPU model objects. Accessible as CpuModel.dict.
620 dict = {}
621 list = []
622 defaults = []
623
624 # Constructor. Automatically adds models to CpuModel.dict.
625 def __init__(self, name, filename, includes, strings, default=False):
626 self.name = name # name of model
627 self.filename = filename # filename for output exec code
628 self.includes = includes # include files needed in exec file
629 # The 'strings' dict holds all the per-CPU symbols we can
630 # substitute into templates etc.
631 self.strings = strings
632
633 # This cpu is enabled by default
634 self.default = default
635
636 # Add self to dict
637 if name in CpuModel.dict:
638 raise AttributeError, "CpuModel '%s' already registered" % name
639 CpuModel.dict[name] = self
640 CpuModel.list.append(name)
641
642Export('CpuModel')
643
620# Sticky variables get saved in the variables file so they persist from
621# one invocation to the next (unless overridden, in which case the new
622# value becomes sticky).
623sticky_vars = Variables(args=ARGUMENTS)
624Export('sticky_vars')
625
626# Sticky variables that should be exported
627export_vars = []

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

635# above variables
636for bdir in [ base_dir ] + extras_dir_list:
637 for root, dirs, files in os.walk(bdir):
638 if 'SConsopts' in files:
639 print "Reading", joinpath(root, 'SConsopts')
640 SConscript(joinpath(root, 'SConsopts'))
641
642all_isa_list.sort()
644# Sticky variables get saved in the variables file so they persist from
645# one invocation to the next (unless overridden, in which case the new
646# value becomes sticky).
647sticky_vars = Variables(args=ARGUMENTS)
648Export('sticky_vars')
649
650# Sticky variables that should be exported
651export_vars = []

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

659# above variables
660for bdir in [ base_dir ] + extras_dir_list:
661 for root, dirs, files in os.walk(bdir):
662 if 'SConsopts' in files:
663 print "Reading", joinpath(root, 'SConsopts')
664 SConscript(joinpath(root, 'SConsopts'))
665
666all_isa_list.sort()
643all_cpu_list.sort()
644default_cpus.sort()
645
646sticky_vars.AddVariables(
647 EnumVariable('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list),
648 BoolVariable('FULL_SYSTEM', 'Full-system support', False),
667
668sticky_vars.AddVariables(
669 EnumVariable('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list),
670 BoolVariable('FULL_SYSTEM', 'Full-system support', False),
649 ListVariable('CPU_MODELS', 'CPU models', default_cpus, all_cpu_list),
671 ListVariable('CPU_MODELS', 'CPU models',
672 sorted(n for n,m in CpuModel.dict.iteritems() if m.default),
673 sorted(CpuModel.list)),
650 BoolVariable('NO_FAST_ALLOC', 'Disable fast object allocator', False),
651 BoolVariable('FAST_ALLOC_DEBUG', 'Enable fast object allocator debugging',
652 False),
653 BoolVariable('FAST_ALLOC_STATS', 'Enable fast object allocator statistics',
654 False),
655 BoolVariable('EFENCE', 'Link with Electric Fence malloc debugger',
656 False),
657 BoolVariable('SS_COMPATIBLE_FP',

--- 207 unchanged lines hidden ---
674 BoolVariable('NO_FAST_ALLOC', 'Disable fast object allocator', False),
675 BoolVariable('FAST_ALLOC_DEBUG', 'Enable fast object allocator debugging',
676 False),
677 BoolVariable('FAST_ALLOC_STATS', 'Enable fast object allocator statistics',
678 False),
679 BoolVariable('EFENCE', 'Link with Electric Fence malloc debugger',
680 False),
681 BoolVariable('SS_COMPATIBLE_FP',

--- 207 unchanged lines hidden ---