LCOV - code coverage report
Current view: top level - base_comm/resources/ccu/ccu_representation/reps/sync - ccu_rep_rempostvar.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 16 16
Test Date: 2026-08-04 10:52:23 Functions: 100.0 % 3 3

            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 "string_util.h"
      10              : #include "exception_util.h"
      11              : #include "ccu_api_exception.h"
      12              : #include "hcomm_c_adpt.h"
      13              : #include "ccu_ins_generator_v1.h"
      14              : #include "../../../../endpoint_pairs/channels/ccu/ccu_urma_channel.h"
      15              : #include "ccu_kernel.h"
      16              : 
      17              : namespace hcomm {
      18              : namespace CcuRep {
      19              : 
      20           12 : CcuRepRemPostVar::CcuRepRemPostVar(CcuInsGeneratorBase* insGenPtr, Variable param, const ChannelHandle channel, uint16_t paramIndex,
      21           12 :                                    uint16_t semIndex, uint16_t mask)
      22           12 :     : insGenPtr(insGenPtr), param(param), channel(channel), paramIndex(paramIndex), semIndex(semIndex), mask(mask)
      23              : {
      24           12 :     type       = CcuRepType::REM_POST_VAR;
      25           12 :     instrCount = insGenPtr->GetInstrCount(type);
      26           12 : }
      27              : 
      28            8 : bool CcuRepRemPostVar::Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
      29              : {
      30            8 :     this->instrId = instrId;
      31            8 :     translated    = true;
      32              : 
      33            8 :     insGenPtr->CcuRepRemPostVarTranslate(ccuKernel, instr, this);
      34            8 :     CHK_PRT_THROW((instrId > UINT16_MAX - instrCount),
      35              :                         HCCL_ERROR("[CcuRepRemPostVar::Translate]uint16 integer overflow occurs, instrId = [%hu], instrCount = [%hu]", instrId, instrCount),
      36              :                           Hccl::InternalException, "integer overflow");
      37            8 :     instrId += instrCount;
      38              : 
      39            8 :     return translated;
      40              : }
      41              : 
      42            8 : std::string CcuRepRemPostVar::Describe()
      43              : {
      44           16 :     return Hccl::StringFormat("Post Variable[%u] To ParamIndex[%u], Use semIndex[%u] and mask[%04x]", param.Id(), paramIndex,
      45            8 :                         semIndex, mask);
      46              : }
      47              : 
      48              : }; // namespace CcuRep
      49              : }; // namespace hcomm
        

Generated by: LCOV version 2.0-1