Merge zizzer.eecs.umich.edu:/bk/newmem/

into  zeep.eecs.umich.edu:/home/gblack/m5/newmemmemops

--HG--
extra : convert_revision : c2f7398a0d14dd11108579bb243ada7420285a22
This commit is contained in:
Gabe Black 2006-11-01 19:00:59 -05:00
commit b565660c42
53 changed files with 156 additions and 229 deletions

View file

@ -53,27 +53,27 @@ def run(options, root, testsys):
if options.standard_switch: if options.standard_switch:
switch_cpus = [TimingSimpleCPU(defer_registration=True, cpu_id=(np+i)) switch_cpus = [TimingSimpleCPU(defer_registration=True, cpu_id=(np+i))
for i in xrange(np)] for i in xrange(np)]
switch_cpus1 = [DerivO3CPU(defer_registration=True, cpu_id=(2*np+i)) switch_cpus_1 = [DerivO3CPU(defer_registration=True, cpu_id=(2*np+i))
for i in xrange(np)] for i in xrange(np)]
for i in xrange(np): for i in xrange(np):
switch_cpus[i].system = testsys switch_cpus[i].system = testsys
switch_cpus1[i].system = testsys switch_cpus_1[i].system = testsys
if not m5.build_env['FULL_SYSTEM']: if not m5.build_env['FULL_SYSTEM']:
switch_cpus[i].workload = testsys.cpu[i].workload switch_cpus[i].workload = testsys.cpu[i].workload
switch_cpus1[i].workload = testsys.cpu[i].workload switch_cpus_1[i].workload = testsys.cpu[i].workload
switch_cpus[i].clock = testsys.cpu[0].clock switch_cpus[i].clock = testsys.cpu[0].clock
switch_cpus1[i].clock = testsys.cpu[0].clock switch_cpus_1[i].clock = testsys.cpu[0].clock
if options.caches: if options.caches:
switch_cpus[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'), switch_cpus[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'),
L1Cache(size = '64kB')) L1Cache(size = '64kB'))
switch_cpus[i].mem = testsys.physmem
switch_cpus1[i].mem = testsys.physmem
switch_cpus[i].connectMemPorts(testsys.membus) switch_cpus[i].connectMemPorts(testsys.membus)
root.switch_cpus = switch_cpus root.switch_cpus = switch_cpus
root.switch_cpus1 = switch_cpus1 root.switch_cpus_1 = switch_cpus_1
switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)] switch_cpu_list = [(testsys.cpu[i], switch_cpus[i]) for i in xrange(np)]
switch_cpu_list1 = [(switch_cpus[i], switch_cpus1[i]) for i in xrange(np)] switch_cpu_list1 = [(switch_cpus[i], switch_cpus_1[i]) for i in xrange(np)]
m5.instantiate(root) m5.instantiate(root)

View file

@ -107,13 +107,11 @@ for i in xrange(np):
test_sys.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'), test_sys.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'),
L1Cache(size = '64kB')) L1Cache(size = '64kB'))
test_sys.cpu[i].connectMemPorts(test_sys.membus) test_sys.cpu[i].connectMemPorts(test_sys.membus)
test_sys.cpu[i].mem = test_sys.physmem
if len(bm) == 2: if len(bm) == 2:
drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1]) drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1])
drive_sys.cpu = DriveCPUClass(cpu_id=0) drive_sys.cpu = DriveCPUClass(cpu_id=0)
drive_sys.cpu.connectMemPorts(drive_sys.membus) drive_sys.cpu.connectMemPorts(drive_sys.membus)
drive_sys.cpu.mem = drive_sys.physmem
root = makeDualRoot(test_sys, drive_sys, options.etherdump) root = makeDualRoot(test_sys, drive_sys, options.etherdump)
elif len(bm) == 1: elif len(bm) == 1:
root = Root(clock = '1THz', system = test_sys) root = Root(clock = '1THz', system = test_sys)

View file

@ -41,10 +41,6 @@ from Caches import *
config_path = os.path.dirname(os.path.abspath(__file__)) config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path) config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(config_root) m5_root = os.path.dirname(config_root)
print m5_root
print config_path
print config_root
parser = optparse.OptionParser() parser = optparse.OptionParser()
@ -118,7 +114,6 @@ for i in xrange(np):
system.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'), system.cpu[i].addPrivateSplitL1Caches(L1Cache(size = '32kB'),
L1Cache(size = '64kB')) L1Cache(size = '64kB'))
system.cpu[i].connectMemPorts(system.membus) system.cpu[i].connectMemPorts(system.membus)
system.cpu[i].mem = system.physmem
system.cpu[i].workload = process system.cpu[i].workload = process
root = Root(system = system) root = Root(system = system)

View file

@ -72,6 +72,12 @@ CheckerCPU::CheckerCPU(Params *p)
systemPtr = NULL; systemPtr = NULL;
#else #else
process = p->process; process = p->process;
thread = new SimpleThread(this, /* thread_num */ 0, process,
/* asid */ 0);
thread->setStatus(ThreadContext::Suspended);
tc = thread->getTC();
threadContexts.push_back(tc);
#endif #endif
result.integer = 0; result.integer = 0;
@ -81,20 +87,6 @@ CheckerCPU::~CheckerCPU()
{ {
} }
void
CheckerCPU::setMemory(MemObject *mem)
{
#if !FULL_SYSTEM
memPtr = mem;
thread = new SimpleThread(this, /* thread_num */ 0, process,
/* asid */ 0, mem);
thread->setStatus(ThreadContext::Suspended);
tc = thread->getTC();
threadContexts.push_back(tc);
#endif
}
void void
CheckerCPU::setSystem(System *system) CheckerCPU::setSystem(System *system)
{ {

View file

@ -115,10 +115,6 @@ class CheckerCPU : public BaseCPU
Process *process; Process *process;
void setMemory(MemObject *mem);
MemObject *memPtr;
void setSystem(System *system); void setSystem(System *system);
System *systemPtr; System *systemPtr;

View file

@ -97,7 +97,7 @@ class MemTest : public MemObject
public: public:
CpuPort(const std::string &_name, MemTest *_memtest) CpuPort(const std::string &_name, MemTest *_memtest)
: Port(_name), memtest(_memtest) : Port(_name, _memtest), memtest(_memtest)
{ } { }
protected: protected:

View file

@ -61,8 +61,6 @@ Param<Tick> profile;
SimObjectVectorParam<Process *> workload; SimObjectVectorParam<Process *> workload;
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
SimObjectParam<MemObject *> mem;
SimObjectParam<BaseCPU *> checker; SimObjectParam<BaseCPU *> checker;
Param<Counter> max_insts_any_thread; Param<Counter> max_insts_any_thread;
@ -169,8 +167,6 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DerivO3CPU)
INIT_PARAM(workload, "Processes to run"), INIT_PARAM(workload, "Processes to run"),
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
INIT_PARAM(mem, "Memory"),
INIT_PARAM_DFLT(checker, "Checker CPU", NULL), INIT_PARAM_DFLT(checker, "Checker CPU", NULL),
INIT_PARAM_DFLT(max_insts_any_thread, INIT_PARAM_DFLT(max_insts_any_thread,
@ -314,8 +310,6 @@ CREATE_SIM_OBJECT(DerivO3CPU)
params->workload = workload; params->workload = workload;
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
params->mem = mem;
params->checker = checker; params->checker = checker;
params->max_insts_any_thread = max_insts_any_thread; params->max_insts_any_thread = max_insts_any_thread;

View file

@ -77,24 +77,10 @@ AlphaO3CPU<Impl>::AlphaO3CPU(Params *params)
if (i < params->workload.size()) { if (i < params->workload.size()) {
DPRINTF(O3CPU, "Workload[%i] process is %#x", DPRINTF(O3CPU, "Workload[%i] process is %#x",
i, this->thread[i]); i, this->thread[i]);
this->thread[i] = new Thread(this, i, params->workload[i], this->thread[i] = new Thread(this, i, params->workload[i], i);
i, params->mem);
this->thread[i]->setStatus(ThreadContext::Suspended); this->thread[i]->setStatus(ThreadContext::Suspended);
#if !FULL_SYSTEM
/* Use this port to for syscall emulation writes to memory. */
Port *mem_port;
TranslatingPort *trans_port;
trans_port = new TranslatingPort(csprintf("%s-%d-funcport",
name(), i),
params->workload[i]->pTable,
false);
mem_port = params->mem->getPort("functional");
mem_port->setPeer(trans_port);
trans_port->setPeer(mem_port);
this->thread[i]->setMemPort(trans_port);
#endif
//usedTids[i] = true; //usedTids[i] = true;
//threadMap[i] = i; //threadMap[i] = i;
} else { } else {
@ -102,7 +88,7 @@ AlphaO3CPU<Impl>::AlphaO3CPU(Params *params)
//when scheduling threads to CPU //when scheduling threads to CPU
Process* dummy_proc = NULL; Process* dummy_proc = NULL;
this->thread[i] = new Thread(this, i, dummy_proc, i, params->mem); this->thread[i] = new Thread(this, i, dummy_proc, i);
//usedTids[i] = false; //usedTids[i] = false;
} }
#endif // !FULL_SYSTEM #endif // !FULL_SYSTEM

View file

@ -187,7 +187,6 @@ FullO3CPU<Impl>::FullO3CPU(Params *params)
system(params->system), system(params->system),
physmem(system->physmem), physmem(system->physmem),
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
mem(params->mem),
drainCount(0), drainCount(0),
deferRegistration(params->deferRegistration), deferRegistration(params->deferRegistration),
numThreads(number_of_threads) numThreads(number_of_threads)
@ -204,7 +203,6 @@ FullO3CPU<Impl>::FullO3CPU(Params *params)
#if USE_CHECKER #if USE_CHECKER
BaseCPU *temp_checker = params->checker; BaseCPU *temp_checker = params->checker;
checker = dynamic_cast<Checker<DynInstPtr> *>(temp_checker); checker = dynamic_cast<Checker<DynInstPtr> *>(temp_checker);
checker->setMemory(mem);
#if FULL_SYSTEM #if FULL_SYSTEM
checker->setSystem(params->system); checker->setSystem(params->system);
#endif #endif

View file

@ -620,9 +620,6 @@ class FullO3CPU : public BaseO3CPU
PhysicalMemory *physmem; PhysicalMemory *physmem;
#endif #endif
/** Pointer to memory. */
MemObject *mem;
/** Event to call process() on once draining has completed. */ /** Event to call process() on once draining has completed. */
Event *drainEvent; Event *drainEvent;

View file

@ -329,8 +329,6 @@ class DefaultFetch
/** Wire used to write any information heading to decode. */ /** Wire used to write any information heading to decode. */
typename TimeBuffer<FetchStruct>::wire toDecode; typename TimeBuffer<FetchStruct>::wire toDecode;
MemObject *mem;
/** Icache interface. */ /** Icache interface. */
IcachePort *icachePort; IcachePort *icachePort;

View file

@ -96,8 +96,7 @@ DefaultFetch<Impl>::IcachePort::recvRetry()
template<class Impl> template<class Impl>
DefaultFetch<Impl>::DefaultFetch(Params *params) DefaultFetch<Impl>::DefaultFetch(Params *params)
: mem(params->mem), : branchPred(params),
branchPred(params),
decodeToFetchDelay(params->decodeToFetchDelay), decodeToFetchDelay(params->decodeToFetchDelay),
renameToFetchDelay(params->renameToFetchDelay), renameToFetchDelay(params->renameToFetchDelay),
iewToFetchDelay(params->iewToFetchDelay), iewToFetchDelay(params->iewToFetchDelay),

View file

@ -54,8 +54,6 @@ Param<int> activity;
SimObjectVectorParam<Process *> workload; SimObjectVectorParam<Process *> workload;
SimObjectParam<MemObject *> mem;
SimObjectParam<BaseCPU *> checker; SimObjectParam<BaseCPU *> checker;
Param<Counter> max_insts_any_thread; Param<Counter> max_insts_any_thread;
@ -153,8 +151,6 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DerivO3CPU)
INIT_PARAM(workload, "Processes to run"), INIT_PARAM(workload, "Processes to run"),
INIT_PARAM(mem, "Memory"),
INIT_PARAM_DFLT(checker, "Checker CPU", NULL), INIT_PARAM_DFLT(checker, "Checker CPU", NULL),
INIT_PARAM_DFLT(max_insts_any_thread, INIT_PARAM_DFLT(max_insts_any_thread,
@ -284,8 +280,6 @@ CREATE_SIM_OBJECT(DerivO3CPU)
params->workload = workload; params->workload = workload;
params->mem = mem;
params->checker = checker; params->checker = checker;
params->max_insts_any_thread = max_insts_any_thread; params->max_insts_any_thread = max_insts_any_thread;

View file

@ -58,24 +58,10 @@ MipsO3CPU<Impl>::MipsO3CPU(Params *params)
if (i < params->workload.size()) { if (i < params->workload.size()) {
DPRINTF(O3CPU, "Workload[%i] process is %#x", DPRINTF(O3CPU, "Workload[%i] process is %#x",
i, this->thread[i]); i, this->thread[i]);
this->thread[i] = new Thread(this, i, params->workload[i], this->thread[i] = new Thread(this, i, params->workload[i], i);
i, params->mem);
this->thread[i]->setStatus(ThreadContext::Suspended); this->thread[i]->setStatus(ThreadContext::Suspended);
/* Use this port to for syscall emulation writes to memory. */
Port *mem_port;
TranslatingPort *trans_port;
trans_port = new TranslatingPort(csprintf("%s-%d-funcport",
name(), i),
params->workload[i]->pTable,
false);
mem_port = params->mem->getPort("functional");
mem_port->setPeer(trans_port);
trans_port->setPeer(mem_port);
this->thread[i]->setMemPort(trans_port);
//usedTids[i] = true; //usedTids[i] = true;
//threadMap[i] = i; //threadMap[i] = i;
} else { } else {
@ -83,7 +69,7 @@ MipsO3CPU<Impl>::MipsO3CPU(Params *params)
//when scheduling threads to CPU //when scheduling threads to CPU
Process* dummy_proc = NULL; Process* dummy_proc = NULL;
this->thread[i] = new Thread(this, i, dummy_proc, i, params->mem); this->thread[i] = new Thread(this, i, dummy_proc, i);
//usedTids[i] = false; //usedTids[i] = false;
} }

View file

@ -54,8 +54,6 @@ class O3Params : public BaseO3CPU::Params
Process *process; Process *process;
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
MemObject *mem;
BaseCPU *checker; BaseCPU *checker;
// //

View file

@ -77,7 +77,7 @@ struct O3ThreadState : public ThreadState {
#if FULL_SYSTEM #if FULL_SYSTEM
O3ThreadState(O3CPU *_cpu, int _thread_num) O3ThreadState(O3CPU *_cpu, int _thread_num)
: ThreadState(-1, _thread_num), : ThreadState(_cpu, -1, _thread_num),
cpu(_cpu), inSyscall(0), trapPending(0) cpu(_cpu), inSyscall(0), trapPending(0)
{ {
if (cpu->params->profile) { if (cpu->params->profile) {
@ -95,9 +95,8 @@ struct O3ThreadState : public ThreadState {
profilePC = 3; profilePC = 3;
} }
#else #else
O3ThreadState(O3CPU *_cpu, int _thread_num, Process *_process, int _asid, O3ThreadState(O3CPU *_cpu, int _thread_num, Process *_process, int _asid)
MemObject *mem) : ThreadState(_cpu, -1, _thread_num, _process, _asid),
: ThreadState(-1, _thread_num, _process, _asid, mem),
cpu(_cpu), inSyscall(0), trapPending(0) cpu(_cpu), inSyscall(0), trapPending(0)
{ } { }
#endif #endif

View file

@ -371,8 +371,6 @@ class OzoneCPU : public BaseCPU
virtual Port *getPort(const std::string &name, int idx); virtual Port *getPort(const std::string &name, int idx);
MemObject *mem;
FrontEnd *frontEnd; FrontEnd *frontEnd;
BackEnd *backEnd; BackEnd *backEnd;

View file

@ -69,8 +69,6 @@ SimObjectVectorParam<Process *> workload;
//SimObjectParam<PageTable *> page_table; //SimObjectParam<PageTable *> page_table;
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
SimObjectParam<MemObject *> mem;
SimObjectParam<BaseCPU *> checker; SimObjectParam<BaseCPU *> checker;
Param<Counter> max_insts_any_thread; Param<Counter> max_insts_any_thread;
@ -191,8 +189,6 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DerivOzoneCPU)
// INIT_PARAM(page_table, "Page table"), // INIT_PARAM(page_table, "Page table"),
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
INIT_PARAM_DFLT(mem, "Memory", NULL),
INIT_PARAM_DFLT(checker, "Checker CPU", NULL), INIT_PARAM_DFLT(checker, "Checker CPU", NULL),
INIT_PARAM_DFLT(max_insts_any_thread, INIT_PARAM_DFLT(max_insts_any_thread,
@ -350,7 +346,6 @@ CREATE_SIM_OBJECT(DerivOzoneCPU)
// params->pTable = page_table; // params->pTable = page_table;
#endif // FULL_SYSTEM #endif // FULL_SYSTEM
params->mem = mem;
params->checker = checker; params->checker = checker;
params->max_insts_any_thread = max_insts_any_thread; params->max_insts_any_thread = max_insts_any_thread;
params->max_insts_all_threads = max_insts_all_threads; params->max_insts_all_threads = max_insts_all_threads;

View file

@ -93,10 +93,10 @@ OzoneCPU<Impl>::OzoneCPU(Params *p)
#if FULL_SYSTEM #if FULL_SYSTEM
: BaseCPU(p), thread(this, 0), tickEvent(this, p->width), : BaseCPU(p), thread(this, 0), tickEvent(this, p->width),
#else #else
: BaseCPU(p), thread(this, 0, p->workload[0], 0, p->mem), : BaseCPU(p), thread(this, 0, p->workload[0], 0),
tickEvent(this, p->width), tickEvent(this, p->width),
#endif #endif
mem(p->mem), comm(5, 5) comm(5, 5)
{ {
frontEnd = new FrontEnd(p); frontEnd = new FrontEnd(p);
backEnd = new BackEnd(p); backEnd = new BackEnd(p);
@ -107,7 +107,6 @@ OzoneCPU<Impl>::OzoneCPU(Params *p)
#if USE_CHECKER #if USE_CHECKER
BaseCPU *temp_checker = p->checker; BaseCPU *temp_checker = p->checker;
checker = dynamic_cast<Checker<DynInstPtr> *>(temp_checker); checker = dynamic_cast<Checker<DynInstPtr> *>(temp_checker);
checker->setMemory(mem);
#if FULL_SYSTEM #if FULL_SYSTEM
checker->setSystem(p->system); checker->setSystem(p->system);
#endif #endif
@ -198,19 +197,7 @@ OzoneCPU<Impl>::OzoneCPU(Params *p)
frontEnd->renameTable.copyFrom(thread.renameTable); frontEnd->renameTable.copyFrom(thread.renameTable);
backEnd->renameTable.copyFrom(thread.renameTable); backEnd->renameTable.copyFrom(thread.renameTable);
#if !FULL_SYSTEM #if FULL_SYSTEM
/* Use this port to for syscall emulation writes to memory. */
Port *mem_port;
TranslatingPort *trans_port;
trans_port = new TranslatingPort(csprintf("%s-%d-funcport",
name(), 0),
p->workload[0]->pTable,
false);
mem_port = p->mem->getPort("functional");
mem_port->setPeer(trans_port);
trans_port->setPeer(mem_port);
thread.setMemPort(trans_port);
#else
Port *mem_port; Port *mem_port;
FunctionalPort *phys_port; FunctionalPort *phys_port;
VirtualPort *virt_port; VirtualPort *virt_port;

View file

@ -208,8 +208,6 @@ class FrontEnd
IcachePort icachePort; IcachePort icachePort;
MemObject *mem;
RequestPtr memReq; RequestPtr memReq;
/** Mask to get a cache block's address. */ /** Mask to get a cache block's address. */

View file

@ -91,7 +91,6 @@ template <class Impl>
FrontEnd<Impl>::FrontEnd(Params *params) FrontEnd<Impl>::FrontEnd(Params *params)
: branchPred(params), : branchPred(params),
icachePort(this), icachePort(this),
mem(params->mem),
numInstsReady(params->frontEndLatency, 0), numInstsReady(params->frontEndLatency, 0),
instBufferSize(0), instBufferSize(0),
maxInstBufferSize(params->maxInstBufferSize), maxInstBufferSize(params->maxInstBufferSize),

View file

@ -239,8 +239,6 @@ class OzoneLWLSQ {
/** Pointer to the back-end stage. */ /** Pointer to the back-end stage. */
BackEnd *be; BackEnd *be;
MemObject *mem;
class DcachePort : public Port class DcachePort : public Port
{ {
protected: protected:

View file

@ -154,8 +154,6 @@ OzoneLWLSQ<Impl>::init(Params *params, unsigned maxLQEntries,
SQIndices.push(i); SQIndices.push(i);
} }
mem = params->mem;
usedPorts = 0; usedPorts = 0;
cachePorts = params->cachePorts; cachePorts = params->cachePorts;

View file

@ -64,8 +64,6 @@ class SimpleParams : public BaseCPU::Params
//Page Table //Page Table
PageTable *pTable; PageTable *pTable;
MemObject *mem;
// //
// Caches // Caches
// //

View file

@ -67,7 +67,7 @@ struct OzoneThreadState : public ThreadState {
#if FULL_SYSTEM #if FULL_SYSTEM
OzoneThreadState(CPUType *_cpu, int _thread_num) OzoneThreadState(CPUType *_cpu, int _thread_num)
: ThreadState(-1, _thread_num), : ThreadState(_cpu, -1, _thread_num),
intrflag(0), cpu(_cpu), inSyscall(0), trapPending(0) intrflag(0), cpu(_cpu), inSyscall(0), trapPending(0)
{ {
if (cpu->params->profile) { if (cpu->params->profile) {
@ -87,8 +87,8 @@ struct OzoneThreadState : public ThreadState {
} }
#else #else
OzoneThreadState(CPUType *_cpu, int _thread_num, Process *_process, OzoneThreadState(CPUType *_cpu, int _thread_num, Process *_process,
int _asid, MemObject *mem) int _asid)
: ThreadState(-1, _thread_num, _process, _asid, mem), : ThreadState(_cpu, -1, _thread_num, _process, _asid),
cpu(_cpu), inSyscall(0), trapPending(0) cpu(_cpu), inSyscall(0), trapPending(0)
{ {
miscRegFile.clear(); miscRegFile.clear();

View file

@ -72,15 +72,6 @@ AtomicSimpleCPU::getPort(const std::string &if_name, int idx)
void void
AtomicSimpleCPU::init() AtomicSimpleCPU::init()
{ {
//Create Memory Ports (conect them up)
// Port *mem_dport = mem->getPort("");
// dcachePort.setPeer(mem_dport);
// mem_dport->setPeer(&dcachePort);
// Port *mem_iport = mem->getPort("");
// icachePort.setPeer(mem_iport);
// mem_iport->setPeer(&icachePort);
BaseCPU::init(); BaseCPU::init();
#if FULL_SYSTEM #if FULL_SYSTEM
for (int i = 0; i < threadContexts.size(); ++i) { for (int i = 0; i < threadContexts.size(); ++i) {
@ -508,7 +499,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AtomicSimpleCPU)
Param<Counter> max_loads_any_thread; Param<Counter> max_loads_any_thread;
Param<Counter> max_loads_all_threads; Param<Counter> max_loads_all_threads;
Param<Tick> progress_interval; Param<Tick> progress_interval;
SimObjectParam<MemObject *> mem;
SimObjectParam<System *> system; SimObjectParam<System *> system;
Param<int> cpu_id; Param<int> cpu_id;
@ -541,7 +531,6 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AtomicSimpleCPU)
INIT_PARAM(max_loads_all_threads, INIT_PARAM(max_loads_all_threads,
"terminate when all threads have reached this load count"), "terminate when all threads have reached this load count"),
INIT_PARAM(progress_interval, "Progress interval"), INIT_PARAM(progress_interval, "Progress interval"),
INIT_PARAM(mem, "memory"),
INIT_PARAM(system, "system object"), INIT_PARAM(system, "system object"),
INIT_PARAM(cpu_id, "processor ID"), INIT_PARAM(cpu_id, "processor ID"),
@ -579,7 +568,6 @@ CREATE_SIM_OBJECT(AtomicSimpleCPU)
params->functionTraceStart = function_trace_start; params->functionTraceStart = function_trace_start;
params->width = width; params->width = width;
params->simulate_stalls = simulate_stalls; params->simulate_stalls = simulate_stalls;
params->mem = mem;
params->system = system; params->system = system;
params->cpu_id = cpu_id; params->cpu_id = cpu_id;

View file

@ -87,7 +87,7 @@ class AtomicSimpleCPU : public BaseSimpleCPU
public: public:
CpuPort(const std::string &_name, AtomicSimpleCPU *_cpu) CpuPort(const std::string &_name, AtomicSimpleCPU *_cpu)
: Port(_name), cpu(_cpu) : Port(_name, _cpu), cpu(_cpu)
{ } { }
protected: protected:

View file

@ -70,13 +70,13 @@ using namespace std;
using namespace TheISA; using namespace TheISA;
BaseSimpleCPU::BaseSimpleCPU(Params *p) BaseSimpleCPU::BaseSimpleCPU(Params *p)
: BaseCPU(p), mem(p->mem), thread(NULL) : BaseCPU(p), thread(NULL)
{ {
#if FULL_SYSTEM #if FULL_SYSTEM
thread = new SimpleThread(this, 0, p->system, p->itb, p->dtb); thread = new SimpleThread(this, 0, p->system, p->itb, p->dtb);
#else #else
thread = new SimpleThread(this, /* thread_num */ 0, p->process, thread = new SimpleThread(this, /* thread_num */ 0, p->process,
/* asid */ 0, mem); /* asid */ 0);
#endif // !FULL_SYSTEM #endif // !FULL_SYSTEM
thread->setStatus(ThreadContext::Suspended); thread->setStatus(ThreadContext::Suspended);

View file

@ -79,8 +79,6 @@ class BaseSimpleCPU : public BaseCPU
typedef TheISA::FloatReg FloatReg; typedef TheISA::FloatReg FloatReg;
typedef TheISA::FloatRegBits FloatRegBits; typedef TheISA::FloatRegBits FloatRegBits;
MemObject *mem;
protected: protected:
Trace::InstRecord *traceData; Trace::InstRecord *traceData;
@ -98,7 +96,6 @@ class BaseSimpleCPU : public BaseCPU
public: public:
struct Params : public BaseCPU::Params struct Params : public BaseCPU::Params
{ {
MemObject *mem;
#if FULL_SYSTEM #if FULL_SYSTEM
TheISA::ITB *itb; TheISA::ITB *itb;
TheISA::DTB *dtb; TheISA::DTB *dtb;

View file

@ -660,7 +660,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(TimingSimpleCPU)
Param<Counter> max_loads_any_thread; Param<Counter> max_loads_any_thread;
Param<Counter> max_loads_all_threads; Param<Counter> max_loads_all_threads;
Param<Tick> progress_interval; Param<Tick> progress_interval;
SimObjectParam<MemObject *> mem;
SimObjectParam<System *> system; SimObjectParam<System *> system;
Param<int> cpu_id; Param<int> cpu_id;
@ -693,7 +692,6 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(TimingSimpleCPU)
INIT_PARAM(max_loads_all_threads, INIT_PARAM(max_loads_all_threads,
"terminate when all threads have reached this load count"), "terminate when all threads have reached this load count"),
INIT_PARAM(progress_interval, "Progress interval"), INIT_PARAM(progress_interval, "Progress interval"),
INIT_PARAM(mem, "memory"),
INIT_PARAM(system, "system object"), INIT_PARAM(system, "system object"),
INIT_PARAM(cpu_id, "processor ID"), INIT_PARAM(cpu_id, "processor ID"),
@ -729,7 +727,6 @@ CREATE_SIM_OBJECT(TimingSimpleCPU)
params->clock = clock; params->clock = clock;
params->functionTrace = function_trace; params->functionTrace = function_trace;
params->functionTraceStart = function_trace_start; params->functionTraceStart = function_trace_start;
params->mem = mem;
params->system = system; params->system = system;
params->cpu_id = cpu_id; params->cpu_id = cpu_id;

View file

@ -79,7 +79,7 @@ class TimingSimpleCPU : public BaseSimpleCPU
public: public:
CpuPort(const std::string &_name, TimingSimpleCPU *_cpu, Tick _lat) CpuPort(const std::string &_name, TimingSimpleCPU *_cpu, Tick _lat)
: Port(_name), cpu(_cpu), lat(_lat) : Port(_name, _cpu), cpu(_cpu), lat(_lat)
{ } { }
protected: protected:
@ -166,6 +166,8 @@ class TimingSimpleCPU : public BaseSimpleCPU
PacketPtr ifetch_pkt; PacketPtr ifetch_pkt;
PacketPtr dcache_pkt; PacketPtr dcache_pkt;
int cpu_id; int cpu_id;
Tick previousTick; Tick previousTick;

View file

@ -62,7 +62,7 @@ using namespace std;
SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys, SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
TheISA::ITB *_itb, TheISA::DTB *_dtb, TheISA::ITB *_itb, TheISA::DTB *_dtb,
bool use_kernel_stats) bool use_kernel_stats)
: ThreadState(-1, _thread_num), cpu(_cpu), system(_sys), itb(_itb), : ThreadState(_cpu, -1, _thread_num), cpu(_cpu), system(_sys), itb(_itb),
dtb(_dtb) dtb(_dtb)
{ {
@ -106,19 +106,10 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
} }
#else #else
SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
Process *_process, int _asid, MemObject* memobj) Process *_process, int _asid)
: ThreadState(-1, _thread_num, _process, _asid, memobj), : ThreadState(_cpu, -1, _thread_num, _process, _asid),
cpu(_cpu) cpu(_cpu)
{ {
/* Use this port to for syscall emulation writes to memory. */
Port *mem_port;
port = new TranslatingPort(csprintf("%s-%d-funcport",
cpu->name(), tid),
process->pTable, false);
mem_port = memobj->getPort("functional");
mem_port->setPeer(port);
port->setPeer(mem_port);
regs.clear(); regs.clear();
tc = new ProxyThreadContext<SimpleThread>(this); tc = new ProxyThreadContext<SimpleThread>(this);
} }
@ -127,9 +118,9 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
SimpleThread::SimpleThread() SimpleThread::SimpleThread()
#if FULL_SYSTEM #if FULL_SYSTEM
: ThreadState(-1, -1) : ThreadState(NULL, -1, -1)
#else #else
: ThreadState(-1, -1, NULL, -1, NULL) : ThreadState(NULL, -1, -1, NULL, -1)
#endif #endif
{ {
tc = new ProxyThreadContext<SimpleThread>(this); tc = new ProxyThreadContext<SimpleThread>(this);
@ -332,6 +323,25 @@ SimpleThread::delVirtPort(VirtualPort *vp)
} }
} }
#else
TranslatingPort *
SimpleThread::getMemPort()
{
if (port != NULL)
return port;
/* Use this port to for syscall emulation writes to memory. */
Port *dcache_port;
port = new TranslatingPort(csprintf("%s-%d-funcport",
cpu->name(), tid),
process->pTable, false);
dcache_port = cpu->getPort("dcache_port");
assert(dcache_port != NULL);
dcache_port = dcache_port->getPeer();
// mem_port->setPeer(port);
port->setPeer(dcache_port);
return port;
}
#endif #endif

View file

@ -117,8 +117,7 @@ class SimpleThread : public ThreadState
TheISA::ITB *_itb, TheISA::DTB *_dtb, TheISA::ITB *_itb, TheISA::DTB *_dtb,
bool use_kernel_stats = true); bool use_kernel_stats = true);
#else #else
SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process, int _asid, SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process, int _asid);
MemObject *memobj);
#endif #endif
SimpleThread(); SimpleThread();
@ -172,6 +171,9 @@ class SimpleThread : public ThreadState
bool simPalCheck(int palFunc); bool simPalCheck(int palFunc);
#else #else
// Override this function.
TranslatingPort *getMemPort();
Fault translateInstReq(RequestPtr &req) Fault translateInstReq(RequestPtr &req)
{ {
return process->pTable->translate(req); return process->pTable->translate(req);

View file

@ -29,8 +29,11 @@
*/ */
#include "base/output.hh" #include "base/output.hh"
#include "cpu/base.hh"
#include "cpu/profile.hh" #include "cpu/profile.hh"
#include "cpu/thread_state.hh" #include "cpu/thread_state.hh"
#include "mem/port.hh"
#include "mem/translating_port.hh"
#include "sim/serialize.hh" #include "sim/serialize.hh"
#if FULL_SYSTEM #if FULL_SYSTEM
@ -39,15 +42,16 @@
#endif #endif
#if FULL_SYSTEM #if FULL_SYSTEM
ThreadState::ThreadState(int _cpuId, int _tid) ThreadState::ThreadState(BaseCPU *cpu, int _cpuId, int _tid)
: cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0), : baseCpu(cpu), cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL), profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL),
physPort(NULL), virtPort(NULL),
microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0) microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0)
#else #else
ThreadState::ThreadState(int _cpuId, int _tid, Process *_process, ThreadState::ThreadState(BaseCPU *cpu, int _cpuId, int _tid, Process *_process,
short _asid, MemObject *mem) short _asid)
: cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0), : baseCpu(cpu), cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
process(_process), asid(_asid), port(NULL), process(_process), asid(_asid),
microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0) microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0)
#endif #endif
{ {
@ -112,4 +116,31 @@ ThreadState::profileSample()
profile->sample(profileNode, profilePC); profile->sample(profileNode, profilePC);
} }
#else
TranslatingPort *
ThreadState::getMemPort()
{
if (port != NULL)
return port;
/* Use this port to for syscall emulation writes to memory. */
Port *dcache_port, *func_mem_port;
port = new TranslatingPort(csprintf("%s-%d-funcport",
baseCpu->name(), tid),
process->pTable, false);
dcache_port = baseCpu->getPort("dcache_port");
assert(dcache_port != NULL);
MemObject *mem_object = dcache_port->getPeer()->getOwner();
assert(mem_object != NULL);
func_mem_port = mem_object->getPort("functional");
assert(func_mem_port != NULL);
func_mem_port->setPeer(port);
port->setPeer(func_mem_port);
return port;
}
#endif #endif

View file

@ -37,7 +37,6 @@
#if !FULL_SYSTEM #if !FULL_SYSTEM
#include "mem/mem_object.hh" #include "mem/mem_object.hh"
#include "mem/translating_port.hh"
#include "sim/process.hh" #include "sim/process.hh"
#endif #endif
@ -50,7 +49,9 @@ namespace Kernel {
}; };
#endif #endif
class BaseCPU;
class Checkpoint; class Checkpoint;
class TranslatingPort;
/** /**
* Struct for holding general thread state that is needed across CPU * Struct for holding general thread state that is needed across CPU
@ -62,10 +63,10 @@ struct ThreadState {
typedef ThreadContext::Status Status; typedef ThreadContext::Status Status;
#if FULL_SYSTEM #if FULL_SYSTEM
ThreadState(int _cpuId, int _tid); ThreadState(BaseCPU *cpu, int _cpuId, int _tid);
#else #else
ThreadState(int _cpuId, int _tid, Process *_process, ThreadState(BaseCPU *cpu, int _cpuId, int _tid, Process *_process,
short _asid, MemObject *mem); short _asid);
#endif #endif
void serialize(std::ostream &os); void serialize(std::ostream &os);
@ -105,7 +106,7 @@ struct ThreadState {
#else #else
Process *getProcessPtr() { return process; } Process *getProcessPtr() { return process; }
TranslatingPort *getMemPort() { return port; } TranslatingPort *getMemPort();
void setMemPort(TranslatingPort *_port) { port = _port; } void setMemPort(TranslatingPort *_port) { port = _port; }
@ -153,6 +154,9 @@ struct ThreadState {
protected: protected:
ThreadContext::Status _status; ThreadContext::Status _status;
// Pointer to the base CPU.
BaseCPU *baseCpu;
// ID of this context w.r.t. the System or Process object to which // ID of this context w.r.t. the System or Process object to which
// it belongs. For full-system mode, this is the system CPU ID. // it belongs. For full-system mode, this is the system CPU ID.
int cpuId; int cpuId;

View file

@ -37,7 +37,7 @@
PioPort::PioPort(PioDevice *dev, System *s, std::string pname) PioPort::PioPort(PioDevice *dev, System *s, std::string pname)
: SimpleTimingPort(dev->name() + pname), device(dev) : SimpleTimingPort(dev->name() + pname, dev), device(dev)
{ } { }
@ -92,8 +92,8 @@ BasicPioDevice::addressRanges(AddrRangeList &range_list)
DmaPort::DmaPort(DmaDevice *dev, System *s) DmaPort::DmaPort(DmaDevice *dev, System *s)
: Port(dev->name() + "-dmaport"), device(dev), sys(s), pendingCount(0), : Port(dev->name() + "-dmaport", dev), device(dev), sys(s),
actionInProgress(0), drainEvent(NULL) pendingCount(0), actionInProgress(0), drainEvent(NULL)
{ } { }
bool bool

View file

@ -146,7 +146,7 @@ class Bus : public MemObject
/** Constructor for the BusPort.*/ /** Constructor for the BusPort.*/
BusPort(const std::string &_name, Bus *_bus, int _id) BusPort(const std::string &_name, Bus *_bus, int _id)
: Port(_name), _onRetryList(false), bus(_bus), id(_id) : Port(_name, _bus), _onRetryList(false), bus(_bus), id(_id)
{ } { }
bool onRetryList() bool onRetryList()

View file

@ -42,7 +42,7 @@ using namespace std;
BaseCache::CachePort::CachePort(const std::string &_name, BaseCache *_cache, BaseCache::CachePort::CachePort(const std::string &_name, BaseCache *_cache,
bool _isCpuSide) bool _isCpuSide)
: Port(_name), cache(_cache), isCpuSide(_isCpuSide) : Port(_name, _cache), cache(_cache), isCpuSide(_isCpuSide)
{ {
blocked = false; blocked = false;
waitingOnRetry = false; waitingOnRetry = false;

View file

@ -58,6 +58,8 @@
typedef std::list<Range<Addr> > AddrRangeList; typedef std::list<Range<Addr> > AddrRangeList;
typedef std::list<Range<Addr> >::iterator AddrRangeIter; typedef std::list<Range<Addr> >::iterator AddrRangeIter;
class MemObject;
/** /**
* Ports are used to interface memory objects to * Ports are used to interface memory objects to
* each other. They will always come in pairs, and we refer to the other * each other. They will always come in pairs, and we refer to the other
@ -81,10 +83,13 @@ class Port
memory objects. */ memory objects. */
Port *peer; Port *peer;
/** A pointer to the MemObject that owns this port. This may not be set. */
MemObject *owner;
public: public:
Port() Port()
: peer(NULL) : peer(NULL), owner(NULL)
{ } { }
/** /**
@ -92,9 +97,11 @@ class Port
* *
* @param _name Port name for DPRINTF output. Should include name * @param _name Port name for DPRINTF output. Should include name
* of memory system object to which the port belongs. * of memory system object to which the port belongs.
* @param _owner Pointer to the MemObject that owns this port.
* Will not necessarily be set.
*/ */
Port(const std::string &_name) Port(const std::string &_name, MemObject *_owner = NULL)
: portName(_name), peer(NULL) : portName(_name), peer(NULL), owner(_owner)
{ } { }
/** Return port name (for DPRINTF). */ /** Return port name (for DPRINTF). */
@ -112,16 +119,18 @@ class Port
void setName(const std::string &name) void setName(const std::string &name)
{ portName = name; } { portName = name; }
/** Function to set the pointer for the peer port. /** Function to set the pointer for the peer port. */
@todo should be called by the configuration stuff (python).
*/
void setPeer(Port *port); void setPeer(Port *port);
/** Function to set the pointer for the peer port. /** Function to get the pointer to the peer port. */
@todo should be called by the configuration stuff (python).
*/
Port *getPeer() { return peer; } Port *getPeer() { return peer; }
/** Function to set the owner of this port. */
void setOwner(MemObject *_owner) { owner = _owner; }
/** Function to return the owner of this port. */
MemObject *getOwner() { return owner; }
protected: protected:
/** These functions are protected because they should only be /** These functions are protected because they should only be
@ -247,8 +256,8 @@ class Port
class FunctionalPort : public Port class FunctionalPort : public Port
{ {
public: public:
FunctionalPort(const std::string &_name) FunctionalPort(const std::string &_name, MemObject *_owner = NULL)
: Port(_name) : Port(_name, _owner)
{} {}
protected: protected:

View file

@ -44,6 +44,7 @@ SimpleTimingPort::recvFunctional(PacketPtr pkt)
if (target->intersect(pkt)) if (target->intersect(pkt))
done = fixPacket(pkt, target); done = fixPacket(pkt, target);
i++;
} }
//Then just do an atomic access and throw away the returned latency //Then just do an atomic access and throw away the returned latency
@ -98,11 +99,29 @@ SimpleTimingPort::recvRetry()
void void
SimpleTimingPort::sendTiming(PacketPtr pkt, Tick time) SimpleTimingPort::sendTiming(PacketPtr pkt, Tick time)
{ {
// Nothing is on the list: add it and schedule an event
if (transmitList.empty()) { if (transmitList.empty()) {
assert(!sendEvent.scheduled()); assert(!sendEvent.scheduled());
sendEvent.schedule(curTick+time); sendEvent.schedule(curTick+time);
}
transmitList.push_back(std::pair<Tick,PacketPtr>(time+curTick,pkt)); transmitList.push_back(std::pair<Tick,PacketPtr>(time+curTick,pkt));
return;
}
// something is on the list and this belongs at the end
if (time+curTick >= transmitList.back().first) {
transmitList.push_back(std::pair<Tick,PacketPtr>(time+curTick,pkt));
return;
}
// Something is on the list and this belongs somewhere else
std::list<std::pair<Tick,PacketPtr> >::iterator i = transmitList.begin();
std::list<std::pair<Tick,PacketPtr> >::iterator end = transmitList.end();
bool done = false;
while (i != end && !done) {
if (time+curTick < i->first)
transmitList.insert(i,std::pair<Tick,PacketPtr>(time+curTick,pkt));
i++;
}
} }
void void

View file

@ -114,8 +114,8 @@ class SimpleTimingPort : public Port
public: public:
SimpleTimingPort(std::string pname) SimpleTimingPort(std::string pname, MemObject *_owner = NULL)
: Port(pname), sendEvent(this), drainEvent(NULL) : Port(pname, _owner), sendEvent(this), drainEvent(NULL)
{} {}
/** Hook for draining timing accesses from the system. The /** Hook for draining timing accesses from the system. The

View file

@ -91,11 +91,6 @@ SimObject::SimObject(const string &_name)
state = Running; state = Running;
} }
void
SimObject::connect()
{
}
void void
SimObject::init() SimObject::init()
{ {
@ -159,21 +154,6 @@ SimObject::regAllStats()
Stats::registerResetCallback(&StatResetCB); Stats::registerResetCallback(&StatResetCB);
} }
//
// static function: call connect() on all SimObjects.
//
void
SimObject::connectAll()
{
SimObjectList::iterator i = simObjectList.begin();
SimObjectList::iterator end = simObjectList.end();
for (; i != end; ++i) {
SimObject *obj = *i;
obj->connect();
}
}
// //
// static function: call init() on all SimObjects. // static function: call init() on all SimObjects.
// //

View file

@ -101,9 +101,7 @@ class SimObject : public Serializable, protected StartupCallback
// initialization pass of all objects. // initialization pass of all objects.
// Gets invoked after construction, before unserialize. // Gets invoked after construction, before unserialize.
virtual void init(); virtual void init();
virtual void connect();
static void initAll(); static void initAll();
static void connectAll();
// register statistics for this object // register statistics for this object
virtual void regStats(); virtual void regStats();

View file

@ -71,7 +71,6 @@ system.l2c.mem_side = system.membus.port
for cpu in cpus: for cpu in cpus:
cpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1), cpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1),
L1(size = '32kB', assoc = 4)) L1(size = '32kB', assoc = 4))
cpu.mem = cpu.dcache
# connect cpu level-1 caches to shared level-2 cache # connect cpu level-1 caches to shared level-2 cache
cpu.connectMemPorts(system.toL2Bus) cpu.connectMemPorts(system.toL2Bus)

View file

@ -40,7 +40,6 @@ class MyCache(BaseCache):
cpu = DerivO3CPU() cpu = DerivO3CPU()
cpu.addTwoLevelCacheHierarchy(MyCache(size = '128kB'), MyCache(size = '256kB'), cpu.addTwoLevelCacheHierarchy(MyCache(size = '128kB'), MyCache(size = '256kB'),
MyCache(size = '2MB')) MyCache(size = '2MB'))
cpu.mem = cpu.dcache
system = System(cpu = cpu, system = System(cpu = cpu,
physmem = PhysicalMemory(), physmem = PhysicalMemory(),

View file

@ -70,7 +70,6 @@ system.l2c.mem_side = system.membus.port
for cpu in cpus: for cpu in cpus:
cpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1), cpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1),
L1(size = '32kB', assoc = 4)) L1(size = '32kB', assoc = 4))
cpu.mem = cpu.dcache
# connect cpu level-1 caches to shared level-2 cache # connect cpu level-1 caches to shared level-2 cache
cpu.connectMemPorts(system.toL2Bus) cpu.connectMemPorts(system.toL2Bus)

View file

@ -34,6 +34,5 @@ system = System(cpu = AtomicSimpleCPU(cpu_id=0),
membus = Bus()) membus = Bus())
system.physmem.port = system.membus.port system.physmem.port = system.membus.port
system.cpu.connectMemPorts(system.membus) system.cpu.connectMemPorts(system.membus)
system.cpu.mem = system.physmem
root = Root(system = system) root = Root(system = system)

View file

@ -70,7 +70,6 @@ system.l2c.mem_side = system.membus.port
for cpu in cpus: for cpu in cpus:
cpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1), cpu.addPrivateSplitL1Caches(L1(size = '32kB', assoc = 1),
L1(size = '32kB', assoc = 4)) L1(size = '32kB', assoc = 4))
cpu.mem = cpu.dcache
# connect cpu level-1 caches to shared level-2 cache # connect cpu level-1 caches to shared level-2 cache
cpu.connectMemPorts(system.toL2Bus) cpu.connectMemPorts(system.toL2Bus)

View file

@ -39,8 +39,6 @@ class MyCache(BaseCache):
cpu = TimingSimpleCPU(cpu_id=0) cpu = TimingSimpleCPU(cpu_id=0)
cpu.addTwoLevelCacheHierarchy(MyCache(size = '128kB'), MyCache(size = '256kB'), cpu.addTwoLevelCacheHierarchy(MyCache(size = '128kB'), MyCache(size = '256kB'),
MyCache(size = '2MB')) MyCache(size = '2MB'))
cpu.mem = cpu.dcache
cpu.mem = cpu.dcache
system = System(cpu = cpu, system = System(cpu = cpu,
physmem = PhysicalMemory(), physmem = PhysicalMemory(),
membus = Bus()) membus = Bus())

View file

@ -36,6 +36,5 @@ system = FSConfig.makeLinuxAlphaSystem('atomic')
system.cpu = cpus system.cpu = cpus
for c in cpus: for c in cpus:
c.connectMemPorts(system.membus) c.connectMemPorts(system.membus)
c.mem = system.physmem
root = Root(clock = '2GHz', system = system) root = Root(clock = '2GHz', system = system)

View file

@ -35,6 +35,5 @@ cpu = AtomicSimpleCPU(cpu_id=0)
system = FSConfig.makeLinuxAlphaSystem('atomic') system = FSConfig.makeLinuxAlphaSystem('atomic')
system.cpu = cpu system.cpu = cpu
cpu.connectMemPorts(system.membus) cpu.connectMemPorts(system.membus)
cpu.mem = system.physmem
root = Root(clock = '2GHz', system = system) root = Root(clock = '2GHz', system = system)

View file

@ -36,6 +36,5 @@ system = FSConfig.makeLinuxAlphaSystem('timing')
system.cpu = cpus system.cpu = cpus
for c in cpus: for c in cpus:
c.connectMemPorts(system.membus) c.connectMemPorts(system.membus)
c.mem = system.physmem
root = Root(clock = '2GHz', system = system) root = Root(clock = '2GHz', system = system)

View file

@ -35,6 +35,5 @@ cpu = TimingSimpleCPU(cpu_id=0)
system = FSConfig.makeLinuxAlphaSystem('timing') system = FSConfig.makeLinuxAlphaSystem('timing')
system.cpu = cpu system.cpu = cpu
cpu.connectMemPorts(system.membus) cpu.connectMemPorts(system.membus)
cpu.mem = system.physmem
root = Root(clock = '2GHz', system = system) root = Root(clock = '2GHz', system = system)