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// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2016 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_ETHERNET_COMMON_EXTENSION_H
17#define SIMICS_SYSTEMC_IFACE_ETHERNET_COMMON_EXTENSION_H
18
21
22namespace simics {
23namespace systemc {
24namespace iface {
25
26class EthernetCommonExtension : public Extension<EthernetCommonExtension,
27 EthernetCommonInterface> {
28 public:
29 virtual void call(EthernetCommonInterface *device) {
30 switch (method_.value<Method>()) {
31 case FRAME:
32 device->frame(method_input_[0].value<const types::frags_t *>(),
33 method_input_[1].value<int>());
34 break;
35 }
36 }
37
38 virtual void frame(const types::frags_t *frame, int crc_ok) {
39 method_input_.push_back(frame);
40 method_input_.push_back(crc_ok);
41 method_ = FRAME;
42 send();
43 }
44
45 private:
46 enum Method {
47 FRAME
48 };
49};
50
51} // namespace iface
52} // namespace systemc
53} // namespace simics
54
55#endif
Definition: ethernet_common_extension.h:27
virtual void call(EthernetCommonInterface *device)
Definition: ethernet_common_extension.h:29
virtual void frame(const types::frags_t *frame, int crc_ok)
Definition: ethernet_common_extension.h:38
Simics ethernet_common interface.
Definition: ethernet_common_interface.h:26
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:40
std::vector< types::AnyType > method_input_
Definition: extension.h:118
T value()
Definition: any_type.h:84
Definition: pci_bus_interface.h:24
Definition: frags.h:38