LCOV - code coverage report
Current view: top level - legacy/ascend950/unified_platform/ccu/ccu_representation/reps/data - ccu_rep_buflocread.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 14 14
Test Date: 2026-08-04 10:52:23 Functions: 100.0 % 3 3

            Line data    Source code
       1              : /**
       2              :  * Copyright (c) 2025 Huawei Technologies Co., Ltd.
       3              :  * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
       4              :  * CANN Open Software License Agreement Version 2.0 (the "License").
       5              :  * Please refer to the License for details. You may not use this file except in compliance with the License.
       6              :  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
       7              :  * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
       8              :  * See LICENSE in the root of the software repository for the full text of the License.
       9              :  */
      10              : 
      11              : #include "ccu_rep.h"
      12              : 
      13              : #include "string_util.h"
      14              : 
      15              : namespace Hccl {
      16              : namespace CcuRep {
      17              : 
      18           36 : CcuRepBufLocRead::CcuRepBufLocRead(Memory src, CcuBuffer dst, Variable len, MaskSignal sem, uint16_t mask)
      19           36 :     : src(src), dst(dst), len(len), sem(sem), mask(mask)
      20              : {
      21           36 :     type       = CcuRepType::BUF_LOC_READ;
      22           36 :     instrCount = 1;
      23           36 : }
      24              : 
      25            7 : bool CcuRepBufLocRead::Translate(CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
      26              : {
      27            7 :     this->instrId = instrId;
      28            7 :     translated    = true;
      29              : 
      30            7 :         TransLocMemToLocMSInstr(instr++, dst.Id(), src.addr.Id(), src.token.Id(), len.Id(), dep.reserveChannalId[0],
      31            7 :                                 sem.Id(), mask, 0, 0, 1, 1);
      32              :     
      33            7 :     instrId += instrCount;
      34              : 
      35            7 :     return translated;
      36              : }
      37              : 
      38            9 : std::string CcuRepBufLocRead::Describe()
      39              : {
      40              :     return StringFormat("Read Loc Mem[%u] To CcuBuffer[%u], len[%u], sem[%u], mask[%04x]",
      41            9 :     src.addr.Id(), dst.Id(), len.Id(), sem.Id(), mask);
      42              : }
      43              : 
      44              : }; // namespace CcuRep
      45              : }; // namespace Hccl
        

Generated by: LCOV version 2.0-1