| fix(rootinfo): 按 mainboard_id 选标卡 topo 文件,修复 350 被识别为 300a
Co-authored-by: suqwe<sujianjia@huawei.com>
# message auto-generated for no-merge-commit merge:
!386 merge fix/rootinfo-topo-file-mainboard-id into master
fix(rootinfo): 按 mainboard_id 选标卡 topo 文件,修复 350 被识别为 300a
Created-by: suqwe
Commit-by: suqwe
Merged-by: cann-robot
Description: ## 现象
tools/rootinfo/root_info_generate 在 Atlas 350 标卡(NOMESH/2PMESH/4PMESH)上生成 rootinfo 时,topo_file_path 一律是 atlas_300a.json,导致下游把 350 标卡识别成 300a。
## 根因
src/host/transport/topo/rootinfo/aclshmemi_product_strategy.cpp:70 在 aclshmemi_card_product_t::get_root_info 里写死了 atlas_300a.json,对所有标卡 mainboard_id 都生效。该 topo 文件名不在 hcomm 的映射表里。
## 修复
按 mainboard_id 选 topo 文件,与 hcomm src/legacy/ascend950/framework/topo/topo_addr_info/src/topo.c 的映射对齐:
| mainboard_id | topo 文件 |
|---|---|
| CARD_NOMESH (0x68) | atlas_350_1.json |
| CARD_2PMESH (0x6a) | atlas_350_2.json |
| CARD_4PMESH (0x6c) | atlas_350_3.json |
实现采用 [KEEP-NEW-SWITCH-CLEANUP] 模式:
- [NEW] 新增 card_topo_filename(mainboard_id) 工具函数
- [SWITCH] aclshmemi_card_product_t::get_root_info 改为 build_topo_file_path(driver_path, card_topo_filename(mainboard_id))
- [CLEANUP] 删除原 "atlas_300a.json" 字面量
## 验证
shmem_rootinfo target 在 -Werror 下编译通过。
Fix #282
See merge request: cann/shmem!386 | 1 天前 |