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 9 : CcuRepBufLocWrite::CcuRepBufLocWrite(CcuInsGeneratorBase* insGenPtr, CcuBuf src, LocalAddr dst, Variable len, CompletedEvent sem, uint32_t mask)
18 9 : : insGenPtr(insGenPtr), src(src), dst(dst), len(len), sem(sem), mask(mask)
19 : {
20 9 : type = CcuRepType::BUF_LOC_WRITE;
21 9 : instrCount = insGenPtr->GetInstrCount(type);
22 9 : }
23 :
24 7 : bool CcuRepBufLocWrite::Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
25 : {
26 7 : this->instrId = instrId;
27 7 : translated = true;
28 :
29 7 : insGenPtr->CcuRepBufLocWriteTranslate(ccuKernel, instr, this, dep);
30 7 : instrId += instrCount;
31 :
32 7 : return translated;
33 : }
34 :
35 7 : std::string CcuRepBufLocWrite::Describe()
36 : {
37 21 : return Hccl::StringFormat("Write CcuBuf[%u] To Loc Mem[%u], len[%u], sem[%u], mask[%04x]", src.Id(), dst.addr.Id(),
38 7 : len.Id(), sem.Id(), mask);
39 : }
40 :
41 : }; // namespace CcuRep
42 : }; // namespace hcomm
|