C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
field-interface.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2022 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_FIELD_INTERFACE_H
17#define SIMICS_FIELD_INTERFACE_H
18
19#include <cstdint>
20#include <string>
21#include <string_view>
22#include <utility> // pair
23#include <vector>
24
27
28namespace simics {
29// Byte pointer and bits mask
30using bits_type = std::vector<std::pair<uint8_t *, uint8_t>>;
32
35 public:
36 virtual ~FieldInterface() = default;
37
43 virtual std::string_view name() const = 0;
44
50 virtual const std::string &description() const = 0;
51
53 virtual unsigned number_of_bits() const = 0;
54
60 virtual void init(std::string_view desc, const bits_type &bits,
61 int8_t offset) = 0;
62
64 virtual RegisterInterface *parent() const = 0;
65};
66
67} // namespace simics
68
69#endif
Definition: field-interface.h:34
virtual RegisterInterface * parent() const =0
virtual void init(std::string_view desc, const bits_type &bits, int8_t offset)=0
Initialize the field with a description, size in bits and an offset.
virtual std::string_view name() const =0
Get the name of the field without level delimiters.
virtual ~FieldInterface()=default
virtual unsigned number_of_bits() const =0
virtual const std::string & description() const =0
Get the description of the field.
Definition: register-interface.h:37
Definition: value-accessor-interface.h:24
Definition: value-mutator-interface.h:24
Definition: after-bank.h:33
std::vector< std::pair< uint8_t *, uint8_t > > bits_type
Definition: field-interface.h:30