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(CcuInsGeneratorBase* insGenPtr, const ChannelHandle channel, LocalAddr loc, RemoteAddr rem, Variable len, CompletedEvent sem,
20 : uint16_t mask);
21 : CcuRepRead(CcuInsGeneratorBase* 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 1 : uint16_t GetLocAddrId() { return loc.addr.Id(); }
26 1 : uint16_t GetLocTokenId() { return loc.token.Id(); }
27 1 : uint16_t GetRemAddrId() { return rem.addr.Id(); }
28 1 : uint16_t GetRemTokenId() { return rem.token.Id(); }
29 1 : uint16_t GetLenId() { return len.Id(); }
30 2 : uint16_t GetSemId() { return sem.Id(); }
31 : uint32_t GetChannelId() { return channelId; }
32 :
33 6 : ChannelHandle GetChannel() { return channel; }
34 8 : LocalAddr GetLoc() { return loc; }
35 8 : RemoteAddr GetRem() { return rem; }
36 4 : Variable GetLen() { return len; }
37 4 : CompletedEvent GetSem() { return sem; }
38 7 : uint16_t GetMask() { return mask; }
39 3 : uint16_t GetDataType() { return dataType; }
40 3 : uint16_t GetOpType() { return opType; }
41 4 : uint16_t GetReduceFlag() { return reduceFlag; }
42 :
43 : private:
44 : CcuInsGeneratorBase* 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
|