Line data Source code
1 : /*
2 : * Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved.
3 : * Description: ccu representation base header file
4 : * Create: 2025-02-18
5 : */
6 :
7 : #ifndef HCOMM_CCU_REPRESENTATION_BUFREAD_H
8 : #define HCOMM_CCU_REPRESENTATION_BUFREAD_H
9 :
10 : #include "ccu_rep_base_v1.h"
11 : #include "ccu_datatype_v1.h"
12 :
13 : namespace hcomm {
14 : namespace CcuRep {
15 :
16 : class CcuRepBufRead : public CcuRepBase {
17 : public:
18 : CcuRepBufRead(CcuInsGeneraterBase* insGenPtr, const ChannelHandle channel, RemoteAddr src, CcuBuf dst, Variable len, CompletedEvent sem,
19 : uint32_t mask);
20 : bool Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep) override;
21 : std::string Describe() override;
22 :
23 0 : uint16_t GetSrcAddrId() { return src.addr.Id(); }
24 0 : uint16_t GetSrcTokenId() { return src.token.Id(); }
25 0 : uint16_t GetDstAddrId() { return dst.Id(); }
26 0 : uint16_t GetLenId() { return len.Id(); }
27 0 : uint16_t GetSemId() { return sem.Id(); }
28 0 : uint32_t GetChannelId() { return channelId; }
29 2 : RemoteAddr GetSrc() { return src; }
30 1 : CcuBuf GetDst() { return dst; }
31 1 : Variable GetLen() { return len; }
32 1 : CompletedEvent GetSem() { return sem; }
33 2 : uint32_t GetMask() { return mask; }
34 1 : ChannelHandle GetChannel() { return channel; }
35 :
36 : private:
37 : CcuInsGeneraterBase* insGenPtr{nullptr};
38 : ChannelHandle channel;
39 : uint32_t channelId{0};
40 :
41 : RemoteAddr src;
42 : CcuBuf dst;
43 : Variable len;
44 :
45 : CompletedEvent sem;
46 : uint32_t mask{0};
47 : };
48 :
49 : }; // namespace CcuRep
50 : }; // namespace hcomm
51 : #endif // HCOMM_CCU_REPRESENTATION_BUFREAD_H
|