LCOV - code coverage report
Current view: top level - legacy/ascend950/unified_platform/ccu/ccu_representation/reps/data - ccu_rep_bufwrite.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 16 16
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          211 : CcuRepBufWrite::CcuRepBufWrite(const CcuTransport &transport, CcuBuffer src, Memory dst, Variable len, MaskSignal sem,
      19          211 :                                uint16_t mask)
      20          211 :     : transport(transport), src(src), dst(dst), len(len), sem(sem), mask(mask)
      21              : {
      22          211 :     type       = CcuRepType::BUF_WRITE;
      23          211 :     instrCount = 1;
      24          211 : }
      25              : 
      26           28 : bool CcuRepBufWrite::Translate(CcuInstr *&instr, uint16_t &instrId, const TransDep &dep)
      27              : {
      28           28 :     this->instrId = instrId;
      29           28 :     translated    = true;
      30              : 
      31           28 :     TransLocMSToRmtMemInstr(instr++, dst.addr.Id(), dst.token.Id(), src.Id(), len.Id(), transport.GetChannelId(),
      32           28 :                             sem.Id(), mask, 0, 0, 1, 1);
      33              : 
      34           28 :     instrId += instrCount;
      35              : 
      36           28 :     return translated;
      37              : }
      38              : 
      39           42 : std::string CcuRepBufWrite::Describe()
      40              : {
      41           84 :     return StringFormat("Write CcuBuffer[%u] To Rmt Mem[%u], len[%u], ChannalId[%u], sem[%u], mask[%04x]", src.Id(),
      42           42 :                         dst.addr.Id(), len.Id(), transport.GetChannelId(), sem.Id(), mask);
      43              : }
      44              : 
      45              : }; // namespace CcuRep
      46              : }; // namespace Hccl
        

Generated by: LCOV version 2.0-1