1# Copyright (c) 2015 Advanced Micro Devices, Inc. 2# All rights reserved 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 46 unchanged lines hidden (view full) --- 55def config_filesystem(options): 56 fsdir = joinpath(m5.options.outdir, 'fs') 57 replace_tree(fsdir) 58 59 # Set up /proc 60 procdir = joinpath(fsdir, 'proc') 61 mkdir(procdir) 62 |
63 cpu_clock = '0' 64 if hasattr(options, 'cpu_clock'): 65 cpu_clock = options.cpu_clock 66 cpu_clock = toFrequency(cpu_clock)/mega 67 68 l2_size = '0' 69 if hasattr(options, 'l2_size'): 70 l2_size = options.l2_size 71 l2_size = toMemorySize(l2_size)/kibi 72 73 cacheline_size = '0' 74 if hasattr(options, 'cacheline_size'): 75 cacheline_size = options.cacheline_size 76 |
77 for i in xrange(options.num_cpus): 78 one_cpu = 'processor : %d\n' % (i) + \ 79 'vendor_id : Generic\n' + \ 80 'cpu family : 0\n' + \ 81 'model : 0\n' + \ 82 'model name : Generic\n' + \ 83 'stepping : 0\n' + \ 84 'cpu MHz : %0.3d\n' \ |
85 % cpu_clock + \ |
86 'cache size: : %dK\n' \ |
87 % l2_size + \ |
88 'physical id : 0\n' + \ 89 'siblings : %s\n' \ 90 % options.num_cpus + \ 91 'core id : %d\n' \ 92 % i + \ 93 'cpu cores : %d\n' \ 94 % options.num_cpus + \ 95 'fpu : yes\n' + \ 96 'fpu exception : yes\n' + \ 97 'cpuid level : 1\n' + \ 98 'wp : yes\n' + \ 99 'flags : fpu\n' + \ 100 'cache alignment : %d\n' \ |
101 % cacheline_size + \ |
102 '\n' 103 file_append((procdir, 'cpuinfo'), one_cpu) 104 105 file_append((procdir, 'stat'), 'cpu 0 0 0 0 0 0 0\n') 106 for i in xrange(options.num_cpus): 107 file_append((procdir, 'stat'), 'cpu%d 0 0 0 0 0 0 0\n' % i) 108 109 # Set up /sys --- 80 unchanged lines hidden --- |