LCOV - code coverage report
Current view: top level - base_comm/resources/ccu/ccu_representation/reps/sync - ccu_rep_rempostsem.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 14 14
Test Date: 2026-07-28 12:11:00 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 "exception_util.h"
      10              : #include "ccu_ins_generater_base.h"
      11              : #include "internal_exception.h"
      12              : 
      13              : namespace hcomm {
      14              : namespace CcuRep {
      15              : 
      16            2 : CcuRepRemPostSem::CcuRepRemPostSem(CcuInsGeneraterBase* insGenPtr, const ChannelHandle channel, uint16_t semIndex, uint16_t mask)
      17            2 :     : insGenPtr(insGenPtr), channel(channel), semIndex(semIndex), mask(mask)
      18              : {
      19            2 :     type       = CcuRepType::REM_POST_SEM;
      20            2 :     instrCount = insGenPtr->GetInstrCount(type);
      21            2 : }
      22              : 
      23            2 : bool CcuRepRemPostSem::Translate(CcuKernel* ccuKernel, CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
      24              : {
      25            2 :     this->instrId = instrId;
      26            2 :     translated    = true;
      27              : 
      28            2 :     insGenPtr->CcuRepRemPostSemTranslate(ccuKernel, instr, this, dep);
      29            2 :     CHK_PRT_THROW((instrId > UINT16_MAX - instrCount),
      30              :                         HCCL_ERROR("[CcuRepRemPostSem::Translate]uint16 integer overflow occurs, instrId = [%hu], instrCount = [%hu]", instrId, instrCount),
      31              :                           Hccl::InternalException, "integer overflow");
      32            2 :     instrId += instrCount;
      33              : 
      34            2 :     return translated;
      35              : }
      36              : 
      37            2 : std::string CcuRepRemPostSem::Describe()
      38              : {
      39            2 :     return Hccl::StringFormat("Post, Use semIndex[%u] and mask[%04x]", semIndex, mask);
      40              : }
      41              : 
      42              : }; // namespace CcuRep
      43              : }; // namespace hcomm
        

Generated by: LCOV version 2.0-1