From fafa83ed32933fe250d34dfca23fba348429b176 Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Wed, 30 Sep 2015 11:14:19 -0500 Subject: cpu: Add per-thread monitors Adds per-thread address monitors to support FullSystem SMT. --- src/cpu/minor/exec_context.hh | 8 ++++---- src/cpu/minor/fetch1.cc | 3 ++- src/cpu/minor/lsq.cc | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/cpu/minor') diff --git a/src/cpu/minor/exec_context.hh b/src/cpu/minor/exec_context.hh index 3e4ea5ea9..625d2b877 100644 --- a/src/cpu/minor/exec_context.hh +++ b/src/cpu/minor/exec_context.hh @@ -343,12 +343,12 @@ class ExecContext : public ::ExecContext public: // monitor/mwait funtions - void armMonitor(Addr address) { getCpuPtr()->armMonitor(address); } - bool mwait(PacketPtr pkt) { return getCpuPtr()->mwait(pkt); } + void armMonitor(Addr address) { getCpuPtr()->armMonitor(0, address); } + bool mwait(PacketPtr pkt) { return getCpuPtr()->mwait(0, pkt); } void mwaitAtomic(ThreadContext *tc) - { return getCpuPtr()->mwaitAtomic(tc, thread.dtb); } + { return getCpuPtr()->mwaitAtomic(0, tc, thread.dtb); } AddressMonitor *getAddrMonitor() - { return getCpuPtr()->getCpuAddrMonitor(); } + { return getCpuPtr()->getCpuAddrMonitor(0); } }; } diff --git a/src/cpu/minor/fetch1.cc b/src/cpu/minor/fetch1.cc index 81fc99d37..84aaf02f5 100644 --- a/src/cpu/minor/fetch1.cc +++ b/src/cpu/minor/fetch1.cc @@ -135,7 +135,8 @@ Fetch1::fetchLine() "%s addr: 0x%x pc: %s line_offset: %d request_size: %d\n", request_id, aligned_pc, pc, line_offset, request_size); - request->request.setThreadContext(cpu.cpuId(), /* thread id */ 0); + request->request.setThreadContext(cpu.threads[0]->getTC()->contextId(), + /* thread id */ 0); request->request.setVirt(0 /* asid */, aligned_pc, request_size, Request::INST_FETCH, cpu.instMasterId(), /* I've no idea why we need the PC, but give it */ diff --git a/src/cpu/minor/lsq.cc b/src/cpu/minor/lsq.cc index 376e8a0ff..e644951f8 100644 --- a/src/cpu/minor/lsq.cc +++ b/src/cpu/minor/lsq.cc @@ -1501,7 +1501,8 @@ LSQ::pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data, if (inst->traceData) inst->traceData->setMem(addr, size, flags); - request->request.setThreadContext(cpu.cpuId(), /* thread id */ 0); + int cid = cpu.threads[inst->id.threadId]->getTC()->contextId(); + request->request.setThreadContext(cid, /* thread id */ 0); request->request.setVirt(0 /* asid */, addr, size, flags, cpu.dataMasterId(), /* I've no idea why we need the PC, but give it */ -- cgit v1.2.3