SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
mii_management_simics_adapter.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2021 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_MII_MANAGEMENT_SIMICS_ADAPTER_H
17#define SIMICS_SYSTEMC_IFACE_MII_MANAGEMENT_SIMICS_ADAPTER_H
18
19#include <simics/devs/mii.h>
22
23#include <string>
24#include <vector>
25
26namespace simics {
27namespace systemc {
28namespace iface {
29
30template<typename TBase, typename TInterface = MiiManagementInterface>
32 : public SimicsAdapter<mii_management_interface_t> {
33 public:
35 : SimicsAdapter<mii_management_interface_t>(
36 MII_MANAGEMENT_INTERFACE, init_iface()) {
37 }
38
39 protected:
40 static int serial_access(conf_object_t *obj, int data_in, int clock) {
41 return adapter<TBase, TInterface>(obj)->serial_access(data_in, clock);
42 }
43 static uint16_t read_register(conf_object_t *obj, int phy, int reg) {
44 return adapter<TBase, TInterface>(obj)->read_register(phy, reg);
45 }
46 static void write_register(conf_object_t *obj, int phy, int reg,
47 uint16_t value) {
48 adapter<TBase, TInterface>(obj)->write_register(phy, reg, value);
49 }
50
51 private:
52 std::vector<std::string> description(conf_object_t *obj,
53 DescriptionType type) {
54 return descriptionBase<TBase, TInterface>(obj, type);
55 }
56 mii_management_interface_t init_iface() {
57 mii_management_interface_t iface = {};
58 iface.serial_access = serial_access;
59 iface.read_register = read_register;
60 iface.write_register = write_register;
61 return iface;
62 }
63};
64
65} // namespace iface
66} // namespace systemc
67} // namespace simics
68
69#endif
Definition: mii_management_simics_adapter.h:32
MiiManagementSimicsAdapter()
Definition: mii_management_simics_adapter.h:34
static void write_register(conf_object_t *obj, int phy, int reg, uint16_t value)
Definition: mii_management_simics_adapter.h:46
static int serial_access(conf_object_t *obj, int data_in, int clock)
Definition: mii_management_simics_adapter.h:40
static uint16_t read_register(conf_object_t *obj, int phy, int reg)
Definition: mii_management_simics_adapter.h:43
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