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