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_IFACE_FIELD_INTERFACE_H
17#define SIMICS_IFACE_FIELD_INTERFACE_H
18
19#include <string_view>
20#include <vector>
21#include <string>
22#include <utility> // pair
23#include <cstdint>
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
38 // @return the field name without level delimiter
39 virtual std::string_view name() const = 0;
40
41 // @return the description string
42 virtual const std::string &description() const = 0;
43
44 // @return the number of bits for this field
45 virtual unsigned number_of_bits() const = 0;
46
47 // Initialize the field
48 // @param offset is the offset of the first bit in the containing register
49 virtual void init(std::string_view desc, const bits_type &bits,
50 int8_t offset) = 0;
51
52 // @return the parent register interface
53 virtual RegisterInterface *parent() const = 0;
54};
55
56} // namespace simics
57
58#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
virtual std::string_view name() const =0
virtual ~FieldInterface()=default
virtual unsigned number_of_bits() const =0
virtual const std::string & description() const =0
Definition: register-interface.h:36
Definition: value-accessor-interface.h:24
Definition: value-mutator-interface.h:24
Definition: attr-value.h:23
std::vector< std::pair< uint8_t *, uint8_t > > bits_type
Definition: field-interface.h:30