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