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_READ_H
8 : #define HCOMM_CCU_REPRESENTATION_READ_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 CcuRepRead : public CcuRepBase {
17 :
18 : public:
19 : CcuRepRead(CcuInsGeneraterBase* insGenPtr, const ChannelHandle channel, LocalAddr loc, RemoteAddr rem, Variable len, CompletedEvent sem,
20 : uint16_t mask);
21 : CcuRepRead(CcuInsGeneraterBase* insGenPtr, const ChannelHandle channel, LocalAddr loc, RemoteAddr rem, Variable len, uint16_t dataType,
22 : uint16_t opType, CompletedEvent sem, uint16_t mask);
23 : bool Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep) override;
24 : std::string Describe() override;
25 0 : uint16_t GetLocAddrId() { return loc.addr.Id(); }
26 0 : uint16_t GetLocTokenId() { return loc.token.Id(); }
27 0 : uint16_t GetRemAddrId() { return rem.addr.Id(); }
28 0 : uint16_t GetRemTokenId() { return rem.token.Id(); }
29 0 : uint16_t GetLenId() { return len.Id(); }
30 1 : uint16_t GetSemId() { return sem.Id(); }
31 0 : uint32_t GetChannelId() { return channelId; }
32 :
33 3 : ChannelHandle GetChannel() { return channel; }
34 6 : LocalAddr GetLoc() { return loc; }
35 6 : RemoteAddr GetRem() { return rem; }
36 3 : Variable GetLen() { return len; }
37 3 : CompletedEvent GetSem() { return sem; }
38 5 : uint16_t GetMask() { return mask; }
39 3 : uint16_t GetDataType() { return dataType; }
40 3 : uint16_t GetOpType() { return opType; }
41 3 : uint16_t GetReduceFlag() { return reduceFlag; }
42 :
43 : private:
44 : CcuInsGeneraterBase* insGenPtr{nullptr};
45 : ChannelHandle channel;
46 : uint32_t channelId{0};
47 :
48 : LocalAddr loc;
49 : RemoteAddr rem;
50 : Variable len;
51 :
52 : CompletedEvent sem;
53 : uint16_t mask{0};
54 :
55 : uint16_t dataType{0};
56 : uint16_t opType{0};
57 : uint16_t reduceFlag{0};
58 :
59 : };
60 :
61 : }; // namespace CcuRep
62 : }; // namespace hcomm
63 : #endif // HCOMM_CCU_REPRESENTATION_READ_H
|