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