SConscript revision 10201
14202Sbinkertn@umich.edu# -*- mode:python -*- 24202Sbinkertn@umich.edu 34202Sbinkertn@umich.edu# Copyright (c) 2006 The Regents of The University of Michigan 44202Sbinkertn@umich.edu# All rights reserved. 54202Sbinkertn@umich.edu# 64202Sbinkertn@umich.edu# Redistribution and use in source and binary forms, with or without 74202Sbinkertn@umich.edu# modification, are permitted provided that the following conditions are 84202Sbinkertn@umich.edu# met: redistributions of source code must retain the above copyright 94202Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer; 104202Sbinkertn@umich.edu# redistributions in binary form must reproduce the above copyright 114202Sbinkertn@umich.edu# notice, this list of conditions and the following disclaimer in the 124202Sbinkertn@umich.edu# documentation and/or other materials provided with the distribution; 134202Sbinkertn@umich.edu# neither the name of the copyright holders nor the names of its 144202Sbinkertn@umich.edu# contributors may be used to endorse or promote products derived from 154202Sbinkertn@umich.edu# this software without specific prior written permission. 164202Sbinkertn@umich.edu# 174202Sbinkertn@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 184202Sbinkertn@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 194202Sbinkertn@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 204202Sbinkertn@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 214202Sbinkertn@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 224202Sbinkertn@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 234202Sbinkertn@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 244202Sbinkertn@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 254202Sbinkertn@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 264202Sbinkertn@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 274202Sbinkertn@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 284202Sbinkertn@umich.edu# 294202Sbinkertn@umich.edu# Authors: Steve Reinhardt 304202Sbinkertn@umich.edu 314202Sbinkertn@umich.eduImport('*') 324202Sbinkertn@umich.edu 335628Sgblack@eecs.umich.eduif env['TARGET_ISA'] == 'null': 349157Sandreas.hansson@arm.com SimObject('IntrControl.py') 354486Sbinkertn@umich.edu Source('intr_control_noisa.cc') 364776Sgblack@eecs.umich.edu Return() 379793Sakash.bagdia@arm.com 389827Sakash.bagdia@arm.com################################################################# 394486Sbinkertn@umich.edu# 408774Sgblack@eecs.umich.edu# Generate StaticInst execute() method signatures. 414202Sbinkertn@umich.edu# 424202Sbinkertn@umich.edu# There must be one signature for each CPU model compiled in. 434202Sbinkertn@umich.edu# Since the set of compiled-in models is flexible, we generate a 444202Sbinkertn@umich.edu# header containing the appropriate set of signatures on the fly. 455522Snate@binkert.org# 468233Snate@binkert.org################################################################# 474202Sbinkertn@umich.edu 484202Sbinkertn@umich.edu# Template for execute() signature. 499342SAndreas.Sandberg@arm.comexec_sig_template = ''' 504202Sbinkertn@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 548770Sgblack@eecs.umich.edu{ panic("initiateAcc not defined!"); M5_DUMMY_RETURN }; 559793Sakash.bagdia@arm.comvirtual Fault completeAcc(Packet *pkt, %(type)s *xc, 569827Sakash.bagdia@arm.com Trace::InstRecord *traceData) const 577768SAli.Saidi@ARM.com{ panic("completeAcc not defined!"); M5_DUMMY_RETURN }; 587768SAli.Saidi@ARM.com''' 598766Sgblack@eecs.umich.edu 607768SAli.Saidi@ARM.commem_ini_sig_template = ''' 617768SAli.Saidi@ARM.comvirtual Fault eaComp(%(type)s *xc, Trace::InstRecord *traceData) const 628766Sgblack@eecs.umich.edu{ panic("eaComp not defined!"); M5_DUMMY_RETURN }; 637768SAli.Saidi@ARM.comvirtual Fault initiateAcc(%s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); M5_DUMMY_RETURN }; 647768SAli.Saidi@ARM.com''' 654202Sbinkertn@umich.edu 668784Sgblack@eecs.umich.edumem_comp_sig_template = ''' 675016Sgblack@eecs.umich.eduvirtual Fault completeAcc(uint8_t *data, %s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); return NoFault; M5_DUMMY_RETURN }; 684486Sbinkertn@umich.edu''' 698335Snate@binkert.org 708335Snate@binkert.org# Generate a temporary CPU list, including the CheckerCPU if 719152Satgutier@umich.edu# it's enabled. This isn't used for anything else other than StaticInst 728335Snate@binkert.org# headers. 738335Snate@binkert.orgtemp_cpu_list = env['CPU_MODELS'][:] 748335Snate@binkert.orgtemp_cpu_list.append('CheckerCPU') 758335Snate@binkert.orgSimObject('CheckerCPU.py') 768335Snate@binkert.org 778335Snate@binkert.org# Generate header. 788335Snate@binkert.orgdef gen_cpu_exec_signatures(target, source, env): 799733Sandreas@sandberg.pp.se f = open(str(target[0]), 'w') 808335Snate@binkert.org print >> f, ''' 818335Snate@binkert.org#ifndef __CPU_STATIC_INST_EXEC_SIGS_HH__ 828335Snate@binkert.org#define __CPU_STATIC_INST_EXEC_SIGS_HH__ 838335Snate@binkert.org''' 848335Snate@binkert.org for cpu in temp_cpu_list: 858335Snate@binkert.org xc_type = CpuModel.dict[cpu].strings['CPU_exec_context'] 868335Snate@binkert.org print >> f, exec_sig_template % { 'type' : xc_type } 878335Snate@binkert.org print >> f, ''' 889793Sakash.bagdia@arm.com#endif // __CPU_STATIC_INST_EXEC_SIGS_HH__ 899827Sakash.bagdia@arm.com''' 90 91# Generate string that gets printed when header is rebuilt 92def gen_sigs_string(target, source, env): 93 return " [GENERATE] static_inst_exec_sigs.hh: " \ 94 + ', '.join(temp_cpu_list) 95 96# Add command to generate header to environment. 97env.Command('static_inst_exec_sigs.hh', (), 98 Action(gen_cpu_exec_signatures, gen_sigs_string, 99 varlist = temp_cpu_list)) 100 101env.Depends('static_inst_exec_sigs.hh', Value(env['CPU_MODELS'])) 102 103SimObject('BaseCPU.py') 104SimObject('FuncUnit.py') 105SimObject('ExeTracer.py') 106SimObject('IntelTrace.py') 107SimObject('IntrControl.py') 108SimObject('NativeTrace.py') 109 110Source('activity.cc') 111Source('base.cc') 112Source('cpuevent.cc') 113Source('exetrace.cc') 114Source('func_unit.cc') 115Source('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') 132SimObject('StaticInstFlags.py') 133Source('checker/cpu.cc') 134Source('dummy_checker.cc') 135DebugFlag('Checker') 136 137DebugFlag('Activity') 138DebugFlag('Commit') 139DebugFlag('Context') 140DebugFlag('Decode') 141DebugFlag('DynInst') 142DebugFlag('ExecEnable', 'Filter: Enable exec tracing (no tracing without this)') 143DebugFlag('ExecCPSeq', 'Format: Instruction sequence number') 144DebugFlag('ExecEffAddr', 'Format: Include effective address') 145DebugFlag('ExecFaulting', 'Trace faulting instructions') 146DebugFlag('ExecFetchSeq', 'Format: Fetch sequence number') 147DebugFlag('ExecOpClass', 'Format: Include operand class') 148DebugFlag('ExecRegDelta') 149DebugFlag('ExecResult', 'Format: Include results from execution') 150DebugFlag('ExecSpeculative', 'Format: Include a miss-/speculation flag (-/+)') 151DebugFlag('ExecSymbol', 'Format: Try to include symbol names') 152DebugFlag('ExecThread', 'Format: Include thread ID in trace') 153DebugFlag('ExecTicks', 'Format: Include tick count') 154DebugFlag('ExecMicro', 'Filter: Include microops') 155DebugFlag('ExecMacro', 'Filter: Include macroops') 156DebugFlag('ExecUser', 'Filter: Trace user mode instructions') 157DebugFlag('ExecKernel', 'Filter: Trace kernel mode instructions') 158DebugFlag('ExecAsid', 'Format: Include ASID in trace') 159DebugFlag('Fetch') 160DebugFlag('IntrControl') 161DebugFlag('O3PipeView') 162DebugFlag('PCEvent') 163DebugFlag('Quiesce') 164 165CompoundFlag('ExecAll', [ 'ExecEnable', 'ExecCPSeq', 'ExecEffAddr', 166 'ExecFaulting', 'ExecFetchSeq', 'ExecOpClass', 'ExecRegDelta', 167 'ExecResult', 'ExecSpeculative', 'ExecSymbol', 'ExecThread', 168 'ExecTicks', 'ExecMicro', 'ExecMacro', 'ExecUser', 'ExecKernel', 169 'ExecAsid' ]) 170CompoundFlag('Exec', [ 'ExecEnable', 'ExecTicks', 'ExecOpClass', 'ExecThread', 171 'ExecEffAddr', 'ExecResult', 'ExecSymbol', 'ExecMicro', 'ExecFaulting', 172 'ExecUser', 'ExecKernel' ]) 173CompoundFlag('ExecNoTicks', [ 'ExecEnable', 'ExecOpClass', 'ExecThread', 174 'ExecEffAddr', 'ExecResult', 'ExecMicro', 'ExecFaulting', 175 'ExecUser', 'ExecKernel' ]) 176