LCOV - code coverage report
Current view: top level - base_comm/resources/ccu/ccu_microcode - ccu_microcode_v1.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 5 5
Test Date: 2026-08-04 10:52:23 Functions: 100.0 % 1 1

            Line data    Source code
       1              : /*
       2              :  * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
       3              :  * Description: ccu instruction header file
       4              :  * Author: sunzhepeng
       5              :  * Create: 2024-05-14
       6              :  */
       7              : 
       8              : #ifndef CCU_MICROCODE_H
       9              : #define CCU_MICROCODE_H
      10              : 
      11              : #include <cstdint>
      12              : #include <string>
      13              : #include <unordered_map>
      14              : namespace hcomm {
      15              : namespace CcuRep {
      16              : 
      17              : constexpr uint16_t CCU_REDUCE_SUM = 0;
      18              : constexpr uint16_t CCU_REDUCE_MAX = 1;
      19              : constexpr uint16_t CCU_REDUCE_MIN = 2;
      20              : 
      21              : constexpr uint16_t CCU_REDUCE_MIN_MS = 2;
      22              : constexpr uint16_t CCU_REDUCE_MAX_MS = 8;
      23              : 
      24              : constexpr uint64_t CCU_MS_SIZE               = 4096;
      25              : constexpr uint64_t CCU_MS_INTERLEAVE         = 8;
      26              : constexpr uint64_t CCU_MS_DEFAULT_LOOP_COUNT = 128;
      27              : 
      28              : constexpr uint16_t CCU_LOAD_TO_XN_SEC_INFO = 1;
      29              : 
      30              : #pragma pack(push, 1)
      31              : // instr common header
      32              : union CcuInstrHeader {
      33              :     struct {
      34              :         uint16_t code : 11;
      35              :         uint16_t type : 4;
      36              :         uint16_t reserved : 1;
      37              :     };
      38              : 
      39              :     uint16_t header;
      40              : };
      41              : #pragma pack(pop)
      42              : 
      43         4142 : inline CcuInstrHeader InstrHeader(uint16_t type, uint16_t code)
      44              : {
      45         4142 :     CcuInstrHeader header = {};
      46         4142 :     header.type           = type;
      47         4142 :     header.code           = code;
      48         4142 :     return header;
      49              : }
      50              : 
      51              : namespace CcuV1 {
      52              : 
      53              : #pragma pack(push, 1)
      54              : // load instruction
      55              : struct CcuInstrLoadSqeArgsToGSA {
      56              :     uint16_t gsaId;
      57              :     uint16_t sqeArgsId;
      58              :     uint16_t reserved[13];
      59              : };
      60              : 
      61              : struct CcuInstrLoadSqeArgsToXn {
      62              :     uint16_t xnId;
      63              :     uint16_t sqeArgsId;
      64              :     uint16_t reserved[13];
      65              : };
      66              : 
      67              : struct CcuInstrLoadImdToGSA {
      68              :     uint16_t gsaId;
      69              :     uint64_t immediate;
      70              :     uint16_t reserved[10];
      71              : };
      72              : 
      73              : struct CcuInstrLoadImdToXn {
      74              :     uint16_t xnId;
      75              :     uint64_t immediate;
      76              :     uint16_t secFlag;
      77              :     uint16_t reserved[9];
      78              : };
      79              : 
      80              : struct CcuInstrLoadGSAXn {
      81              :     uint16_t gsAdId;
      82              :     uint16_t gsAmId;
      83              :     uint16_t xnId;
      84              :     uint16_t reserved[12];
      85              : };
      86              : 
      87              : struct CcuInstrLoadGSAGSA {
      88              :     uint16_t gsAdId;
      89              :     uint16_t gsAmId;
      90              :     uint16_t gsAnId;
      91              :     uint16_t reserved[12];
      92              : };
      93              : 
      94              : struct CcuInstrLoadXX {
      95              :     uint16_t xdId;
      96              :     uint16_t xmId;
      97              :     uint16_t xnId;
      98              :     uint16_t reserved[12];
      99              : };
     100              : 
     101              : // loop control instruction
     102              : struct CcuInstrLoop {
     103              :     uint16_t startInstrId; // 开始指令地址Id
     104              :     uint16_t endInstrId;   // 结束指令地址Id
     105              :     uint16_t xnId;         // LoopCtxId[52:45], Offset[44:13], IterNum[12:0]
     106              :     uint16_t reserved[12];
     107              : };
     108              : 
     109              : struct CcuInstrLoopGroup {
     110              :     uint16_t startLoopInstrId; // 开始loop地址Id
     111              :     uint16_t xnId;             // LoopNum[61:55], RepeatNum[54:48], NoRepeatNum[47:41]
     112              :     uint16_t xmId;             // gsaOffset[52:21], MSOffset[20:10], ckeOffset[9:0]
     113              :     uint16_t highPerfModeEn : 1;
     114              :     uint16_t reserved1 : 15;
     115              :     uint16_t reserved[11];
     116              : };
     117              : 
     118              : struct CcuInstrSetCKE {
     119              :     uint16_t clearType : 1;
     120              :     uint16_t reserved1 : 15;
     121              :     uint16_t setCKEId;
     122              :     uint16_t setCKEMask;
     123              :     uint16_t waitCKEId;
     124              :     uint16_t waitCKEMask;
     125              :     uint16_t reserved[10];
     126              : };
     127              : 
     128              : struct CcuInstrClearCKE {
     129              :     uint16_t clearType : 1;
     130              :     uint16_t reserved1 : 15;
     131              :     uint16_t clearCKEId;
     132              :     uint16_t clearMask;
     133              :     uint16_t waitCKEId;
     134              :     uint16_t waitCKEMask;
     135              :     uint16_t reserved[10];
     136              : };
     137              : 
     138              : struct CcuInstrJmp {
     139              :     uint16_t dstInstrXnId;
     140              :     uint16_t conditionXnId;
     141              :     uint64_t expectData;
     142              : };
     143              : 
     144              : // data transfer instruction
     145              : struct CcuInstrTransLocMemToLocMS {
     146              :     uint16_t locMSId;
     147              :     uint16_t locGSAId;
     148              :     uint16_t locXnId;
     149              :     uint16_t lengthXnId;
     150              :     uint16_t channelId;
     151              :     uint16_t reserved1[5];
     152              :     uint16_t clearType : 1;
     153              :     uint16_t lengthEn : 1;
     154              :     uint16_t reserved : 14;
     155              :     uint16_t setCKEId;
     156              :     uint16_t setCKEMask;
     157              :     uint16_t waitCKEId;
     158              :     uint16_t waitCKEMask;
     159              : };
     160              : 
     161              : struct CcuInstrTransRmtMemToLocMS {
     162              :     uint16_t locMSId;
     163              :     uint16_t rmtGSAId;
     164              :     uint16_t rmtXnId;
     165              :     uint16_t lengthXnId;
     166              :     uint16_t channelId;
     167              :     uint16_t reserved1[5];
     168              :     uint16_t clearType : 1;
     169              :     uint16_t lengthEn : 1;
     170              :     uint16_t reserved : 14;
     171              :     uint16_t setCKEId;
     172              :     uint16_t setCKEMask;
     173              :     uint16_t waitCKEId;
     174              :     uint16_t waitCKEMask;
     175              : };
     176              : 
     177              : struct CcuInstrTransLocMSToLocMem {
     178              :     uint16_t locGSAId;
     179              :     uint16_t locXnId;
     180              :     uint16_t locMSId;
     181              :     uint16_t lengthXnId;
     182              :     uint16_t channelId;
     183              :     uint16_t reserved1[5];
     184              :     uint16_t clearType : 1;
     185              :     uint16_t lengthEn : 1;
     186              :     uint16_t reserved : 14;
     187              :     uint16_t setCKEId;
     188              :     uint16_t setCKEMask;
     189              :     uint16_t waitCKEId;
     190              :     uint16_t waitCKEMask;
     191              : };
     192              : 
     193              : struct CcuInstrTransLocMSToRmtMem {
     194              :     uint16_t rmtGSAId;
     195              :     uint16_t rmtXnId;
     196              :     uint16_t locMSId;
     197              :     uint16_t lengthXnId;
     198              :     uint16_t channelId;
     199              :     uint16_t reserved1[5];
     200              :     uint16_t clearType : 1;
     201              :     uint16_t lengthEn : 1;
     202              :     uint16_t reserved : 14;
     203              :     uint16_t setCKEId;
     204              :     uint16_t setCKEMask;
     205              :     uint16_t waitCKEId;
     206              :     uint16_t waitCKEMask;
     207              : };
     208              : 
     209              : struct CcuInstrTransRmtMSToLocMem {
     210              :     uint16_t locGSAId;
     211              :     uint16_t locXnId;
     212              :     uint16_t rmtMSId;
     213              :     uint16_t lengthXnId;
     214              :     uint16_t channelId;
     215              :     uint16_t reserved1[5];
     216              :     uint16_t clearType : 1;
     217              :     uint16_t lengthEn : 1;
     218              :     uint16_t reserved : 14;
     219              :     uint16_t setCKEId;
     220              :     uint16_t setCKEMask;
     221              :     uint16_t waitCKEId;
     222              :     uint16_t waitCKEMask;
     223              : };
     224              : 
     225              : struct CcuInstrTransLocMSToLocMS {
     226              :     uint16_t dstMSId;
     227              :     uint16_t srcMSId;
     228              :     uint16_t lengthXnId;
     229              :     uint16_t channelId;
     230              :     uint16_t reserved1[6];
     231              :     uint16_t clearType : 1;
     232              :     uint16_t lengthEn : 1;
     233              :     uint16_t reserved : 14;
     234              :     uint16_t setCKEId;
     235              :     uint16_t setCKEMask;
     236              :     uint16_t waitCKEId;
     237              :     uint16_t waitCKEMask;
     238              : };
     239              : 
     240              : struct CcuInstrTransRmtMSToLocMS {
     241              :     uint16_t locMSId;
     242              :     uint16_t rmtMSId;
     243              :     uint16_t lengthXnId;
     244              :     uint16_t channelId;
     245              :     uint16_t reserved1[6];
     246              :     uint16_t clearType : 1;
     247              :     uint16_t lengthEn : 1;
     248              :     uint16_t reserved : 14;
     249              :     uint16_t setCKEId;
     250              :     uint16_t setCKEMask;
     251              :     uint16_t waitCKEId;
     252              :     uint16_t waitCKEMask;
     253              : };
     254              : 
     255              : struct CcuInstrTransLocMSToRmtMS {
     256              :     uint16_t rmtMSId;
     257              :     uint16_t locMSId;
     258              :     uint16_t lengthXnId;
     259              :     uint16_t channelId;
     260              :     uint16_t setRmtCKEId;
     261              :     uint16_t setRmtCKEMask;
     262              :     uint16_t reserved1[4];
     263              :     uint16_t clearType : 1;
     264              :     uint16_t lengthEn : 1;
     265              :     uint16_t reserved : 14;
     266              :     uint16_t setCKEId;
     267              :     uint16_t setCKEMask;
     268              :     uint16_t waitCKEId;
     269              :     uint16_t waitCKEMask;
     270              : };
     271              : 
     272              : struct CcuInstrTransRmtMemToLocMem {
     273              :     uint16_t locGSAId;
     274              :     uint16_t locXnId;
     275              :     uint16_t rmtGSAId;
     276              :     uint16_t rmtXnId;
     277              :     uint16_t lengthXnId;
     278              :     uint16_t channelId;
     279              :     uint16_t udfType : 8;
     280              :     uint16_t reduceDataType : 4;
     281              :     uint16_t reduceOpCode : 4;
     282              :     uint16_t reserved[3];
     283              :     uint16_t clearType : 1;
     284              :     uint16_t lengthEn : 1;
     285              :     uint16_t reduceEn : 1;
     286              :     uint16_t reserved1 : 13;
     287              :     uint16_t setCKEId;
     288              :     uint16_t setCKEMask;
     289              :     uint16_t waitCKEId;
     290              :     uint16_t waitCKEMask;
     291              : };
     292              : 
     293              : struct CcuInstrTransLocMemToRmtMem {
     294              :     uint16_t rmtGSAId;
     295              :     uint16_t rmtXnId;
     296              :     uint16_t locGSAId;
     297              :     uint16_t locXnId;
     298              :     uint16_t lengthXnId;
     299              :     uint16_t channelId;
     300              :     uint16_t udfType : 8;
     301              :     uint16_t reduceDataType : 4;
     302              :     uint16_t reduceOpCode : 4;
     303              :     uint16_t reserved[3];
     304              :     uint16_t clearType : 1;
     305              :     uint16_t lengthEn : 1;
     306              :     uint16_t reduceEn : 1;
     307              :     uint16_t reserved1 : 13;
     308              :     uint16_t setCKEId;
     309              :     uint16_t setCKEMask;
     310              :     uint16_t waitCKEId;
     311              :     uint16_t waitCKEMask;
     312              : };
     313              : 
     314              : struct CcuInstrTransLocMemToLocMem {
     315              :     uint16_t dstGSAId;
     316              :     uint16_t dstXnId;
     317              :     uint16_t srcGSAId;
     318              :     uint16_t srcXnId;
     319              :     uint16_t lengthXnId;
     320              :     uint16_t channelId;
     321              :     uint16_t reserved1[4];
     322              :     uint16_t clearType : 1;
     323              :     uint16_t lengthEn : 1;
     324              :     uint16_t reserved : 14;
     325              :     uint16_t setCKEId;
     326              :     uint16_t setCKEMask;
     327              :     uint16_t waitCKEId;
     328              :     uint16_t waitCKEMask;
     329              : };
     330              : 
     331              : struct CcuInstrSyncCKE {
     332              :     uint16_t rmtCKEId;
     333              :     uint16_t locCKEId;
     334              :     uint16_t locCKEMask;
     335              :     uint16_t channelId;
     336              :     uint16_t reserved[6];
     337              :     uint16_t clearType : 1;
     338              :     uint16_t reserved1 : 15;
     339              :     uint16_t setCKEId;
     340              :     uint16_t setCKEMask;
     341              :     uint16_t waitCKEId;
     342              :     uint16_t waitCKEMask;
     343              : };
     344              : 
     345              : struct CcuInstrSyncGSA {
     346              :     uint16_t rmtGSAId;
     347              :     uint16_t locGSAId;
     348              :     uint16_t reserved2;
     349              :     uint16_t channelId;
     350              :     uint16_t setRmtCKEId;
     351              :     uint16_t setRmtCKEMask;
     352              :     uint16_t reserved[4];
     353              :     uint16_t clearType : 1;
     354              :     uint16_t reserved1 : 15;
     355              :     uint16_t setCKEId;
     356              :     uint16_t setCKEMask;
     357              :     uint16_t waitCKEId;
     358              :     uint16_t waitCKEMask;
     359              : };
     360              : 
     361              : struct CcuInstrSyncXn {
     362              :     uint16_t rmtXnId;
     363              :     uint16_t locXnId;
     364              :     uint16_t reserved2;
     365              :     uint16_t channelId;
     366              :     uint16_t setRmtCKEId;
     367              :     uint16_t setRmtCKEMask;
     368              :     uint16_t reserved[4];
     369              :     uint16_t clearType : 1;
     370              :     uint16_t reserved1 : 15;
     371              :     uint16_t setCKEId;
     372              :     uint16_t setCKEMask;
     373              :     uint16_t waitCKEId;
     374              :     uint16_t waitCKEMask;
     375              : };
     376              : 
     377              : struct CcuInstrAdd {
     378              :     uint16_t msId[CCU_REDUCE_MAX_MS];
     379              :     uint16_t XnIdLength;
     380              :     uint16_t reserved;
     381              :     uint16_t clearType : 1;
     382              :     uint16_t count : 3;
     383              :     uint16_t castEn : 2;
     384              :     uint16_t reserved1 : 5;
     385              :     uint16_t dataType : 5;
     386              :     uint16_t setCKEId;
     387              :     uint16_t setCKEMask;
     388              :     uint16_t waitCKEId;
     389              :     uint16_t waitCKEMask;
     390              : };
     391              : 
     392              : struct CcuInstrMax {
     393              :     uint16_t msId[CCU_REDUCE_MAX_MS];
     394              :     uint16_t XnIdLength;
     395              :     uint16_t reserved;
     396              :     uint16_t clearType : 1;
     397              :     uint16_t count : 3;
     398              :     uint16_t reserved1 : 7;
     399              :     uint16_t dataType : 5;
     400              :     uint16_t setCKEId;
     401              :     uint16_t setCKEMask;
     402              :     uint16_t waitCKEId;
     403              :     uint16_t waitCKEMask;
     404              : };
     405              : 
     406              : struct CcuInstrMin {
     407              :     uint16_t msId[CCU_REDUCE_MAX_MS];
     408              :     uint16_t XnIdLength;
     409              :     uint16_t reserved;
     410              :     uint16_t clearType : 1;
     411              :     uint16_t count : 3;
     412              :     uint16_t reserved1 : 7;
     413              :     uint16_t dataType : 5;
     414              :     uint16_t setCKEId;
     415              :     uint16_t setCKEMask;
     416              :     uint16_t waitCKEId;
     417              :     uint16_t waitCKEMask;
     418              : };
     419              : #pragma pack(pop)
     420              : 
     421              : union CcuMicroCodeV1 {
     422              :     CcuV1::CcuInstrLoadSqeArgsToGSA loadSqeArgsToGSA;
     423              :     CcuV1::CcuInstrLoadSqeArgsToXn  loadSqeArgsToXn;
     424              :     CcuV1::CcuInstrLoadImdToGSA     loadImdToGSA;
     425              :     CcuV1::CcuInstrLoadImdToXn      loadImdToXn;
     426              :     CcuV1::CcuInstrLoadGSAXn        loadGSAXn;
     427              :     CcuV1::CcuInstrLoadGSAGSA       loadGSAGSA;
     428              :     CcuV1::CcuInstrLoadXX           loadXX;
     429              : 
     430              :     CcuV1::CcuInstrLoop      loop;
     431              :     CcuV1::CcuInstrLoopGroup loopGroup;
     432              :     CcuV1::CcuInstrSetCKE    setCKE;
     433              :     CcuV1::CcuInstrClearCKE  clearCKE;
     434              :     CcuV1::CcuInstrJmp       jmp;
     435              : 
     436              :     CcuV1::CcuInstrTransLocMemToLocMS transLocMemToLocMS;
     437              :     CcuV1::CcuInstrTransRmtMemToLocMS transRmtMemToLocMS;
     438              :     CcuV1::CcuInstrTransLocMSToLocMem transLocMSToLocMem;
     439              :     CcuV1::CcuInstrTransLocMSToRmtMem transLocMSToRmtMem;
     440              :     CcuV1::CcuInstrTransRmtMSToLocMem transRmtMSToLocMem;
     441              : 
     442              :     CcuV1::CcuInstrTransLocMSToLocMS transLocMSToLocMS;
     443              :     CcuV1::CcuInstrTransRmtMSToLocMS transRmtMSToLocMS;
     444              :     CcuV1::CcuInstrTransLocMSToRmtMS transLocMSToRmtMS;
     445              : 
     446              :     CcuV1::CcuInstrTransRmtMemToLocMem transRmtMemToLocMem;
     447              :     CcuV1::CcuInstrTransLocMemToRmtMem transLocMemToRmtMem;
     448              :     CcuV1::CcuInstrTransLocMemToLocMem transLocMemToLocMem;
     449              : 
     450              :     CcuV1::CcuInstrSyncCKE syncCKE;
     451              :     CcuV1::CcuInstrSyncGSA syncGSA;
     452              :     CcuV1::CcuInstrSyncXn  syncXn;
     453              : 
     454              :     CcuV1::CcuInstrAdd add;
     455              :     CcuV1::CcuInstrMax max;
     456              :     CcuV1::CcuInstrMin min;
     457              : };
     458              : 
     459              : }; // namespace CcuV1
     460              : 
     461              : namespace CcuV2 {
     462              : 
     463              : struct CacheConfig {
     464              :     uint16_t allocHint;
     465              :     uint16_t victimHint;
     466              : };
     467              : 
     468              : struct TransMemNotifyInfo {
     469              :     uint16_t xnId;
     470              :     uint16_t xntId;
     471              :     uint32_t value;
     472              : };
     473              : 
     474              : struct TransMemReduceInfo {
     475              :     uint16_t udfType;
     476              :     uint16_t reduceDataType;
     477              :     uint16_t reduceOpCode;
     478              : };
     479              : 
     480              : struct TransMemConfig {
     481              :     uint16_t dmaOpCode;
     482              :     uint16_t order;
     483              :     uint16_t fence;
     484              :     uint16_t cqe;
     485              :     uint16_t nf;
     486              :     uint16_t udfEnable;
     487              :     uint16_t splitMode;
     488              :     uint16_t se;
     489              :     uint16_t rmtJettyType;
     490              :     uint16_t src_mode;
     491              :     uint16_t dst_mode;
     492              :     uint16_t msIdMode;
     493              : };
     494              : 
     495              : #pragma pack(push, 1)
     496              : 
     497              : // load instruction
     498              : struct CcuInstrLoadSqeArgsToX {
     499              :     uint16_t xnId;
     500              :     uint16_t sqeArgsId;
     501              :     uint16_t reserved[11];
     502              :     uint16_t setCKEId;
     503              :     uint16_t setCKEMask;
     504              : };
     505              : 
     506              : struct CcuInstrLoadImdToX {
     507              :     uint16_t xnId;
     508              :     uint64_t immediate;
     509              :     uint16_t reserved[8];
     510              :     uint16_t setCKEId;
     511              :     uint16_t setCKEMask;
     512              : };
     513              : 
     514              : struct CcuInstrLoadStoreX {
     515              :     uint16_t xdId;
     516              :     uint16_t xsId;
     517              :     uint16_t xsoId;
     518              :     uint16_t xdoId;
     519              :     uint16_t oMode : 1;
     520              :     uint16_t reserved : 15;
     521              :     uint16_t reserved1[8];
     522              :     uint16_t setCKEId;
     523              :     uint16_t setCKEMask;
     524              : };
     525              : 
     526              : struct CcuInstrClearX {
     527              :     uint16_t xnId : 15;
     528              :     uint16_t xnIdMode : 1;
     529              :     uint16_t xmId : 15;
     530              :     uint16_t xmIdMode : 1;
     531              :     uint16_t reserved[11];
     532              :     uint16_t setCKEId;
     533              :     uint16_t setCKEMask;
     534              : };
     535              : 
     536              : struct CcuInstrNop {
     537              :     uint16_t reserved[15];
     538              : };
     539              : 
     540              : struct CcuInstrLoad {
     541              :     uint16_t xdId;
     542              :     uint16_t xsId;
     543              :     uint16_t xstId;
     544              :     uint16_t xlId;
     545              :     uint16_t reserved[6];
     546              :     uint16_t dstType : 4;
     547              :     uint16_t allocHint : 2;
     548              :     uint16_t victimHint : 2;
     549              :     uint16_t reserved1 : 8;
     550              :     uint16_t reserved2[2];
     551              :     uint16_t setCKEId;
     552              :     uint16_t setCKEMask;
     553              : };
     554              : 
     555              : struct CcuInstrStore {
     556              :     uint16_t xdId;
     557              :     uint16_t xdtId;
     558              :     uint16_t xsId;
     559              :     uint16_t xlId;
     560              :     uint16_t xhId;
     561              :     uint16_t reserved[5];
     562              :     uint16_t srcType : 4;
     563              :     uint16_t allocHint : 2;
     564              :     uint16_t victimHint : 2;
     565              :     uint16_t storeType : 1;
     566              :     uint16_t hscbType : 1;
     567              :     uint16_t hscbBroadCastDstType : 6;
     568              :     uint16_t reserved1[2];
     569              :     uint16_t setCKEId;
     570              :     uint16_t setCKEMask;
     571              : };
     572              : 
     573              : // 运算符复用相同的结构体
     574              : // 左移右移:需要指定shiftType
     575              : // A = B@C类算子,需要指定xd, xn, xm
     576              : // 按位非,需要指定xd, xn
     577              : // popcnt,需要指定xd, xn
     578              : struct CcuInstrOperator {
     579              :     uint16_t xdId;
     580              :     uint16_t xnId;
     581              :     uint16_t xmId;
     582              :     uint16_t parMode : 1;
     583              :     uint16_t reserved : 15;
     584              :     uint16_t reserved1[6];
     585              :     uint16_t shiftType : 1;
     586              :     uint16_t reserved2 : 15;
     587              :     uint16_t reserved3[2];
     588              :     uint16_t setCKEId;
     589              :     uint16_t setCKEMask;
     590              : };
     591              : 
     592              : // loop control instruction
     593              : struct CcuInstrLoop {
     594              :     uint16_t startInstrId; // 开始指令地址Id
     595              :     uint16_t endInstrId;   // 结束指令地址Id
     596              :     uint16_t xmId;         // IterNum[12:0]
     597              :     uint16_t xnId;         // Offset[31:0]
     598              :     uint16_t xpId;         // LoopCtxId[8:0]
     599              :     uint16_t wishCKEBit;
     600              :     uint16_t mode : 1;
     601              :     uint16_t reserved : 15;
     602              :     uint16_t reserved1[8];
     603              : };
     604              : 
     605              : struct CcuInstrLoopGroup {
     606              :     uint16_t startLoopInstrId; // 开始loop地址Id
     607              :     uint16_t xnId;             // ExtendNum[22:16], RepeatLoopIndex[15:9], LoopNum[8:0]
     608              :     uint16_t xmId;             // gsaOffset[52:21], MSOffset[20:10], ckeOffset[9:0]
     609              :     uint16_t xpId;             // xnOffset[31:0]
     610              :     uint16_t reserved[11];
     611              : };
     612              : 
     613              : struct CcuInstrSetCKE {
     614              :     uint16_t clearType : 1;
     615              :     uint16_t reserved : 15;
     616              :     uint16_t setCKEId;
     617              :     uint16_t setCKEMask;
     618              :     uint16_t waitCKEId;
     619              :     uint16_t waitCKEMask;
     620              :     uint64_t userData;
     621              :     uint16_t reserved1[6];
     622              : };
     623              : 
     624              : struct CcuInstrClearCKE {
     625              :     uint16_t clearType : 1;
     626              :     uint16_t reserved : 15;
     627              :     uint16_t clearCKEId;
     628              :     uint16_t clearMask;
     629              :     uint16_t waitCKEId;
     630              :     uint16_t waitCKEMask;
     631              :     uint16_t reserved1[10];
     632              : };
     633              : 
     634              : struct CcuInstrJmp {
     635              :     uint16_t expectedXnId;
     636              :     uint16_t conditionXnId;
     637              :     uint16_t relTarInstrXnId;
     638              :     uint16_t conditionType : 4;
     639              :     uint16_t jumpMode : 1;
     640              :     uint16_t reserved : 11;
     641              :     uint16_t reserved1[11];
     642              : };
     643              : 
     644              : struct CcuInstrWait {
     645              :     uint16_t conditionXnId;  //Xn
     646              :     uint16_t expectedXnId;  //Xm
     647              :     uint16_t conditionType : 4;
     648              :     uint16_t reserved : 12;
     649              :     uint16_t reserved1[12];
     650              : };
     651              : 
     652              : struct CcuInstrFence {
     653              :     uint16_t reserved[15];
     654              : };
     655              : 
     656              : // data transfer instruction
     657              : struct CcuInstrTransLocMemToLocMS {
     658              :     uint16_t msId;
     659              :     uint16_t xsId;
     660              :     uint16_t xstId;
     661              :     uint16_t xlId;
     662              :     uint16_t xoId;
     663              :     uint16_t allocHint : 2;
     664              :     uint16_t victimHint : 2;
     665              :     uint16_t reserved : 12;
     666              :     uint16_t reserved1[7];
     667              :     uint16_t setCKEId;
     668              :     uint16_t setCKEMask;
     669              : };
     670              : 
     671              : struct CcuInstrTransLocMSToLocMem {
     672              :     uint16_t xdId;
     673              :     uint16_t xdtId;
     674              :     uint16_t msId;
     675              :     uint16_t xlId;
     676              :     uint16_t xoId;
     677              :     uint16_t allocHint : 2;
     678              :     uint16_t victimHint : 2;
     679              :     uint16_t reserved : 12;
     680              :     uint16_t reserved1[7];
     681              :     uint16_t setCKEId;
     682              :     uint16_t setCKEMask;
     683              : };
     684              : 
     685              : struct CcuInstrTransLocMSToLocMS {
     686              :     uint16_t msdId;
     687              :     uint16_t mssId;
     688              :     uint16_t xlId;
     689              :     uint16_t xoId;
     690              :     uint16_t reserved[9];
     691              :     uint16_t setCKEId;
     692              :     uint16_t setCKEMask;
     693              : };
     694              : 
     695              : struct CcuInstrTransLocMemToLocMem {
     696              :     uint16_t xdId;
     697              :     uint16_t xdtId;
     698              :     uint16_t xsId;
     699              :     uint16_t xstId;
     700              :     uint16_t xlId;
     701              :     uint16_t usedMSId;
     702              :     uint16_t srcAllocHint : 2;
     703              :     uint16_t srcVictimHint : 2;
     704              :     uint16_t dstAllocHint : 2;
     705              :     uint16_t dstVictimHint : 2;
     706              :     uint16_t msNum : 8;
     707              :     uint16_t reserved1[6];
     708              :     uint16_t setCKEId;
     709              :     uint16_t setCKEMask;
     710              : };
     711              : 
     712              : struct CcuInstrTransMem {
     713              :     uint16_t xdId;  // 存储目的内存地址
     714              :     uint16_t xdtId; // 存储目的内存Token
     715              :     uint16_t xsId;  // 存储源内存地址
     716              :     uint16_t xstId; // 存储源内存Token
     717              :     uint16_t xlId;  // 存储要搬运的数据长度
     718              :     uint16_t xcId;  // 存储使用的channelId
     719              :     uint16_t xnId;  // 存储notify/atomic的目的地址
     720              :     uint16_t xntId; // 存储notify/atomic的目的Token
     721              :     uint32_t value; // notify value, atomic store add value, immeidata data, 视不同的opCode确定, 只支持32bit
     722              :     uint16_t udfType : 8;
     723              :     uint16_t reduceDataType : 4;
     724              :     uint16_t reduceOpCode : 4;
     725              :     uint16_t dmaOpCode : 8; // wqe中的opcode,支持0x0: send,0x1: send with immediata,0x3: Write,0x5: Write with
     726              :                             // Notify,0x6: Read,0x70: Write with atomic store add
     727              :     uint16_t order : 3;
     728              :     uint16_t fence : 1;
     729              :     uint16_t cqe : 1;
     730              :     uint16_t nf : 1; // No Fragment, 不允许分片
     731              :     uint16_t udfEnable : 1;
     732              :     uint16_t splitMode : 1;
     733              :     uint16_t se : 1;           // Solicited Event,Responder基于se来判断生成CQE时是否产生Completion Event
     734              :     uint16_t rmtJettyType : 2; // 00: JFR, 01: Jetty,10: JettyGroup,11: reserved
     735              :     uint16_t src_mode : 1;
     736              :     uint16_t dst_mode : 1;
     737              :     uint16_t msIdMode : 1;  // 标记是否使用transmem的msId模式
     738              :     uint16_t reserved : 2;
     739              :     uint16_t targetHint : 8;
     740              :     uint16_t setCKEId;
     741              :     uint16_t setCKEMask;
     742              : };
     743              : 
     744              : // SyncWtX指令固定将一个指定Xn的信息同步,固定8B
     745              : struct CcuInstrSyncWtX {
     746              :     uint16_t xdId;  // 存储目的Xn寄存器的地址
     747              :     uint16_t xdtId; // 存储目的Xn寄存器Token
     748              :     uint16_t xsId;  // 存储源Xn寄存器Id
     749              :     uint16_t xcId;  // 存储使用的channelId
     750              :     uint16_t xnId;  // 存储notify/atomic的目的地址
     751              :     uint16_t xntId; // 存储notify/atomic的目的Token
     752              :     uint32_t value; // notify value, 只支持32bit
     753              :     uint16_t notifyValid : 1;
     754              :     uint16_t parMode : 1;
     755              :     uint16_t reserved : 14;
     756              :     uint16_t reserved1[4];
     757              :     uint16_t setCKEId;
     758              :     uint16_t setCKEMask;
     759              : };
     760              : 
     761              : // SyncAtX指令以write with atomic store add发往对端,其中write的数据长度为0,本端Xn的值是写在atomic value中进行发送
     762              : struct CcuInstrSyncAtX {
     763              :     uint16_t xdId;  // 存储目的Xn寄存器的地址
     764              :     uint16_t xdtId; // 存储目的Xn寄存器Token
     765              :     uint16_t xsId;  // 存储源Xn寄存器Id
     766              :     uint16_t xcId;  // 存储使用的channelId
     767              :     uint16_t reserved : 1;
     768              :     uint16_t parMode : 1;
     769              :     uint16_t reserved1 : 14;
     770              :     uint16_t reserved2[8];
     771              :     uint16_t setCKEId;
     772              :     uint16_t setCKEMask;
     773              : };
     774              : 
     775              : // reduce instruction
     776              : // add: 配置castEn
     777              : // max和min: castEn保持默认为0
     778              : struct CcuInstrReduce {
     779              :     uint16_t msId[CCU_REDUCE_MAX_MS];
     780              :     uint16_t XnIdLength;
     781              :     uint16_t reserved;
     782              :     uint16_t reserved1 : 1;
     783              :     uint16_t count : 3;
     784              :     uint16_t castEn : 2;
     785              :     uint16_t reserved2 : 5;
     786              :     uint16_t dataType : 5;
     787              :     uint16_t reserved3[2];
     788              :     uint16_t setCKEId;
     789              :     uint16_t setCKEMask;
     790              : };
     791              : 
     792              : #pragma pack(pop)
     793              : 
     794              : union CcuMicroCodeV2 {
     795              :     CcuV2::CcuInstrLoadSqeArgsToX loadSqeArgsToX;
     796              :     CcuV2::CcuInstrLoadImdToX     loadImdToX;
     797              :     CcuV2::CcuInstrLoadStoreX     loadStoreX;
     798              :     CcuV2::CcuInstrClearX         clearX;
     799              :     CcuV2::CcuInstrNop            nop;
     800              :     CcuV2::CcuInstrOperator       operate;
     801              :     CcuV2::CcuInstrLoad           load;
     802              :     CcuV2::CcuInstrStore          store;
     803              : 
     804              :     CcuV2::CcuInstrLoop      loop;
     805              :     CcuV2::CcuInstrLoopGroup loopGroup;
     806              :     CcuV2::CcuInstrSetCKE    setCKE;
     807              :     CcuV2::CcuInstrClearCKE  clearCKE;
     808              :     CcuV2::CcuInstrJmp       jmp;
     809              :     CcuV2::CcuInstrWait      wait;
     810              :     CcuV2::CcuInstrFence     fence;
     811              : 
     812              :     CcuV2::CcuInstrTransLocMemToLocMS  transLocMemToLocMS;
     813              :     CcuV2::CcuInstrTransLocMSToLocMem  transLocMSToLocMem;
     814              :     CcuV2::CcuInstrTransLocMSToLocMS   transLocMSToLocMS;
     815              :     CcuV2::CcuInstrTransLocMemToLocMem transLocMemToLocMem;
     816              :     CcuV2::CcuInstrTransMem            transMem;
     817              :     CcuV2::CcuInstrSyncWtX             syncWtX;
     818              :     CcuV2::CcuInstrSyncAtX             syncAtX;
     819              : 
     820              :     CcuV2::CcuInstrReduce reduce;
     821              : };
     822              : }; // namespace CcuV2
     823              : 
     824              : struct CcuInstr {
     825              :     CcuInstrHeader header;
     826              :     union {
     827              :         CcuV1::CcuMicroCodeV1 v1;
     828              :         CcuV2::CcuMicroCodeV2 v2;
     829              :     };
     830              : };
     831              : 
     832              : std::string ParseInstr(const CcuInstr *instr);
     833              : 
     834              : void LoadSqeArgsToGSAInstr(CcuInstr *instr, uint16_t gsaId, uint16_t sqeArgsId);
     835              : void LoadSqeArgsToXnInstr(CcuInstr *instr, uint16_t xnId, uint16_t sqeArgsId);
     836              : void LoadImdToGSAInstr(CcuInstr *instr, uint16_t gsaId, uint64_t immediate);
     837              : void LoadImdToXnInstr(CcuInstr *instr, uint16_t xnId, uint64_t immediate, uint16_t secFlag = 0);
     838              : void LoadGSAXnInstr(CcuInstr *instr, uint16_t gsAdId, uint16_t gsAmId, uint16_t xnId);
     839              : void LoadGSAGSAInstr(CcuInstr *instr, uint16_t gsAdId, uint16_t gsAmId, uint16_t gsAnId);
     840              : void LoadXXInstr(CcuInstr *instr, uint16_t xdId, uint16_t xmId, uint16_t xnId);
     841              : 
     842              : void LoopInstr(CcuInstr *instr, uint16_t startInstrId, uint16_t endInstrId, uint16_t xnId);
     843              : void LoopGroupInstr(CcuInstr *instr, uint16_t startLoopInstrId, uint16_t xnId, uint16_t xmId, uint16_t highPerfModeEn);
     844              : void JumpInstr(CcuInstr *instr, uint16_t dstInstrXnId, uint16_t conditionXnId, uint64_t expectData);
     845              : void SetCKEInstr(CcuInstr *instr, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId, uint16_t waitCKEMask,
     846              :                  uint16_t clearType);
     847              : void ClearCKEInstr(CcuInstr *instr, uint16_t clearCKEId, uint16_t clearMask, uint16_t waitCKEId, uint16_t waitCKEMask,
     848              :                    uint16_t clearType);
     849              : 
     850              : void TransLocMemToLocMSInstr(CcuInstr *instr, uint16_t locMSId, uint16_t locGSAId, uint16_t locXnId,
     851              :                              uint16_t lengthXnId, uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask,
     852              :                              uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     853              : void TransRmtMemToLocMSInstr(CcuInstr *instr, uint16_t locMSId, uint16_t rmtGSAId, uint16_t rmtXnId,
     854              :                              uint16_t lengthXnId, uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask,
     855              :                              uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     856              : void TransLocMSToLocMemInstr(CcuInstr *instr, uint16_t locGSAId, uint16_t locXnId, uint16_t locMSId,
     857              :                              uint16_t lengthXnId, uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask,
     858              :                              uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     859              : void TransLocMSToRmtMemInstr(CcuInstr *instr, uint16_t rmtGSAId, uint16_t rmtXnId, uint16_t locMSId,
     860              :                              uint16_t lengthXnId, uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask,
     861              :                              uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     862              : void TransRmtMSToLocMemInstr(CcuInstr *instr, uint16_t locGSAId, uint16_t locXnId, uint16_t rmtMSId,
     863              :                              uint16_t lengthXnId, uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask,
     864              :                              uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     865              : 
     866              : void TransLocMSToLocMSInstr(CcuInstr *instr, uint16_t dstMSId, uint16_t srcMSId, uint16_t lengthXnId,
     867              :                             uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId,
     868              :                             uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     869              : void TransRmtMSToLocMSInstr(CcuInstr *instr, uint16_t locMSId, uint16_t rmtMSId, uint16_t lengthXnId,
     870              :                             uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId,
     871              :                             uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     872              : void TransLocMSToRmtMSInstr(CcuInstr *instr, uint16_t rmtMSId, uint16_t locMSId, uint16_t lengthXnId,
     873              :                             uint16_t channelId, uint16_t setRmtCKEId, uint16_t setRmtCKEMask, uint16_t setCKEId,
     874              :                             uint16_t setCKEMask, uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType,
     875              :                             uint16_t lengthEn);
     876              : 
     877              : void TransRmtMemToLocMemInstr(CcuInstr *instr, uint16_t locGSAId, uint16_t locXnId, uint16_t rmtGSAId, uint16_t rmtXnId,
     878              :                               uint16_t lengthXnId, uint16_t channelId, uint16_t reduceDataType,
     879              :                               uint16_t reduceOpCode, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId,
     880              :                               uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn, uint16_t reduceEn);
     881              : void TransLocMemToRmtMemInstr(CcuInstr *instr, uint16_t rmtGSAId, uint16_t rmtXnId, uint16_t locGSAId, uint16_t locXnId,
     882              :                               uint16_t lengthXnId, uint16_t channelId, uint16_t reduceDataType,
     883              :                               uint16_t reduceOpCode, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId,
     884              :                               uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn, uint16_t reduceEn);
     885              : void TransLocMemToLocMemInstr(CcuInstr *instr, uint16_t dstGSAId, uint16_t dstXnId, uint16_t srcGSAId, uint16_t srcXnId,
     886              :                               uint16_t lengthXnId, uint16_t channelId, uint16_t setCKEId, uint16_t setCKEMask,
     887              :                               uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t lengthEn);
     888              : 
     889              : void SyncCKEInstr(CcuInstr *instr, uint16_t rmtCKEId, uint16_t locCKEId, uint16_t locCKEMask, uint16_t channelId,
     890              :                   uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType);
     891              : void SyncGSAInstr(CcuInstr *instr, uint16_t rmtGSAId, uint16_t locGSAId, uint16_t channelId, uint16_t setRmtCKEId,
     892              :                   uint16_t setRmtCKEMask, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId,
     893              :                   uint16_t waitCKEMask, uint16_t clearType);
     894              : void SyncXnInstr(CcuInstr *instr, uint16_t rmtXnId, uint16_t locXnId, uint16_t channelId, uint16_t setRmtCKEId,
     895              :                  uint16_t setRmtCKEMask, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId,
     896              :                  uint16_t waitCKEMask, uint16_t clearType);
     897              : 
     898              : void AddInstr(CcuInstr *instr, uint16_t *msId, uint16_t count, uint16_t castEn, uint16_t dataType, uint16_t setCKEId,
     899              :               uint16_t setCKEMask, uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t XnIdLength);
     900              : void MaxInstr(CcuInstr *instr, uint16_t *msId, uint16_t count, uint16_t dataType, uint16_t setCKEId,
     901              :               uint16_t setCKEMask, uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t XnIdLength);
     902              : void MinInstr(CcuInstr *instr, uint16_t *msId, uint16_t count, uint16_t dataType, uint16_t setCKEId,
     903              :               uint16_t setCKEMask, uint16_t waitCKEId, uint16_t waitCKEMask, uint16_t clearType, uint16_t XnIdLength);
     904              : 
     905              : namespace CcuV2 {
     906              : void Nop(CcuInstr *instr);
     907              : 
     908              : void LoadSqeArgsToX(CcuInstr *instr, uint16_t xnId, uint16_t sqeArgsId, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     909              : void LoadImdToXn(CcuInstr *instr, uint16_t xnId, uint64_t immediate, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     910              : void ClearX(CcuInstr *instr, uint16_t xnId, uint16_t xmId, uint16_t xnIdMode = 0, uint16_t xmIdMode = 0,
     911              :             uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     912              : void LoadXFromMem(CcuInstr *instr, uint16_t dst, uint16_t src, uint16_t srcToken, uint16_t len,
     913              :                   const CacheConfig &cacheConfig, uint16_t setCKEId, uint16_t setCKEMask);
     914              : void StoreXToMem(CcuInstr *instr, uint16_t dst, uint16_t dstToken, uint16_t src, uint16_t len,
     915              :                  const CacheConfig &cacheConfig, uint16_t setCKEId, uint16_t setCKEMask);
     916              : void HSCBStoreXToMem(CcuInstr *instr, uint16_t dst, uint16_t src, uint16_t len,
     917              :                      const CacheConfig &cacheConfig, uint16_t setCKEId, uint16_t setCKEMask);
     918              : 
     919              : void Assign(CcuInstr *instr, uint16_t result, uint16_t operand, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     920              : void AssignI(CcuInstr *instr, uint16_t result, uint64_t operand, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     921              : 
     922              : void Add(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     923              : void AddI(CcuInstr *instr, uint16_t result, uint16_t operand, uint16_t imm, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     924              : void Sub(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     925              : void SubI(CcuInstr *instr, uint16_t result, uint16_t operand, uint16_t imm, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     926              : void Mul(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     927              : void MulI(CcuInstr *instr, uint16_t result, uint16_t operand, uint16_t imm, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     928              : 
     929              : void And(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     930              : void Or(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     931              : void Xor(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     932              : void Not(CcuInstr *instr, uint16_t result, uint16_t operand, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     933              : 
     934              : void SLL(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     935              : void SRL(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     936              : void SLA(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     937              : void SRA(CcuInstr *instr, uint16_t result, uint16_t operand1, uint16_t operand2, uint16_t setCKEId = 0, uint16_t setCKEMask = 0);
     938              : 
     939              : void Loop(CcuInstr *instr, uint16_t startInstrId, uint16_t endInstrId, uint16_t iterNum, uint16_t offset,
     940              :           uint16_t contextId);
     941              : void LoopGroup(CcuInstr *instr, uint16_t startLoopInstrId, uint16_t loopGroupConfig, uint16_t resOffset,
     942              :                uint16_t xnOffset);
     943              : void Jump(CcuInstr *instr, uint16_t relTarInstrXnId, uint16_t conditionXnId, uint16_t expectedXnId,
     944              :           uint16_t conditionType);
     945              : void Wait(CcuInstr *instr, uint16_t conditionXnId, uint16_t expectedXnId, uint16_t conditionType);
     946              : void Fence(CcuInstr *instr);
     947              : void SetCKE(CcuInstr *instr, uint16_t setCKEId, uint16_t setCKEMask, uint16_t waitCKEId, uint16_t waitCKEMask,
     948              :             uint16_t clearType);
     949              : void ClearCKE(CcuInstr *instr, uint16_t clearCKEId, uint16_t clearMask, uint16_t waitCKEId, uint16_t waitCKEMask,
     950              :               uint16_t clearType);
     951              : 
     952              : void TransLocMemToLocMS(CcuInstr *instr, uint16_t ms, uint16_t src, uint16_t srcToken, uint16_t len, uint16_t offset,
     953              :                         uint16_t setCKEId, uint16_t setCKEMask, const CacheConfig &cacheConfig);
     954              : void TransLocMSToLocMem(CcuInstr *instr, uint16_t dst, uint16_t dstToken, uint16_t ms, uint16_t len, uint16_t offset,
     955              :                         uint16_t setCKEId, uint16_t setCKEMask, const CacheConfig &cacheConfig);
     956              : void TransLocMemToLocMem(CcuInstr *instr, uint16_t dst, uint16_t dstToken, uint16_t src, uint16_t srcToken,
     957              :                          uint16_t len, uint16_t usedMSId, uint16_t usedMSNum, uint16_t setCKEId, uint16_t setCKEMask,
     958              :                          const CacheConfig &srcCacheConfig, const CacheConfig &dstcacheConfig);
     959              : void TransMem(CcuInstr *instr, uint16_t dst, uint16_t dstToken, uint16_t src, uint16_t srcToken, uint16_t len,
     960              :               uint16_t channel, const TransMemNotifyInfo &notify, const TransMemReduceInfo &reduce,
     961              :               const TransMemConfig &config, uint16_t setCKEId, uint16_t setCKEMask);
     962              : void SyncWtX(CcuInstr *instr, const TransMemNotifyInfo &notify, uint16_t channelId, uint16_t setCKEId,
     963              :              uint16_t setCKEMask);
     964              : void SyncWtX(CcuInstr *instr, uint16_t dst, uint16_t dstToken, uint16_t xn, uint16_t channelId,
     965              :              const TransMemNotifyInfo &notify, uint16_t setCKEId, uint16_t setCKEMask);
     966              : void SyncAtX(CcuInstr *instr, uint16_t dstAddr, uint16_t dstToken, uint16_t srcId, uint16_t channelId, uint16_t setCKEId,
     967              :              uint16_t setCKEMask);
     968              : void ReduceAdd(CcuInstr *instr, const uint16_t *ms, uint16_t count, uint16_t castEn, uint16_t dataType, uint16_t setCKEId,
     969              :                 uint16_t setCKEMask, uint16_t XnIdLength);
     970              : void ReduceMax(CcuInstr *instr, const uint16_t *ms, uint16_t count, uint16_t dataType, uint16_t setCKEId,
     971              :                 uint16_t setCKEMask, uint16_t XnIdLength);
     972              : void ReduceMin(CcuInstr *instr, const uint16_t *ms, uint16_t count, uint16_t dataType, uint16_t setCKEId,
     973              :                 uint16_t setCKEMask, uint16_t XnIdLength);
     974              : void RelJmp(CcuInstr *instr, uint16_t targetXnId, uint32_t jmpInstrId, uint16_t xn0, uint16_t xn1);
     975              : std::string                               ParseInstrV2(const CcuInstr *instr);
     976              : }; // namespace CcuV2
     977              : 
     978              : }; // namespace CcuRep
     979              : }; // namespace hcomm
     980              : 
     981              : #endif // CCU_MICROCODE_H
        

Generated by: LCOV version 2.0-1