SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
serial_device_simics_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2015 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_SERIAL_DEVICE_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_SERIAL_DEVICE_SIMICS_ADAPTER_H
18
19#include <simics/devs/serial-device.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
30template<typename TBase,
31 typename TInterface = SerialDeviceInterface>
33 : public SimicsAdapter<serial_device_interface_t> {
34 public:
36 : SimicsAdapter<serial_device_interface_t>(
37 SERIAL_DEVICE_INTERFACE, init_iface()) {
38 }
39
40 protected:
41 static int write(conf_object_t *obj, int value) {
42 return adapter<TBase, TInterface>(obj)->write(value);
43 }
44 static void receive_ready(conf_object_t *obj) {
45 adapter<TBase, TInterface>(obj)->receive_ready();
46 }
47
48 private:
49 std::vector<std::string> description(conf_object_t *obj,
50 DescriptionType type) {
51 return descriptionBase<TBase, TInterface>(obj, type);
52 }
53 serial_device_interface_t init_iface() {
54 serial_device_interface_t iface = {};
55 iface.write = write;
56 iface.receive_ready = receive_ready;
57 return iface;
58 }
59};
60
61} // namespace iface
62} // namespace systemc
63} // namespace simics
64
65#endif
Definition: serial_device_simics_adapter.h:33
SerialDeviceSimicsAdapter()
Definition: serial_device_simics_adapter.h:35
static void receive_ready(conf_object_t *obj)
Definition: serial_device_simics_adapter.h:44
static int write(conf_object_t *obj, int value)
Definition: serial_device_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