SConscript revision 9958
12155SN/A# -*- mode:python -*- 22155SN/A 32155SN/A# Copyright (c) 2006 The Regents of The University of Michigan 42155SN/A# All rights reserved. 52155SN/A# 62155SN/A# Redistribution and use in source and binary forms, with or without 72155SN/A# modification, are permitted provided that the following conditions are 82155SN/A# met: redistributions of source code must retain the above copyright 92155SN/A# notice, this list of conditions and the following disclaimer; 102155SN/A# redistributions in binary form must reproduce the above copyright 112155SN/A# notice, this list of conditions and the following disclaimer in the 122155SN/A# documentation and/or other materials provided with the distribution; 132155SN/A# neither the name of the copyright holders nor the names of its 142155SN/A# contributors may be used to endorse or promote products derived from 152155SN/A# this software without specific prior written permission. 162155SN/A# 172155SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 182155SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 192155SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 202155SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 212155SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 222155SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 232155SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 242155SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 252155SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 262155SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 272155SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 282665Ssaidi@eecs.umich.edu# 292665Ssaidi@eecs.umich.edu# Authors: Steve Reinhardt 302155SN/A 314202Sbinkertn@umich.eduImport('*') 322155SN/A 339850Sandreas.hansson@arm.comif env['TARGET_ISA'] == 'null': 349850Sandreas.hansson@arm.com SimObject('IntrControl.py') 359850Sandreas.hansson@arm.com Source('intr_control_noisa.cc') 367768SAli.Saidi@ARM.com Return() 377768SAli.Saidi@ARM.com 3810695SAli.Saidi@ARM.com################################################################# 3910695SAli.Saidi@ARM.com# 4010695SAli.Saidi@ARM.com# Generate StaticInst execute() method signatures. 4110695SAli.Saidi@ARM.com# 4210695SAli.Saidi@ARM.com# There must be one signature for each CPU model compiled in. 438887Sgeoffrey.blake@arm.com# Since the set of compiled-in models is flexible, we generate a 442766Sktlim@umich.edu# header containing the appropriate set of signatures on the fly. 454486Sbinkertn@umich.edu# 4610663SAli.Saidi@ARM.com################################################################# 474486Sbinkertn@umich.edu 488739Sgblack@eecs.umich.edu# Template for execute() signature. 4910259SAndrew.Bardsley@arm.comexec_sig_template = ''' 504486Sbinkertn@umich.eduvirtual Fault execute(%(type)s *xc, Trace::InstRecord *traceData) const = 0; 514202Sbinkertn@umich.eduvirtual Fault eaComp(%(type)s *xc, Trace::InstRecord *traceData) const 524202Sbinkertn@umich.edu{ panic("eaComp not defined!"); M5_DUMMY_RETURN }; 534202Sbinkertn@umich.eduvirtual Fault initiateAcc(%(type)s *xc, Trace::InstRecord *traceData) const 544202Sbinkertn@umich.edu{ panic("initiateAcc not defined!"); M5_DUMMY_RETURN }; 5510319SAndreas.Sandberg@ARM.comvirtual Fault completeAcc(Packet *pkt, %(type)s *xc, 564202Sbinkertn@umich.edu Trace::InstRecord *traceData) const 574776Sgblack@eecs.umich.edu{ panic("completeAcc not defined!"); M5_DUMMY_RETURN }; 588739Sgblack@eecs.umich.edu''' 596365Sgblack@eecs.umich.edu 604202Sbinkertn@umich.edumem_ini_sig_template = ''' 618777Sgblack@eecs.umich.eduvirtual Fault eaComp(%(type)s *xc, Trace::InstRecord *traceData) const 624202Sbinkertn@umich.edu{ panic("eaComp not defined!"); M5_DUMMY_RETURN }; 639913Ssteve.reinhardt@amd.comvirtual Fault initiateAcc(%s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); M5_DUMMY_RETURN }; 644202Sbinkertn@umich.edu''' 654202Sbinkertn@umich.edu 665217Ssaidi@eecs.umich.edumem_comp_sig_template = ''' 674202Sbinkertn@umich.eduvirtual Fault completeAcc(uint8_t *data, %s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); return NoFault; M5_DUMMY_RETURN }; 6810259SAndrew.Bardsley@arm.com''' 692155SN/A 708887Sgeoffrey.blake@arm.com# Generate a temporary CPU list, including the CheckerCPU if 7110201SAndrew.Bardsley@arm.com# it's enabled. This isn't used for anything else other than StaticInst 728887Sgeoffrey.blake@arm.com# headers. 739340SAndreas.Sandberg@arm.comtemp_cpu_list = env['CPU_MODELS'][:] 748887Sgeoffrey.blake@arm.comtemp_cpu_list.append('CheckerCPU') 755192Ssaidi@eecs.umich.eduSimObject('CheckerCPU.py') 768335Snate@binkert.org 778335Snate@binkert.org# Generate header. 788335Snate@binkert.orgdef gen_cpu_exec_signatures(target, source, env): 798335Snate@binkert.org f = open(str(target[0]), 'w') 808335Snate@binkert.org print >> f, ''' 819534SAndreas.Sandberg@ARM.com#ifndef __CPU_STATIC_INST_EXEC_SIGS_HH__ 829534SAndreas.Sandberg@ARM.com#define __CPU_STATIC_INST_EXEC_SIGS_HH__ 839534SAndreas.Sandberg@ARM.com''' 848335Snate@binkert.org for cpu in temp_cpu_list: 859534SAndreas.Sandberg@ARM.com xc_type = CpuModel.dict[cpu].strings['CPU_exec_context'] 869534SAndreas.Sandberg@ARM.com print >> f, exec_sig_template % { 'type' : xc_type } 878335Snate@binkert.org print >> f, ''' 889534SAndreas.Sandberg@ARM.com#endif // __CPU_STATIC_INST_EXEC_SIGS_HH__ 899534SAndreas.Sandberg@ARM.com''' 909534SAndreas.Sandberg@ARM.com 919534SAndreas.Sandberg@ARM.com# Generate string that gets printed when header is rebuilt 929534SAndreas.Sandberg@ARM.comdef gen_sigs_string(target, source, env): 939534SAndreas.Sandberg@ARM.com return " [GENERATE] static_inst_exec_sigs.hh: " \ 949534SAndreas.Sandberg@ARM.com + ', '.join(temp_cpu_list) 959534SAndreas.Sandberg@ARM.com 969534SAndreas.Sandberg@ARM.com# Add command to generate header to environment. 9710383Smitch.hayenga@arm.comenv.Command('static_inst_exec_sigs.hh', (), 988335Snate@binkert.org Action(gen_cpu_exec_signatures, gen_sigs_string, 998335Snate@binkert.org varlist = temp_cpu_list)) 1008471SGiacomo.Gabrielli@arm.com 1018335Snate@binkert.orgenv.Depends('static_inst_exec_sigs.hh', Value(env['CPU_MODELS'])) 1028335Snate@binkert.org 10310529Smorr@cs.wisc.eduSimObject('BaseCPU.py') 1045192Ssaidi@eecs.umich.eduSimObject('FuncUnit.py') 1058232Snate@binkert.orgSimObject('ExeTracer.py') 1068232Snate@binkert.orgSimObject('IntelTrace.py') 10710664SAli.Saidi@ARM.comSimObject('IntrControl.py') 1088300Schander.sudanthi@arm.comSimObject('NativeTrace.py') 10910383Smitch.hayenga@arm.com 1105192Ssaidi@eecs.umich.eduSource('activity.cc') 11111162Ssteve.reinhardt@amd.comSource('base.cc') 11211162Ssteve.reinhardt@amd.comSource('cpuevent.cc') 11311162Ssteve.reinhardt@amd.comSource('exetrace.cc') 11411162Ssteve.reinhardt@amd.comSource('func_unit.cc') 1158300Schander.sudanthi@arm.comSource('inteltrace.cc') 116Source('intr_control.cc') 117Source('nativetrace.cc') 118Source('pc_event.cc') 119Source('profile.cc') 120Source('quiesce_event.cc') 121Source('reg_class.cc') 122Source('static_inst.cc') 123Source('simple_thread.cc') 124Source('thread_context.cc') 125Source('thread_state.cc') 126 127if env['TARGET_ISA'] == 'sparc': 128 SimObject('LegionTrace.py') 129 Source('legiontrace.cc') 130 131SimObject('DummyChecker.py') 132Source('checker/cpu.cc') 133Source('dummy_checker.cc') 134DebugFlag('Checker') 135 136DebugFlag('Activity') 137DebugFlag('Commit') 138DebugFlag('Context') 139DebugFlag('Decode') 140DebugFlag('DynInst') 141DebugFlag('ExecEnable', 'Filter: Enable exec tracing (no tracing without this)') 142DebugFlag('ExecCPSeq', 'Format: Instruction sequence number') 143DebugFlag('ExecEffAddr', 'Format: Include effective address') 144DebugFlag('ExecFaulting', 'Trace faulting instructions') 145DebugFlag('ExecFetchSeq', 'Format: Fetch sequence number') 146DebugFlag('ExecOpClass', 'Format: Include operand class') 147DebugFlag('ExecRegDelta') 148DebugFlag('ExecResult', 'Format: Include results from execution') 149DebugFlag('ExecSpeculative', 'Format: Include a miss-/speculation flag (-/+)') 150DebugFlag('ExecSymbol', 'Format: Try to include symbol names') 151DebugFlag('ExecThread', 'Format: Include thread ID in trace') 152DebugFlag('ExecTicks', 'Format: Include tick count') 153DebugFlag('ExecMicro', 'Filter: Include microops') 154DebugFlag('ExecMacro', 'Filter: Include macroops') 155DebugFlag('ExecUser', 'Filter: Trace user mode instructions') 156DebugFlag('ExecKernel', 'Filter: Trace kernel mode instructions') 157DebugFlag('ExecAsid', 'Format: Include ASID in trace') 158DebugFlag('Fetch') 159DebugFlag('IntrControl') 160DebugFlag('O3PipeView') 161DebugFlag('PCEvent') 162DebugFlag('Quiesce') 163 164CompoundFlag('ExecAll', [ 'ExecEnable', 'ExecCPSeq', 'ExecEffAddr', 165 'ExecFaulting', 'ExecFetchSeq', 'ExecOpClass', 'ExecRegDelta', 166 'ExecResult', 'ExecSpeculative', 'ExecSymbol', 'ExecThread', 167 'ExecTicks', 'ExecMicro', 'ExecMacro', 'ExecUser', 'ExecKernel', 168 'ExecAsid' ]) 169CompoundFlag('Exec', [ 'ExecEnable', 'ExecTicks', 'ExecOpClass', 'ExecThread', 170 'ExecEffAddr', 'ExecResult', 'ExecSymbol', 'ExecMicro', 'ExecFaulting', 171 'ExecUser', 'ExecKernel' ]) 172CompoundFlag('ExecNoTicks', [ 'ExecEnable', 'ExecOpClass', 'ExecThread', 173 'ExecEffAddr', 'ExecResult', 'ExecMicro', 'ExecFaulting', 174 'ExecUser', 'ExecKernel' ]) 175