SConscript (6667:8b5bc1a777bc) | SConscript (6994:c6951099a1cb) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2006 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35# Generate StaticInst execute() method signatures. 36# 37# There must be one signature for each CPU model compiled in. 38# Since the set of compiled-in models is flexible, we generate a 39# header containing the appropriate set of signatures on the fly. 40# 41################################################################# 42 | 1# -*- mode:python -*- 2 3# Copyright (c) 2006 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 26 unchanged lines hidden (view full) --- 35# Generate StaticInst execute() method signatures. 36# 37# There must be one signature for each CPU model compiled in. 38# Since the set of compiled-in models is flexible, we generate a 39# header containing the appropriate set of signatures on the fly. 40# 41################################################################# 42 |
43# CPU model-specific data is contained in cpu_models.py 44# Convert to SCons File node to get path handling 45models_db = File('cpu_models.py') 46# slurp in contents of file 47execfile(models_db.srcnode().abspath) 48 | |
49# Template for execute() signature. 50exec_sig_template = ''' 51virtual Fault execute(%(type)s *xc, Trace::InstRecord *traceData) const = 0; 52virtual Fault eaComp(%(type)s *xc, Trace::InstRecord *traceData) const 53{ panic("eaComp not defined!"); M5_DUMMY_RETURN }; 54virtual Fault initiateAcc(%(type)s *xc, Trace::InstRecord *traceData) const 55{ panic("initiateAcc not defined!"); M5_DUMMY_RETURN }; 56virtual Fault completeAcc(Packet *pkt, %(type)s *xc, --- 35 unchanged lines hidden (view full) --- 92''' 93 94# Generate string that gets printed when header is rebuilt 95def gen_sigs_string(target, source, env): 96 return "Generating static_inst_exec_sigs.hh: " \ 97 + ', '.join(temp_cpu_list) 98 99# Add command to generate header to environment. | 43# Template for execute() signature. 44exec_sig_template = ''' 45virtual Fault execute(%(type)s *xc, Trace::InstRecord *traceData) const = 0; 46virtual Fault eaComp(%(type)s *xc, Trace::InstRecord *traceData) const 47{ panic("eaComp not defined!"); M5_DUMMY_RETURN }; 48virtual Fault initiateAcc(%(type)s *xc, Trace::InstRecord *traceData) const 49{ panic("initiateAcc not defined!"); M5_DUMMY_RETURN }; 50virtual Fault completeAcc(Packet *pkt, %(type)s *xc, --- 35 unchanged lines hidden (view full) --- 86''' 87 88# Generate string that gets printed when header is rebuilt 89def gen_sigs_string(target, source, env): 90 return "Generating static_inst_exec_sigs.hh: " \ 91 + ', '.join(temp_cpu_list) 92 93# Add command to generate header to environment. |
100env.Command('static_inst_exec_sigs.hh', models_db, | 94env.Command('static_inst_exec_sigs.hh', (), |
101 Action(gen_cpu_exec_signatures, gen_sigs_string, 102 varlist = temp_cpu_list)) 103 104env.Depends('static_inst_exec_sigs.hh', Value(env['USE_CHECKER'])) 105env.Depends('static_inst_exec_sigs.hh', Value(env['CPU_MODELS'])) 106 107# List of suppported CPUs by the Checker. Errors out if USE_CHECKER=True 108# and one of these are not being used. --- 74 unchanged lines hidden --- | 95 Action(gen_cpu_exec_signatures, gen_sigs_string, 96 varlist = temp_cpu_list)) 97 98env.Depends('static_inst_exec_sigs.hh', Value(env['USE_CHECKER'])) 99env.Depends('static_inst_exec_sigs.hh', Value(env['CPU_MODELS'])) 100 101# List of suppported CPUs by the Checker. Errors out if USE_CHECKER=True 102# and one of these are not being used. --- 74 unchanged lines hidden --- |