SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
mii_management_gasket_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_SIMICS2TLM_MII_MANAGEMENT_GASKET_ADAPTER_H
17#define SIMICS_SYSTEMC_SIMICS2TLM_MII_MANAGEMENT_GASKET_ADAPTER_H
18
23
24#include <stdint.h>
25
26namespace simics {
27namespace systemc {
28namespace simics2tlm {
29
32 public GasketAdapter<iface::MiiManagementInterface> {
33 public:
35 MiiManagementInterface *mii_management,
37 : mii_management_(mii_management),
38 simulation_(simulation) {
39 }
40
41 int serial_access(int data_in, int clock) override {
42 Context context(simulation_);
43 return mii_management_->serial_access(data_in, clock);
44 }
45 uint16_t read_register(int phy, int reg) override {
46 Context context(simulation_);
47 return mii_management_->read_register(phy, reg);
48 }
49 void write_register(int phy, int reg, uint16_t value) override {
50 Context context(simulation_);
51 mii_management_->write_register(phy, reg, value);
52 }
53
55 return dynamic_cast<simics2tlm::GasketOwner *>(mii_management_);
56 }
57
58 private:
59 MiiManagementInterface *mii_management_;
60 iface::SimulationInterface *simulation_;
61};
62
63} // namespace simics2tlm
64} // namespace systemc
65} // namespace simics
66
67#endif
Utility class that handles the context switching, using RAII methodology.
Definition: context.h:31
Definition: mii_management_interface.h:25
Interface to the SystemC simulation.
Definition: simulation_interface.h:27
Definition: gasket_adapter.h:45
Base class, responsible for handling a gasket.
Definition: gasket_owner.h:32
Definition: mii_management_gasket_adapter.h:32
void write_register(int phy, int reg, uint16_t value) override
Definition: mii_management_gasket_adapter.h:49
uint16_t read_register(int phy, int reg) override
Definition: mii_management_gasket_adapter.h:45
simics2tlm::GasketOwner * gasket_owner() const override
Definition: mii_management_gasket_adapter.h:54
int serial_access(int data_in, int clock) override
Definition: mii_management_gasket_adapter.h:41
MiiManagementGasketAdapter(MiiManagementInterface *mii_management, iface::SimulationInterface *simulation)
Definition: mii_management_gasket_adapter.h:34
Definition: pci_bus_interface.h:24