C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
bank-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_BANK_TYPE_H
17#define SIMICS_TYPE_BANK_TYPE_H
18
19#include <cstdint>
20#include <tuple>
21#include <unordered_map>
22#include <vector>
23
26
27namespace simics {
28
29/*
30 * Type alias represents a type containing bank information
31 *
32 * It is a tuple consists of following members,
33 *
34 * 1. A name of the bank. The name should follow the Simics naming rules
35 * 2. A human-readable description of the bank
36 * 3. The contained registers on the bank
37 */
38using bank_t = std::tuple<Name, Description, std::vector<register_t>>;
39
40/*
41 * Type alias representing the memory contents of a bank.
42 *
43 * This unordered_map maps each used byte offset (relative to the start of the bank)
44 * to its corresponding 8-bit value. Each entry represents a single byte at a unique
45 * offset. The offsets do not need to be continuous; only the bytes that are actually
46 * used or mapped are present in the map.
47 *
48 * For example, a bank may contain:
49 * { 0, 0xde }, { 43, 0xad }
50 * which means offset 0 contains 0xde and offset 43 contains 0xad.
51 */
52using bank_memory_t = std::unordered_map<Offset, uint8_t>;
53
54} // namespace simics
55
56#endif
Definition: after-bank.h:33
std::unordered_map< Offset, uint8_t > bank_memory_t
Definition: bank-type.h:52
std::tuple< Name, Description, std::vector< register_t > > bank_t
Definition: bank-type.h:38