Line data Source code
1 : /*
2 : * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
3 : * Description: ccu representation implementation file
4 : * Author: sunzhepeng
5 : * Create: 2024-06-17
6 : */
7 :
8 : #include "ccu_rep_v1.h"
9 : #include "ccu_ins_generator_v1.h"
10 : #include "string_util.h"
11 : #include "ccu_ins_generator_base.h"
12 : #include "ccu_kernel.h"
13 :
14 : namespace hcomm {
15 : namespace CcuRep {
16 :
17 13 : CcuRepBufLocRead::CcuRepBufLocRead(CcuInsGeneratorBase* insGenPtr, LocalAddr src, CcuBuf dst, Variable len, CompletedEvent sem, uint16_t mask)
18 13 : : insGenPtr(insGenPtr), src(src), dst(dst), len(len), sem(sem), mask(mask)
19 : {
20 13 : type = CcuRepType::BUF_LOC_READ;
21 13 : instrCount = insGenPtr->GetInstrCount(type);
22 13 : }
23 :
24 11 : bool CcuRepBufLocRead::Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
25 : {
26 11 : this->instrId = instrId;
27 11 : translated = true;
28 :
29 11 : insGenPtr->CcuRepBufLocReadTranslate(ccuKernel, instr, this, dep);
30 11 : instrId += instrCount;
31 :
32 11 : return translated;
33 : }
34 :
35 11 : std::string CcuRepBufLocRead::Describe()
36 : {
37 : return Hccl::StringFormat("Read Loc Mem[%u] To CcuBuf[%u], len[%u], sem[%u], mask[%04x]",
38 11 : src.addr.Id(), dst.Id(), len.Id(), sem.Id(), mask);
39 : }
40 :
41 : }; // namespace CcuRep
42 : }; // namespace hcomm
|