C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
register-type.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_TYPE_REGISTER_TYPE_H
17#define SIMICS_TYPE_REGISTER_TYPE_H
18
19#include <tuple>
20#include <vector>
21#include <cstdint>
22
23#include "common-types.h"
24#include "field-type.h"
25
26namespace simics {
27/*
28 * Type alias represents a type containing register information
29 *
30 * It is a tuple consists of the following members:
31 *
32 * 1. A name of the register. The name should follow
33 * the Simics naming rules. To indicate an array, similar to a C array,
34 * specify the number of registers between a pair of square brackets,
35 * e.g., r[8]. By default the stride of the array is the size of the
36 * register, but other values can be chosen as follows, r[8 stride 4].
37 * 2. A human-readable description of the register
38 * 3. An address offset of the register relative to its enclosing bank
39 * 4. An nonzero number of 8-bit bytes of the register
40 * 5. An initial value of the register
41 * 6. Optional fields information. An empty vector means no fields for
42 * the register.
43 */
45 InitValue, std::vector<field_t>>;
46
47/*
48 * Type alias represents a type for register memory
49 *
50 * It's a vector consisting of byte pointers
51 */
52using register_memory_t = std::vector<uint8_t *>;
53
54} // namespace simics
55
56#endif
Definition: attr-value.h:23
detail::HierarchicalObjectName Name
Type used to name a resource.
Definition: common-types.h:40
std::tuple< Name, Description, Offset, ByteSize, InitValue, std::vector< field_t > > register_t
Definition: register-type.h:45
std::string_view Description
Type used to describe a resource.
Definition: common-types.h:43
std::vector< uint8_t * > register_memory_t
Definition: register-type.h:52
detail::ConstSizeT Offset
Type used for memory address offset.
Definition: common-types.h:46
detail::ConstSizeT InitValue
Type used for initial value.
Definition: common-types.h:52
detail::ConstSizeT ByteSize
Type used for the number/size of byte TODO(xiuliang): add valid value checker?
Definition: common-types.h:56