SConscript (2765:2962455d1c0a) | SConscript (2766:0844a9607f77) |
---|---|
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 --- 54 unchanged lines hidden (view full) --- 63mem_ini_sig_template = ''' 64virtual Fault initiateAcc(%s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); }; 65''' 66 67mem_comp_sig_template = ''' 68virtual Fault completeAcc(uint8_t *data, %s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); return NoFault; }; 69''' 70 | 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 --- 54 unchanged lines hidden (view full) --- 63mem_ini_sig_template = ''' 64virtual Fault initiateAcc(%s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); }; 65''' 66 67mem_comp_sig_template = ''' 68virtual Fault completeAcc(uint8_t *data, %s *xc, Trace::InstRecord *traceData) const { panic("Not defined!"); return NoFault; }; 69''' 70 |
71# Generate a temporary CPU list, including the CheckerCPU if 72# it's enabled. This isn't used for anything else other than StaticInst 73# headers. 74temp_cpu_list = env['CPU_MODELS'] 75if env['USE_CHECKER']: 76 temp_cpu_list.append('CheckerCPU') 77 |
|
71# Generate header. 72def gen_cpu_exec_signatures(target, source, env): 73 f = open(str(target[0]), 'w') 74 print >> f, ''' 75#ifndef __CPU_STATIC_INST_EXEC_SIGS_HH__ 76#define __CPU_STATIC_INST_EXEC_SIGS_HH__ 77''' | 78# Generate header. 79def gen_cpu_exec_signatures(target, source, env): 80 f = open(str(target[0]), 'w') 81 print >> f, ''' 82#ifndef __CPU_STATIC_INST_EXEC_SIGS_HH__ 83#define __CPU_STATIC_INST_EXEC_SIGS_HH__ 84''' |
78 for cpu in env['CPU_MODELS']: | 85 for cpu in temp_cpu_list: |
79 xc_type = CpuModel.dict[cpu].strings['CPU_exec_context'] 80 print >> f, exec_sig_template % (xc_type, xc_type, xc_type) 81 print >> f, ''' 82#endif // __CPU_STATIC_INST_EXEC_SIGS_HH__ 83''' 84 85# Generate string that gets printed when header is rebuilt 86def gen_sigs_string(target, source, env): 87 return "Generating static_inst_exec_sigs.hh: " \ | 86 xc_type = CpuModel.dict[cpu].strings['CPU_exec_context'] 87 print >> f, exec_sig_template % (xc_type, xc_type, xc_type) 88 print >> f, ''' 89#endif // __CPU_STATIC_INST_EXEC_SIGS_HH__ 90''' 91 92# Generate string that gets printed when header is rebuilt 93def gen_sigs_string(target, source, env): 94 return "Generating static_inst_exec_sigs.hh: " \ |
88 + ', '.join(env['CPU_MODELS']) | 95 + ', '.join(temp_cpu_list) |
89 90# Add command to generate header to environment. 91env.Command('static_inst_exec_sigs.hh', models_db, 92 Action(gen_cpu_exec_signatures, gen_sigs_string, | 96 97# Add command to generate header to environment. 98env.Command('static_inst_exec_sigs.hh', models_db, 99 Action(gen_cpu_exec_signatures, gen_sigs_string, |
93 varlist = ['CPU_MODELS'])) | 100 varlist = temp_cpu_list)) |
94 | 101 |
102env.Depends('static_inst_exec_sigs.hh', Value(env['USE_CHECKER'])) 103 |
|
95# List of suppported CPUs by the Checker. Errors out if USE_CHECKER=True 96# and one of these are not being used. 97CheckerSupportedCPUList = ['AlphaO3CPU', 'OzoneCPU'] 98 99################################################################# 100# 101# Include CPU-model-specific files based on set of models 102# specified in CPU_MODELS build option. --- 40 unchanged lines hidden (view full) --- 143 o3/ras.cc 144 o3/rename.cc 145 o3/rename_map.cc 146 o3/rob.cc 147 o3/scoreboard.cc 148 o3/store_set.cc 149 o3/tournament_pred.cc 150 ''') | 104# List of suppported CPUs by the Checker. Errors out if USE_CHECKER=True 105# and one of these are not being used. 106CheckerSupportedCPUList = ['AlphaO3CPU', 'OzoneCPU'] 107 108################################################################# 109# 110# Include CPU-model-specific files based on set of models 111# specified in CPU_MODELS build option. --- 40 unchanged lines hidden (view full) --- 152 o3/ras.cc 153 o3/rename.cc 154 o3/rename_map.cc 155 o3/rob.cc 156 o3/scoreboard.cc 157 o3/store_set.cc 158 o3/tournament_pred.cc 159 ''') |
151 if 'CheckerCPU' in env['CPU_MODELS']: | 160 if env['USE_CHECKER']: |
152 sources += Split('o3/checker_builder.cc') 153 154if 'OzoneSimpleCPU' in env['CPU_MODELS']: 155 sources += Split(''' 156 ozone/cpu.cc 157 ozone/cpu_builder.cc 158 ozone/dyn_inst.cc 159 ozone/front_end.cc --- 5 unchanged lines hidden (view full) --- 165if 'OzoneCPU' in env['CPU_MODELS']: 166 sources += Split(''' 167 ozone/base_dyn_inst.cc 168 ozone/bpred_unit.cc 169 ozone/lsq_unit.cc 170 ozone/lw_back_end.cc 171 ozone/lw_lsq.cc 172 ''') | 161 sources += Split('o3/checker_builder.cc') 162 163if 'OzoneSimpleCPU' in env['CPU_MODELS']: 164 sources += Split(''' 165 ozone/cpu.cc 166 ozone/cpu_builder.cc 167 ozone/dyn_inst.cc 168 ozone/front_end.cc --- 5 unchanged lines hidden (view full) --- 174if 'OzoneCPU' in env['CPU_MODELS']: 175 sources += Split(''' 176 ozone/base_dyn_inst.cc 177 ozone/bpred_unit.cc 178 ozone/lsq_unit.cc 179 ozone/lw_back_end.cc 180 ozone/lw_lsq.cc 181 ''') |
173 if 'CheckerCPU' in env['CPU_MODELS']: | 182 if env['USE_CHECKER']: |
174 sources += Split('ozone/checker_builder.cc') 175 | 183 sources += Split('ozone/checker_builder.cc') 184 |
176if 'CheckerCPU' in env['CPU_MODELS']: | 185if env['USE_CHECKER']: |
177 checker_supports = False 178 for i in CheckerSupportedCPUList: 179 if i in env['CPU_MODELS']: 180 checker_supports = True 181 if not checker_supports: 182 print "Checker only supports CPU models %s, please " \ 183 "set USE_CHECKER=False or use one of those CPU models" \ 184 % CheckerSupportedCPUList --- 12 unchanged lines hidden --- | 186 checker_supports = False 187 for i in CheckerSupportedCPUList: 188 if i in env['CPU_MODELS']: 189 checker_supports = True 190 if not checker_supports: 191 print "Checker only supports CPU models %s, please " \ 192 "set USE_CHECKER=False or use one of those CPU models" \ 193 % CheckerSupportedCPUList --- 12 unchanged lines hidden --- |