LCOV - code coverage report
Current view: top level - base_comm/resources/ccu/ccu_device/ccu_comp/ccu_channel/ccu_pfe - ccu_pfe_mgr.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 3 3
Test Date: 2026-07-28 12:11:00 Functions: 100.0 % 2 2

            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              : #ifndef CCU_PFE_MGR_H
      12              : #define CCU_PFE_MGR_H
      13              : 
      14              : #include <vector>
      15              : #include <unordered_map>
      16              : 
      17              : #include "ccu_dev_mgr_imp.h"
      18              : #include "ccu_pfe_cfg_mgr.h"
      19              : 
      20              : namespace hcomm {
      21              : 
      22              : struct PfeJettyStrategy {
      23              :     uint32_t feId;              // FE index.
      24              :     uint32_t pfeId;             // PFE ctx index.
      25              :     uint32_t startTaJettyId;    // PFE assigned to CCU starting jetty index.
      26              :     uint8_t  size;              // PFE assigned to CCU jetty num.
      27              :     uint32_t startLocalJettyCtxId; // PFE assigned to CCU starting local jetty index.
      28              : };
      29              : 
      30              : #pragma pack(push, 1)
      31              : struct PfeCtx {
      32              :     uint16_t startJettyId; // PFE assigned to CCU starting jetty index.
      33              :     /********2 Bytes**********/
      34              : 
      35              :     uint16_t jettyNum : 7;             // PFE assigned to CCU total jetty num.
      36              :     uint16_t startLocalJettyCtxId : 7; // CCU maintained starting jetty context index.
      37              :     uint16_t rsvBit : 2;
      38              :     /********4 Bytes**********/
      39              : 
      40              :     uint16_t rsv[2];
      41              :     /********8 Bytes**********/
      42              : };
      43              : #pragma pack(pop)
      44              : 
      45              : class CcuPfeMgr {
      46              : public:
      47           87 :     CcuPfeMgr(const int32_t devLogicId, const uint8_t dieId, const uint32_t devPhyId)
      48           87 :         : devLogicId_(devLogicId), dieId_(dieId), devPhyId_(devPhyId) {};
      49              :     CcuPfeMgr() = default;
      50           87 :     ~CcuPfeMgr() = default;
      51              : 
      52              :     HcclResult Init();
      53              :     HcclResult GetPfeStrategy(uint32_t feId, PfeJettyStrategy &pfeJettyStrategy) const;
      54              : 
      55              : private:
      56              :     int32_t devLogicId_{0};
      57              :     uint8_t dieId_{0};
      58              :     uint32_t devPhyId_{0};
      59              : 
      60              :     std::unordered_map<uint32_t, struct PfeJettyStrategy> pfeJettyMap_;
      61              : };
      62              : 
      63              : }; // Hccl
      64              : 
      65              : #endif // CCU_PFE_MGR_H
        

Generated by: LCOV version 2.0-1