MU Library
dpe_common.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: Apache-2.0
2 // Copyright 2024 XCENA Inc.
3 
4 #pragma once
5 
6 #include <cstdint>
7 
8 namespace mu
9 {
10 
11 constexpr uint64_t DpeAddrAlignBit = 6;
12 enum class DpeMode
13 {
14  Bsw = 0, // ksw_extend2
15  Mate = 1, // ksw_u8
16  Global = 2, // ksw_global2
17  DB = 3,
18  NumDpeMode = 3,
19 };
20 
21 enum class DpeLaunch
22 {
23  Sync = 0,
24  Async = 1
25 };
26 
27 enum class DpeBuffer
28 {
29  DPB = 0,
30  LDB = 1,
31 };
32 
33 typedef union
34 {
35  uint64_t u64;
36  struct
37  {
38  int64_t h : 10; // 0~9
39  int64_t : 2; // 10~11
40  int64_t f : 10; // 12~21
41  int64_t : 2; // 22~23
42  int64_t maxValue : 10; // 24~33
43  int64_t maxOffset : 14; // 34~48
44  int64_t maxIE : 15; // 49~64
45  int64_t : 1; // 65
46  };
47 } DpeOutput_t;
48 
49 typedef union
50 {
51  uint64_t u64;
52  struct
53  {
54  int64_t maxJ : 9; // 0~8
55  int64_t maxI : 15; // 9~23
56  int64_t maxValue : 10; // 24~34
57  int64_t : 1;
58  uint64_t endI : 14; // 35~48
59  int64_t gscore : 11; // 49~59
60  uint64_t rsvd : 4; // 63
61  } bt;
62 } DpeResult_t;
63 
64 typedef union
65 {
66  int64_t dpeScores;
67 
68  struct
69  {
70  int64_t h : 12;
71  int64_t e : 12;
72  int64_t : 40;
73  } dpb;
74  struct
75  {
76  int64_t h : 12;
77  int64_t f : 12;
78  int64_t : 40;
79  } ldb;
80 } DpeScore_t;
81 
82 typedef union
83 {
84  int64_t u64;
85 
86  struct
87  {
88  int64_t H : 12;
89  int64_t E : 12;
90  int64_t STR : 8;
91  int64_t : 32;
92  };
93 } DpeCsrDpb_t;
94 
95 typedef union
96 {
97  int64_t u64;
98 
99  struct
100  {
101  int64_t H : 12;
102  int64_t F : 12;
103  int64_t STR : 8;
104  int64_t Upper32 : 32;
105  };
106 } DpeCsrLdb_t;
107 
108 } // namespace mu
Definition: assert.hpp:9
constexpr uint64_t DpeAddrAlignBit
Definition: dpe_common.hpp:11
DpeMode
Definition: dpe_common.hpp:13
DpeBuffer
Definition: dpe_common.hpp:28
DpeLaunch
Definition: dpe_common.hpp:22
int64_t maxOffset
Definition: dpe_common.hpp:43
int64_t maxValue
Definition: dpe_common.hpp:42
int64_t maxValue
Definition: dpe_common.hpp:56
int64_t dpeScores
Definition: dpe_common.hpp:66