gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dramsys.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 Fraunhofer IESE
3  * All rights reserved
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __MEM_DRAMSYS_H__
30 #define __MEM_DRAMSYS_H__
31 
32 #include "DRAMSysConfiguration.h"
33 #include "mem/abstract_mem.hh"
34 #include "mem/dramsys_wrapper.hh"
35 #include "params/DRAMSys.hh"
36 
37 namespace gem5
38 {
39 
40 namespace memory
41 {
42 
43 class DRAMSys : public AbstractMemory
44 {
45  PARAMS(DRAMSys);
47 
48  public:
51  tlmWrapper(dramSysWrapper.tSocket,
52  params.name + ".tlm",
54  config(DRAMSysConfiguration::from_path(
55  params.configuration,
56  params.resource_directory)),
57  dramSysWrapper(params.name.c_str(),
58  config,
59  params.recordable,
60  params.range)
61  {
62  }
63 
64  gem5::Port &getPort(const std::string &if_name, PortID idx) override
65  {
66  if (if_name != "tlm")
67  {
68  return AbstractMemory::getPort(if_name, idx);
69  }
70 
71  return tlmWrapper;
72  }
73 
74  private:
75  DRAMSysConfiguration::Configuration config;
77 };
78 
79 } // namespace memory
80 } // namespace gem5
81 
82 #endif // __MEM_DRAMSYS_HH__
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:245
gem5::SimObject::getPort
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Definition: sim_object.cc:123
memory
Definition: mem.h:38
abstract_mem.hh
gem5::memory::DRAMSys::getPort
gem5::Port & getPort(const std::string &if_name, PortID idx) override
Get a port with a given name and index.
Definition: dramsys.hh:64
dramsys_wrapper.hh
gem5::InvalidPortID
const PortID InvalidPortID
Definition: types.hh:246
gem5::memory::DRAMSys::dramSysWrapper
DRAMSysWrapper dramSysWrapper
Definition: dramsys.hh:76
gem5::Named::name
virtual std::string name() const
Definition: named.hh:47
gem5::SimObject::params
const Params & params() const
Definition: sim_object.hh:176
gem5::memory::AbstractMemory
An abstract memory represents a contiguous block of physical memory, with an associated address range...
Definition: abstract_mem.hh:110
gem5::memory::DRAMSys::DRAMSys
DRAMSys(Params const &params)
Definition: dramsys.hh:49
gem5::memory::DRAMSys::tlmWrapper
sc_gem5::TlmTargetWrapper< 32 > tlmWrapper
Definition: dramsys.hh:46
gem5::memory::DRAMSys::config
DRAMSysConfiguration::Configuration config
Definition: dramsys.hh:75
gem5::memory::DRAMSysWrapper
Definition: dramsys_wrapper.hh:53
gem5::memory::AbstractMemory::range
AddrRange range
Definition: abstract_mem.hh:115
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
gem5::memory::DRAMSys
Definition: dramsys.hh:43
gem5::memory::DRAMSys::PARAMS
PARAMS(DRAMSys)
gem5::ClockedObject::Params
ClockedObjectParams Params
Parameters of ClockedObject.
Definition: clocked_object.hh:240
sc_gem5::TlmTargetBaseWrapper
Definition: tlm_port_wrapper.hh:44
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37

Generated on Sun Jul 30 2023 01:56:58 for gem5 by doxygen 1.8.17