gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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;
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(const SETranslatingPortProxy &mem_proxy,
78  Addr ioc_buf_addr);
79 };
80 
81 #endif // __DEV_HSA_HSA_DRIVER_HH__
int open(ThreadContext *tc, int mode, int flags)
Create an FD entry for the KFD inside of the owning process.
Definition: hsa_driver.cc:56
Bitfield< 23, 0 > offset
Definition: types.hh:152
Bitfield< 4, 0 > mode
Bitfield< 7 > prot
Definition: misc.hh:582
ThreadContext is the external interface to all thread state for anything outside of the CPU...
void allocateQueue(const SETranslatingPortProxy &mem_proxy, Addr ioc_buf_addr)
HSADevice * device
HSA agent (device) that is controled by this driver.
Definition: hsa_driver.hh:74
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:140
HSADriver(HSADriverParams *p)
Definition: hsa_driver.cc:47
uint32_t queueId
Definition: hsa_driver.hh:75
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&#39;s packet processor&#39;s doorbell...
Definition: hsa_driver.cc:70
EmulatedDriver is an abstract base class for fake SE-mode device drivers.
Definition: emul_driver.hh:52
uint8_t length
Definition: inet.hh:329
Bitfield< 0 > p

Generated on Thu May 28 2020 16:21:32 for gem5 by doxygen 1.8.13