HSAIL_X86 fail to compile. This patch enables compilation.
Issue-on: https://gem5.atlassian.net/browse/GEM5-556
Change-Id: I663e529622ed90254eaf8be01e23991ed8271b5b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29293
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
isas = [ src.get_contents().decode('utf-8') for src in source ]
target_isa = env['TARGET_ISA']
def define(isa):
- return isa.upper() + '_ISA'
+ return str(isa.upper()) + '_ISA'
def namespace(isa):
return isa[0].upper() + isa[1:].lower() + 'ISA'
isas = [ src.get_contents() for src in source ]
target_gpu_isa = env['TARGET_GPU_ISA']
def define(isa):
- return isa.upper() + '_ISA'
+ return str(isa.upper()) + '_ISA'
def namespace(isa):
return isa[0].upper() + isa[1:].lower() + 'ISA'
-#!/usr/bin/env python2.7
+#!/usr/bin/env python
# Copyright (c) 2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
-from Device import DmaDevice
+from m5.objects.Device import DmaDevice
class HSADevice(DmaDevice):
type = 'HSADevice'
from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
-from Process import EmulatedDriver
+from m5.objects.Process import EmulatedDriver
class HSADriver(EmulatedDriver):
type = 'HSADriver'
* grab context zero.
*/
auto process = sys->getThreadContext(0)->getProcessPtr();
- auto mem_state = process->getMemState();
- if (!mem_state->translate(vaddr, paddr)) {
+ if (!process->pTable->translate(vaddr, paddr)) {
fatal("failed translation: vaddr 0x%x\n", vaddr);
}
}
"offset: 0x%x)\n", start, length, offset);
auto process = tc->getProcessPtr();
- auto mem_state = process->getMemState();
+ auto mem_state = process->memState;
// Extend global mmap region if necessary.
if (start == 0) {
* Now map this virtual address to our PIO doorbell interface
* in the page tables (non-cacheable).
*/
- mem_state->map(start, device->hsaPacketProc().pioAddr, length, false);
+ process->pTable->map(start, device->hsaPacketProc().pioAddr,
+ length, false);
DPRINTF(HSADriver, "amdkfd doorbell mapped to %xp\n", start);
return start;
}
-
-/**
- * Forward relevant parameters to packet processor; queueID
- * is used to link doorbell. The queueIDs are not re-used
- * in current implementation, and we allocate only one page
- * (4096 bytes) for doorbells, so check if this queue ID can
- * be mapped into that page.
- */
-void
-HSADriver::allocateQueue(const SETranslatingPortProxy &mem_proxy, Addr ioc_buf)
-{
- TypedBufferArg<kfd_ioctl_create_queue_args> args(ioc_buf);
- args.copyIn(mem_proxy);
-
- if (VOID_PTR_ADD32(0, queueId) >= (void*)0x1000) {
- fatal("%s: Exceeded maximum number of HSA queues allowed\n", name());
- }
-
- args->queue_id = queueId++;
- auto &hsa_pp = device->hsaPacketProc();
- hsa_pp.setDeviceQueueDesc(args->read_pointer_address,
- args->ring_base_address, args->queue_id,
- args->ring_size);
- args.copyOut(mem_proxy);
-}
"%s: write of size %d to reg-offset %d (0x%x)\n",
__FUNCTION__, pkt->getSize(), daddr, daddr);
- uint32_t doorbell_reg = pkt->get<uint32_t>();
+ uint32_t doorbell_reg = pkt->getLE<uint32_t>();
DPRINTF(HSAPacketProcessor,
"%s: write data 0x%x to offset %d (0x%x)\n",
// new extensions, it will likely be wrong to just arbitrarily grab context
// zero.
auto process = sys->getThreadContext(0)->getProcessPtr();
- auto mem_state = process->getMemState();
- if (!mem_state->translate(vaddr, paddr))
+ if (!process->pTable->translate(vaddr, paddr))
fatal("failed translation: vaddr 0x%x\n", vaddr);
}
* not support atomic operations.
*/
auto tc = sys->getThreadContext(0);
- auto process = tc->getProcessPtr();
- auto mem_state = process->getMemState();
- auto &virt_proxy = mem_state->getVirtProxy();
+ auto &virt_proxy = tc->getVirtProxy();
TypedBufferArg<uint64_t> prev_signal(signal_addr);
prev_signal.copyIn(virt_proxy);