LCOV - code coverage report
Current view: top level - legacy/ascend950/unified_platform/ccu/ccu_representation/reps/sync - ccu_rep_rempostvar.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 17 17
Test Date: 2026-07-28 12:11:00 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          376 : CcuRepRemPostVar::CcuRepRemPostVar(Variable param, const CcuTransport &transport, uint16_t paramIndex,
      19          376 :                                    uint16_t semIndex, uint16_t mask)
      20          376 :     : param(param), transport(transport), paramIndex(paramIndex), semIndex(semIndex), mask(mask)
      21              : {
      22          376 :     type       = CcuRepType::REM_POST_VAR;
      23          376 :     instrCount = 1;
      24          376 : }
      25              : 
      26           81 : bool CcuRepRemPostVar::Translate(CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
      27              : {
      28           81 :     this->instrId = instrId;
      29           81 :     translated    = true;
      30              : 
      31           81 :     SyncXnInstr(instr++, transport.GetRmtXnByIndex(paramIndex), param.Id(), transport.GetChannelId(),
      32           81 :                 transport.GetRmtCntCkeByIndex(semIndex), mask, 0, 0, 0, 0, 1);
      33           81 :     CHK_PRT_THROW((instrId > UINT16_MAX - instrCount),
      34              :                         HCCL_ERROR("[CcuRepRemPostVar::Translate]uint16 integer overflow occurs, instrId = [%hu], instrCount = [%hu]", instrId, instrCount),
      35              :                           InternalException, "integer overflow");
      36           81 :     instrId += instrCount;
      37              : 
      38           81 :     return translated;
      39              : }
      40              : 
      41          123 : std::string CcuRepRemPostVar::Describe()
      42              : {
      43          246 :     return StringFormat("Post Variable[%u] To ParamIndex[%u], Use semIndex[%u] and mask[%04x]", param.Id(), paramIndex,
      44          123 :                         semIndex, mask);
      45              : }
      46              : 
      47              : }; // namespace CcuRep
      48              : }; // namespace Hccl
        

Generated by: LCOV version 2.0-1