gem5  v20.1.0.0
hsa_driver.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2018 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * For use for simulation and test purposes only
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from this
19  * software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * Authors: Anthony Gutierrez
34  * Eric van Tassell
35  */
36 
51 #ifndef __DEV_HSA_HSA_DRIVER_HH__
52 #define __DEV_HSA_HSA_DRIVER_HH__
53 
54 #include "base/types.hh"
55 #include "sim/emul_driver.hh"
56 
57 struct HSADriverParams;
58 class HSADevice;
59 class PortProxy;
60 class ThreadContext;
61 
62 class HSADriver : public EmulatedDriver
63 {
64  public:
65  HSADriver(HSADriverParams *p);
66 
67  int open(ThreadContext *tc, int mode, int flags);
68  Addr mmap(ThreadContext *tc, Addr start, uint64_t length,
69  int prot, int tgtFlags, int tgtFd, int offset);
70  protected:
75  uint32_t queueId;
76 
77  void allocateQueue(ThreadContext *tc, Addr ioc_buf);
78 };
79 
80 #endif // __DEV_HSA_HSA_DRIVER_HH__
HSADriver::HSADriver
HSADriver(HSADriverParams *p)
Definition: hsa_driver.cc:48
HSADriver::mmap
Addr mmap(ThreadContext *tc, Addr start, uint64_t length, int prot, int tgtFlags, int tgtFd, int offset)
Currently, mmap() will simply setup a mapping for the associated device's packet processor's doorbell...
Definition: hsa_driver.cc:71
length
uint8_t length
Definition: inet.hh:422
EmulatedDriver
EmulatedDriver is an abstract base class for fake SE-mode device drivers.
Definition: emul_driver.hh:52
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
HSADriver::queueId
uint32_t queueId
Definition: hsa_driver.hh:75
ArmISA::mode
Bitfield< 4, 0 > mode
Definition: miscregs_types.hh:70
X86ISA::prot
Bitfield< 7 > prot
Definition: misc.hh:582
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
PortProxy
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition: port_proxy.hh:80
types.hh
emul_driver.hh
HSADriver
Definition: hsa_driver.hh:62
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
HSADriver::device
HSADevice * device
HSA agent (device) that is controled by this driver.
Definition: hsa_driver.hh:74
HSADriver::allocateQueue
void allocateQueue(ThreadContext *tc, Addr ioc_buf)
Forward relevant parameters to packet processor; queueID is used to link doorbell.
Definition: hsa_driver.cc:105
HSADevice
Definition: hsa_device.hh:46
HSADriver::open
int open(ThreadContext *tc, int mode, int flags)
Create an FD entry for the KFD inside of the owning process.
Definition: hsa_driver.cc:57
ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:153

Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17