-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathtt_silicon_driver_common.hpp
More file actions
74 lines (61 loc) · 2.97 KB
/
tt_silicon_driver_common.hpp
File metadata and controls
74 lines (61 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* SPDX-FileCopyrightText: (c) 2023 Tenstorrent Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <cstdint>
#include <string>
typedef struct {
uint32_t chip_addr;
uint32_t host_phys_addr;
uint32_t completion_flag_phys_addr;
uint32_t size_bytes : 28;
uint32_t write : 1;
uint32_t pcie_msi_on_done : 1;
uint32_t pcie_write_on_done : 1;
uint32_t trigger : 1;
uint32_t repeat;
} arc_pcie_ctrl_dma_request_t; // 5 * 4 = 20B
enum class TensixSoftResetOptions: std::uint32_t {
NONE = 0,
BRISC = ((std::uint32_t) 1 << 11),
TRISC0 = ((std::uint32_t) 1 << 12),
TRISC1 = ((std::uint32_t) 1 << 13),
TRISC2 = ((std::uint32_t) 1 << 14),
NCRISC = ((std::uint32_t) 1 << 18),
STAGGERED_START = ((std::uint32_t) 1 << 31)
};
std::string TensixSoftResetOptionsToString(TensixSoftResetOptions value);
constexpr TensixSoftResetOptions operator|(TensixSoftResetOptions lhs, TensixSoftResetOptions rhs) {
return static_cast<TensixSoftResetOptions>(
static_cast<uint32_t>(lhs) |
static_cast<uint32_t>(rhs)
);
}
constexpr TensixSoftResetOptions operator&(TensixSoftResetOptions lhs, TensixSoftResetOptions rhs) {
return static_cast<TensixSoftResetOptions>(
static_cast<uint32_t>(lhs) &
static_cast<uint32_t>(rhs)
);
}
constexpr bool operator!=(TensixSoftResetOptions lhs, TensixSoftResetOptions rhs) {
return
static_cast<uint32_t>(lhs) !=
static_cast<uint32_t>(rhs);
}
static constexpr TensixSoftResetOptions ALL_TRISC_SOFT_RESET = TensixSoftResetOptions::TRISC0 |
TensixSoftResetOptions::TRISC1 |
TensixSoftResetOptions::TRISC2;
static constexpr TensixSoftResetOptions ALL_TENSIX_SOFT_RESET = TensixSoftResetOptions::BRISC |
TensixSoftResetOptions::NCRISC |
TensixSoftResetOptions::STAGGERED_START |
ALL_TRISC_SOFT_RESET;
static constexpr TensixSoftResetOptions TENSIX_ASSERT_SOFT_RESET = TensixSoftResetOptions::BRISC |
TensixSoftResetOptions::NCRISC |
ALL_TRISC_SOFT_RESET;
static constexpr TensixSoftResetOptions TENSIX_DEASSERT_SOFT_RESET = TensixSoftResetOptions::NCRISC |
ALL_TRISC_SOFT_RESET |
TensixSoftResetOptions::STAGGERED_START;
static constexpr TensixSoftResetOptions TENSIX_DEASSERT_SOFT_RESET_NO_STAGGER = TensixSoftResetOptions::NCRISC |
ALL_TRISC_SOFT_RESET;