SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
ethernet_common_extension.h
Go to the documentation of this file.
1/*
2 © 2016 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_ETHERNET_COMMON_EXTENSION_H
15#define SIMICS_SYSTEMC_IFACE_ETHERNET_COMMON_EXTENSION_H
16
19
20namespace simics {
21namespace systemc {
22namespace iface {
23
24class EthernetCommonExtension : public Extension<EthernetCommonExtension,
25 EthernetCommonInterface> {
26 public:
27 void call(EthernetCommonInterface *device) override {
28 switch (method_.value<Method>()) {
29 case FRAME:
30 device->frame(method_input_[0].value<const types::frags_t *>(),
31 method_input_[1].value<int>());
32 break;
33 }
34 }
35
36 void frame(const types::frags_t *frame, int crc_ok) override {
37 method_input_.push_back(frame);
38 method_input_.push_back(crc_ok);
39 method_ = FRAME;
40 send();
41 }
42
43 private:
44 enum Method {
45 FRAME
46 };
47};
48
49} // namespace iface
50} // namespace systemc
51} // namespace simics
52
53#endif
Definition: ethernet_common_extension.h:25
void frame(const types::frags_t *frame, int crc_ok) override
Definition: ethernet_common_extension.h:36
void call(EthernetCommonInterface *device) override
Definition: ethernet_common_extension.h:27
Simics ethernet_common interface.
Definition: ethernet_common_interface.h:24
virtual void frame(const types::frags_t *frame, int crc_ok)=0
Base class for TLM2 extension, responsible for marshal/unmarshal of a Simics interface.
Definition: extension.h:38
std::vector< types::AnyType > method_input_
Definition: extension.h:116
T value()
Definition: any_type.h:87
Definition: adapter.h:79
Definition: frags.h:36