SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
Loading...
Searching...
No Matches
io_memory_simics_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2014 Intel Corporation
5
6 This software and the related documents are Intel copyrighted materials, and
7 your use of them is governed by the express license under which they were
8 provided to you ("License"). Unless the License provides otherwise, you may
9 not use, modify, copy, publish, distribute, disclose or transmit this software
10 or the related documents without Intel's prior written permission.
11
12 This software and the related documents are provided as is, with no express or
13 implied warranties, other than those that are expressly stated in the License.
14*/
15
16#ifndef SIMICS_SYSTEMC_IFACE_IO_MEMORY_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_IO_MEMORY_SIMICS_ADAPTER_H
18
19#include <simics/devs/io-memory.h>
23
24#include <string>
25#include <vector>
26
27namespace simics {
28namespace systemc {
29namespace iface {
30
32template<typename TBase, typename TInterface = IoMemoryInterface>
33class IoMemorySimicsAdapter : public SimicsAdapter<io_memory_interface_t> {
34 public:
36 : SimicsAdapter<io_memory_interface_t>(
37 IO_MEMORY_INTERFACE, init_iface()) {
38 }
39
40 protected:
41 static ::exception_type_t operation(conf_object_t *obj,
42 generic_transaction_t *mem_op,
43 ::map_info_t map_info) {
44 types::map_info_t info(map_info.base,
45 map_info.start,
46 map_info.length,
47 map_info.function);
48 return static_cast<::exception_type_t>(
49 adapter<TBase, TInterface>(obj)->operation(mem_op, info));
50 }
51
52 private:
53 std::vector<std::string> description(conf_object_t *obj,
54 DescriptionType type) {
55 return descriptionBase<TBase, TInterface>(obj, type);
56 }
57 io_memory_interface_t init_iface() {
58 io_memory_interface_t iface = {};
59 iface.operation = operation;
60 return iface;
61 }
62};
63
64} // namespace iface
65} // namespace systemc
66} // namespace simics
67
68#endif
Adapter for Simics io_memory interface.
Definition: io_memory_simics_adapter.h:33
IoMemorySimicsAdapter()
Definition: io_memory_simics_adapter.h:35
::exception_type_t operation(conf_object_t *obj, generic_transaction_t *mem_op, ::map_info_t map_info)
Definition: io_memory_simics_adapter.h:41
Base class for mapping Simics interface to a C++ interface.
Definition: simics_adapter.h:47
DescriptionType
Definition: description_interface.h:25
Definition: pci_bus_interface.h:24
Reduced, stand-alone, version of the Simics map_info_t struct.
Definition: map_info.h:25