Add in Context IDs to the simulator. From now on, cpuId is almost never used,
the primary identifier for a hardware context should be contextId(). The concept of threads within a CPU remains, in the form of threadId() because sometimes you need to know which context within a cpu to manipulate.
This commit is contained in:
@@ -84,7 +84,7 @@ void
|
||||
AlphaBackdoor::startup()
|
||||
{
|
||||
system->setAlphaAccess(pioAddr);
|
||||
alphaAccess->numCPUs = system->getNumCPUs();
|
||||
alphaAccess->numCPUs = system->numContexts();
|
||||
alphaAccess->kernStart = system->getKernelStart();
|
||||
alphaAccess->kernEnd = system->getKernelEnd();
|
||||
alphaAccess->entryPoint = system->getKernelEntry();
|
||||
|
||||
@@ -110,7 +110,13 @@ TsunamiCChip::read(PacketPtr pkt)
|
||||
break;
|
||||
case TSDEV_CC_MISC:
|
||||
pkt->set(((ipint << 8) & 0xF) | ((itint << 4) & 0xF) |
|
||||
(pkt->req->getCpuNum() & 0x3));
|
||||
(pkt->req->contextId() & 0x3));
|
||||
// currently, FS cannot handle MT so contextId and
|
||||
// cpuId are effectively the same, don't know if it will
|
||||
// matter if FS becomes MT enabled. I suspect no because
|
||||
// we are currently able to boot up to 64 procs anyway
|
||||
// which would render the CPUID of this register useless
|
||||
// anyway
|
||||
break;
|
||||
case TSDEV_CC_AAR0:
|
||||
case TSDEV_CC_AAR1:
|
||||
|
||||
@@ -103,7 +103,7 @@ MaltaCChip::read(PacketPtr pkt)
|
||||
break;
|
||||
case TSDEV_CC_MISC:
|
||||
pkt->set((ipint << 8) & 0xF | (itint << 4) & 0xF |
|
||||
(pkt->req->getCpuNum() & 0x3));
|
||||
(pkt->req->contextId() & 0x3));
|
||||
break;
|
||||
case TSDEV_CC_AAR0:
|
||||
case TSDEV_CC_AAR1:
|
||||
|
||||
@@ -379,7 +379,7 @@ Device::read(PacketPtr pkt)
|
||||
assert(config.command & PCI_CMD_MSE);
|
||||
assert(pkt->getAddr() >= BARAddrs[0] && pkt->getSize() < BARSize[0]);
|
||||
|
||||
int cpu = pkt->req->getCpuNum();
|
||||
int cpu = pkt->req->contextId();
|
||||
Addr daddr = pkt->getAddr() - BARAddrs[0];
|
||||
Addr index = daddr >> Regs::VirtualShift;
|
||||
Addr raddr = daddr & Regs::VirtualMask;
|
||||
@@ -466,7 +466,7 @@ Device::write(PacketPtr pkt)
|
||||
assert(config.command & PCI_CMD_MSE);
|
||||
assert(pkt->getAddr() >= BARAddrs[0] && pkt->getSize() < BARSize[0]);
|
||||
|
||||
int cpu = pkt->req->getCpuNum();
|
||||
int cpu = pkt->req->contextId();
|
||||
Addr daddr = pkt->getAddr() - BARAddrs[0];
|
||||
Addr index = daddr >> Regs::VirtualShift;
|
||||
Addr raddr = daddr & Regs::VirtualMask;
|
||||
|
||||
@@ -120,7 +120,7 @@ void
|
||||
Iob::readJBus(PacketPtr pkt)
|
||||
{
|
||||
Addr accessAddr = pkt->getAddr() - iobJBusAddr;
|
||||
int cpuid = pkt->req->getCpuNum();
|
||||
int cpuid = pkt->req->contextId();
|
||||
int index;
|
||||
uint64_t data;
|
||||
|
||||
@@ -235,7 +235,7 @@ void
|
||||
Iob::writeJBus(PacketPtr pkt)
|
||||
{
|
||||
Addr accessAddr = pkt->getAddr() - iobJBusAddr;
|
||||
int cpuid = pkt->req->getCpuNum();
|
||||
int cpuid = pkt->req->contextId();
|
||||
int index;
|
||||
uint64_t data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user