docs: Add the tester user guide to the delivered package
Script_User_Guide.md sits in src/Script_ABC_Blanton/ so publish.sh ships it. Part 1 covers deploying Blanton_Script/ from USB to the DUT, config.ttl, and what Scripts A, B and C run; part 2 covers every tool in Blanton_Script/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0131orciRKrejchsuDk6UpXk
This commit is contained in:
@@ -0,0 +1,810 @@
|
||||
# Blanton Script User Guide
|
||||
|
||||
> 適用版本:Script A **V1.2.7**(2026-11)
|
||||
> 對象:上機跑 A → B → C 的測試員,以及要在 DUT 上手動下 `Blanton_Script/` 工具的人
|
||||
|
||||
本指南分兩部分:
|
||||
|
||||
1. [TTL Script A / B / C](#part-1--ttl-script-a--b--c):Host 端準備、把 `Blanton_Script/` 從 USB 放進 DUT、A → B → C 的跑法
|
||||
2. [Blanton_Script 工具說明](#part-2--blanton_script-工具說明):DUT 上每一支 `.sh` 的用法
|
||||
|
||||
---
|
||||
|
||||
## 目錄
|
||||
|
||||
- [Part 1 — TTL Script A / B / C](#part-1--ttl-script-a--b--c)
|
||||
- [1.1 交付包內容](#11-交付包內容)
|
||||
- [1.2 Host 端準備(Windows)](#12-host-端準備windows)
|
||||
- [1.3 把 Blanton_Script 從 USB 放到 DUT](#13-把-blanton_script-從-usb-放到-dut)
|
||||
- [1.4 config.ttl 設定](#14-configttl-設定)
|
||||
- [1.5 跑一輪測試:A → B → C](#15-跑一輪測試a--b--c)
|
||||
- [1.6 Script A 做了什麼](#16-script-a-做了什麼)
|
||||
- [1.7 Script B 做了什麼](#17-script-b-做了什麼)
|
||||
- [1.8 Script C 做了什麼](#18-script-c-做了什麼)
|
||||
- [1.9 Log 在哪裡](#19-log-在哪裡)
|
||||
- [1.10 常見問題](#110-常見問題)
|
||||
- [Part 2 — Blanton_Script 工具說明](#part-2--blanton_script-工具說明)
|
||||
- [2.0 通用規則](#20-通用規則)
|
||||
- [2.1 總覽表](#21-總覽表)
|
||||
- [2.2 平台存取底層(source 進來用)](#22-平台存取底層source-進來用)
|
||||
- [2.3 溫度 / 電壓 / 電流 / 功耗](#23-溫度--電壓--電流--功耗)
|
||||
- [2.4 電壓 Margin](#24-電壓-margin)
|
||||
- [2.5 交換晶片:流量 / BER / FDR / 負載](#25-交換晶片流量--ber--fdr--負載)
|
||||
- [2.6 SerDes DSC 擷取](#26-serdes-dsc-擷取)
|
||||
- [2.7 背景監控(start / stop 型)](#27-背景監控start--stop-型)
|
||||
- [2.8 其他](#28-其他)
|
||||
|
||||
---
|
||||
|
||||
# Part 1 — TTL Script A / B / C
|
||||
|
||||
## 1.1 交付包內容
|
||||
|
||||
```
|
||||
Script_ABC_Blanton_<Ver>/ ← Tera Term 的工作目錄(整包放在 Windows 上)
|
||||
├── 1_Blanton_Script_A.ttl ← 基線(開頭收殘留 → 取基線數據 → 第一輪流量 / BER)
|
||||
├── 2_Blanton_Script_B.ttl ← 壓力 soak(背景壓力 + while 1 每 60 秒取一次數據)
|
||||
├── 3_Blanton_Script_C.ttl ← 收工(停壓力 → 收尾數據 → 判定 → log 拷 USB)
|
||||
├── config.ttl ← 所有設定都在這裡
|
||||
├── utils/*.ttl ← A/B/C 共用的片段(PMON、dmesg、PCIe 錯誤…)
|
||||
├── logs/ ← Tera Term log 寫在這
|
||||
├── 4_*.ttl / 5_*.ttl / 6_*.ttl ← 其他獨立測試(熱 / 開機循環 / BER 循環),不接 A→B→C
|
||||
└── Blanton_Script/ ← ★ 要放到 DUT 的 ~/Blanton_Script/
|
||||
```
|
||||
|
||||
| 腳本 | 用途 | 跟 A→B→C 的關係 |
|
||||
|---|---|---|
|
||||
| `1_Blanton_Script_A.ttl` | 基線 | 第一支,**唯一會開 log** 的 |
|
||||
| `2_Blanton_Script_B.ttl` | 壓力 soak | A 之後,同一個 Tera Term 視窗 |
|
||||
| `3_Blanton_Script_C.ttl` | 收工 + 判定 | B 停掉之後,同一個視窗 |
|
||||
| `4_Blanton_Script_thermal_safety.ttl` | 熱 / 安規 | 獨立跑,**沒有收尾段** |
|
||||
| `5_Blanton_Script_Boot_Cycle.ttl` | 斷電開機循環 | 獨立跑,`while 1` 無止境 |
|
||||
| `5_1_Blanton_Script_Boot_Cycle_Fast.ttl` | 同上,拿掉流量只留 `ps` | 獨立跑 |
|
||||
| `6_Blanton_Script_BER_Cycle.ttl` | Diag ↔ SONiC 冷開機量 BER | 獨立跑 |
|
||||
|
||||
## 1.2 Host 端準備(Windows)
|
||||
|
||||
1. 把整個 `Script_ABC_Blanton_<Ver>/` 複製到 Windows(例如 `D:\Blanton\`)。
|
||||
2. **改密碼**:`1_Blanton_Script_A.ttl` 的登入段是
|
||||
```
|
||||
sendln "admin"
|
||||
wait "Password:"
|
||||
sendln "YourPaSsWoRd" ← 換成 DUT 實際的 admin 密碼
|
||||
```
|
||||
`YourPaSsWoRd` 是佔位字,不改 A 會卡在登入。(B / C 不登入,沿用 A 的 session。)
|
||||
3. 確認 `config.ttl` 的 prompt 跟 DUT hostname 一致(見 [1.4](#14-configttl-設定))。
|
||||
4. Tera Term 連 DUT 的 COM port:**115200-8-N-1**。
|
||||
5. (建議)Tera Term → Setup → Additional settings → Log,確認時戳格式;格式存在**這台電腦的 `TERATERM.INI`**,不在腳本裡。
|
||||
|
||||
## 1.3 把 Blanton_Script 從 USB 放到 DUT
|
||||
|
||||
TTL 會直接呼叫 `~/Blanton_Script/xxx.sh`(root 的家目錄 = `/root`),所以 **跑 Script A 之前**,DUT 上要先有 `/root/Blanton_Script/`。
|
||||
|
||||
### Step 1:Windows 端把資料夾放進 USB
|
||||
|
||||
把交付包裡的 `Blanton_Script/` 整個資料夾拷到 USB 隨身碟**根目錄**:
|
||||
|
||||
```
|
||||
USB:\
|
||||
└── Blanton_Script\
|
||||
├── blanton_ber.sh
|
||||
├── ...
|
||||
└── LTC2980_Margin_Script\
|
||||
```
|
||||
|
||||
> ⚠️ **不要在 Windows 上用記事本打開再存 `.sh` / `.conf`**。存檔可能變成 CRLF 換行,
|
||||
> 在 SONiC 上會直接掛(`$'\r': command not found`),`.conf` 被 source 時更會安靜地讀錯值。
|
||||
|
||||
### Step 2:DUT 端掛 USB
|
||||
|
||||
```bash
|
||||
# 登入並切 root
|
||||
admin / <密碼>
|
||||
sudo -i
|
||||
|
||||
# 找 USB 的 partition(通常是 /dev/sda1;看 TRAN 欄 = usb 的那顆)
|
||||
lsblk -o NAME,SIZE,TRAN,FSTYPE,MOUNTPOINT
|
||||
|
||||
# 掛載(已掛過可跳過)
|
||||
mkdir -p /mnt/usb
|
||||
mount /dev/sda1 /mnt/usb # ← 依 lsblk 結果改 sda1
|
||||
ls /mnt/usb # 應看到 Blanton_Script
|
||||
```
|
||||
|
||||
### Step 3:複製到家目錄
|
||||
|
||||
```bash
|
||||
# 已經有舊版的話先備份(可略過)
|
||||
[ -d ~/Blanton_Script ] && mv ~/Blanton_Script ~/Blanton_Script.bak_$(date +%Y%m%d-%H%M%S)
|
||||
|
||||
cp -r /mnt/usb/Blanton_Script ~/
|
||||
```
|
||||
|
||||
### Step 4:加執行權限 + 檢查換行(**每次佈署都要做**)
|
||||
|
||||
```bash
|
||||
find ~/Blanton_Script -name '*.sh' -exec chmod +x {} +
|
||||
grep -rlU $'\r' ~/Blanton_Script # ← 應該「沒有任何輸出」
|
||||
```
|
||||
|
||||
- **為什麼一定要 `chmod +x`**:從 Windows → USB 拷過來的檔案沒有執行權限。
|
||||
`mgmt_ping_monitor.sh` / `bmc_monitor.sh` / `nfc_polling.sh` 的 `start` 內部是直接執行自己的路徑,
|
||||
沒有 exec bit 會 Permission denied,**而且不會報錯**,只會得到一份空的 log。
|
||||
`unused_lanes.sh` 也會檢查 `retimer_lanes.sh` 有沒有 exec bit。
|
||||
- **`grep` 有輸出 = 有檔案是 CRLF**,修法:
|
||||
```bash
|
||||
grep -rlU $'\r' ~/Blanton_Script | xargs sed -i 's/\r$//'
|
||||
```
|
||||
|
||||
### Step 5:確認 + 卸載
|
||||
|
||||
```bash
|
||||
ls ~/Blanton_Script
|
||||
bash ~/Blanton_Script/usb_target.sh -n -o both # 確認 USB 偵測得到(Script B/C 會用)
|
||||
sync
|
||||
umount /mnt/usb
|
||||
```
|
||||
|
||||
> **USB 不要拔**:Script B 會對它跑 USB 讀寫壓力,Script C 最後會把 log 拷進去。
|
||||
> 測試期間 DUT 上只能插**一支** USB 隨身碟(偵測到多支時 `usb_target.sh` 會拒絕猜測,exit 2)。
|
||||
|
||||
### 另一個方法:base64 貼上
|
||||
|
||||
沒有 USB 時,可以把 `Blanton_Script/` 打成 `tar.gz` 再轉 base64,在 Tera Term 分段貼上、
|
||||
DUT 端解碼解壓。每段後面附 md5,對不上就重貼該段。(貼上檔請向開發端索取。)
|
||||
|
||||
## 1.4 config.ttl 設定
|
||||
|
||||
| 變數 | 預設 | 說明 |
|
||||
|---|---|---|
|
||||
| `project_name` | `"Blanton"` | log 檔名前綴 |
|
||||
| `strTestcase` | `"ENV"` | log 檔名的測試類別(ENV / EMC / Margin…) |
|
||||
| `EN_Margin` | `0` | 1 = A / C 會跑 `margin_status`(9 顆 LTC2980 的電壓狀態) |
|
||||
| `EN_TX_FIR` | `0` | 1 = A / C 各跑一次 `bcm_dsc_scan.sh`(每次約 10 分鐘,整輪多 ~20 分鐘) |
|
||||
| `EN_log` | `1` | 1 = Script A 開 log |
|
||||
| `EN_timestamp` | `1` | 1 = log 每行帶時戳(**必要變數,不可刪**) |
|
||||
| `FAN_SPEED` | `100` | 風扇轉速 %,soak 是熱測試,預設全速 |
|
||||
| `SWB_UNIT0` / `SWB_UNIT1` | `1` / `1` | 這台 DUT 有沒有 switch unit 0 / 1。**FDR 只在兩個都是 1 時才跑** |
|
||||
| `SSD_RUNTIME` / `SSD_COUNT` | `3600` / `240` | SSD 壓力:`--runtime` 是**整個 job 的總時限(秒)**,`COUNT` = `--passes` |
|
||||
| `USB_RUNTIME` / `USB_COUNT` | `3600` / `240` | USB 壓力,同上 |
|
||||
| `BMC_USB_RUNTIME` | `172800` | BMC USB 網路 ping 的總秒數(2 天)**必要變數** |
|
||||
| `prompt_login` | `"sonic login:"` | 登入提示 |
|
||||
| `prompt_sonic` | `"admin@sonic:~$"` | admin prompt |
|
||||
| `prompt_sonic_root` | `"root@sonic:~#"` | root prompt,**每個 `wait` 都靠它** |
|
||||
|
||||
> ⚠️ **hostname 不是 `sonic` 的 DUT**(例如 `root@Margin02:~#`),要把三個 prompt 改成對應的字串,
|
||||
> 否則 macro 會卡在第一個 `wait`。
|
||||
>
|
||||
> ⚠️ **`config.ttl` 少一個變數,macro 會當場中止**(不是當成 0)。換新版 TTL 時,`config.ttl` 一起換,
|
||||
> 再把自己的設定值填回去。
|
||||
>
|
||||
> ⚠️ **SSD / USB 壓力的時間**:`--runtime` 跑滿就停,`--passes` 不會把它延長。
|
||||
> 2 天 soak 要把 `SSD_RUNTIME` / `USB_RUNTIME` 改成 `172800`。壓力提早結束時唯一線索是
|
||||
> Script B 每輪印的 `bgctl list` 數量變少,**不會報警**。
|
||||
|
||||
## 1.5 跑一輪測試:A → B → C
|
||||
|
||||
```
|
||||
Tera Term 連 COM port (115200-8-N-1),DUT 停在 "sonic login:" 或正在開機
|
||||
│
|
||||
├─ Control → Macro → 1_Blanton_Script_A.ttl
|
||||
│ 自動登入 → 基線 → 跳出 messagebox「Script A DONE / Start Script B」
|
||||
│
|
||||
├─ Control → Macro → 2_Blanton_Script_B.ttl
|
||||
│ 起背景壓力 → while 1 每 ~60 秒取一次數據(不會自己停)
|
||||
│ 泡到時間後:在 Tera Term 的 MACRO 小視窗按 End 停掉 macro,不要關 Tera Term 主視窗
|
||||
│
|
||||
└─ Control → Macro → 3_Blanton_Script_C.ttl
|
||||
停壓力 → 收尾數據 → 流量報表 / BER → log 拷 USB →「GOOD JOB! Test Case DONE」
|
||||
```
|
||||
|
||||
**鐵則:**
|
||||
|
||||
- **A → B → C 必須在同一個 Tera Term 視窗、同一個 shell session。** B 的背景 job 跟 C 的 `kill $(jobs -p)`
|
||||
綁在同一個 shell;log 也只有 A 會開,B / C 是續寫。中途關掉視窗就得手動收程序,log 也斷了。
|
||||
- B 停掉時,DUT 可能停在某個指令中間。**等 prompt 回來再跑 C**(必要時按一下 Enter)。
|
||||
- DUT 上要有 `~/hammer/tools/amd/mlucas-avx2`(CPU 壓力,由 DUT image 帶,不在交付包裡)。
|
||||
|
||||
## 1.6 Script A 做了什麼
|
||||
|
||||
依序:
|
||||
|
||||
| # | 段落 | 主要指令 |
|
||||
|---|---|---|
|
||||
| 1 | 開 log、登入、切 root | `logopen`、`sudo -i` |
|
||||
| 2 | 前置 | `mkdir ./logs`、`date -s`(用 Host 時間對時)、`rm /host/hw-eval/jobs/*` |
|
||||
| 3 | 收前一輪殘留 | `hw-test-session finish` → `bgctl reset --yes` → `bgctl stop --all` → `bgctl list` → `hw-test-session start` |
|
||||
| 4 | 風扇 | max31790 driver rebind → `fan-speed-control.sh <FAN_SPEED>` → 回答 `y` |
|
||||
| 5 | 等 DUT 初始化 | `utils/wait_init.ttl`:每 60 秒 `bcmcmd ps` 數 up port,每個開啟的 unit ≥ 216 才往下 |
|
||||
| 6 | DUT 資訊 | `show boot / version / system-memory / service / platform syseeprom / ssdhealth`、`fwutil show status`、TPM 版本、NVMe SMART |
|
||||
| 7 | BMC | `bmc-first-enroll`、`bmc-manager version / status` |
|
||||
| 8 | 載入工具 | `source` 6 支:`blanton_fpga_pcimem` / `cb_i2c` / `icb_vi2c` / `pwr_data` / `traffic_linespeed` / `margin.sh` |
|
||||
| 9 | PCIe AER 基線 | `utils/show_pcie_error_reg_*.ttl`(TH6×2 / FPGA / BMC / DDR / I210 / SSD)、`ras-mc-ctl --summary` |
|
||||
| 10 | PCIe tree | `lspci -tvvv`、`lspci -vv` |
|
||||
| 11 | Margin(`EN_Margin=1`) | `utils/show_margin_status.ttl` |
|
||||
| 12 | PMON 快照 | `utils/setup_pmon.ttl`(溫度 / 風扇 / 電壓 / 電流 / SWB 功耗 / DDR5 / HSC / SSD / leak / TPM)+ `utils/show_dmesg.ttl`(**最後會 `dmesg -C`**) |
|
||||
| 13 | Tray ID I2C stress | `tray_id_stress.sh` |
|
||||
| 14 | 管理網路 ping | `mgmt_ping_monitor.sh start` → `sleep 15` → `stop` → `cat log` → `clear` |
|
||||
| 15 | NFC | `nfc_polling.sh start` → `sleep 30` → `stop` → `report` |
|
||||
| 16 | 100G port | `sfputil lpmode off`、`config interface startup Ethernet513/514` |
|
||||
| 17 | 關沒接線的 lane | `unused_lanes.sh off`(**之後沒有任何地方 `on` 回來**) |
|
||||
| 18 | BER 基線 | `blanton_ber.sh init → start → sleep 30 → report → stop → clear` |
|
||||
| 19 | 第一輪流量 + FDR | `blanton_traffic_linespeed ps → init` → `fdr start` → `clear` → `fdr clear` → `show` → `start` → `sleep 40` → `fdr rdcnt` → `stop` → `fdr stop` → `report` |
|
||||
| 20 | DSC(`EN_TX_FIR=1`) | `bcm_dsc_scan.sh -f blanton_dsc_ScriptA.log -F` |
|
||||
| 21 | 結束 | `show uptime` → messagebox |
|
||||
|
||||
> 單一 unit 的 DUT(`SWB_UNIT0` / `SWB_UNIT1` 只有一個是 1)會走 `-u 0` / `-u 1` 分支,**沒有 FDR**,流量只跑 15 秒。
|
||||
|
||||
## 1.7 Script B 做了什麼
|
||||
|
||||
**起壓力(一次)**
|
||||
|
||||
| 壓力 | 指令 |
|
||||
|---|---|
|
||||
| AMD CPU | `systemd-run --unit=mlucas-amm ... mlucas-avx2`(`Restart=always`,掉了會自己重起) |
|
||||
| BMC DDR | `bgctl run bmc-manager run '/usr/bin/memtester 64M'` |
|
||||
| BMC I2C 監控 | `bmc_monitor.sh start` |
|
||||
| Host DDR | `bgctl run /usr/sbin/memtester 1G` |
|
||||
| SSD | `bgctl run qfx5252-stress-ssd 1G --runtime <SSD_RUNTIME> --passes <SSD_COUNT> ...` |
|
||||
| USB | `bgctl run qfx5252-stress-usb <usb_dev> 256M --runtime <USB_RUNTIME> --passes <USB_COUNT> ...` |
|
||||
| BMC USB 網路 | `systemd-run --unit=qfx5252-bmc-usb-net-test ... ping -I <cdc_ncm 網卡> 192.168.200.200` |
|
||||
| 管理網路 | `mgmt_ping_monitor.sh start` |
|
||||
| NFC | `nfc_polling.sh start` |
|
||||
| SWB 流量 | `blanton_traffic_linespeed init / clear / start` + `blanton_fdr.sh start / clear` |
|
||||
|
||||
> 找不到 cdc_ncm 網卡時會跳 messagebox「cdc_ncm interface not found. Ping test skipped.」,按 OK 後繼續跑,只是少了 BMC USB 網路測試。
|
||||
|
||||
**Soak 迴圈(`while 1`,每輪)**
|
||||
|
||||
`setup_pmon.ttl` 快照 → `bgctl list` → `jobs` → `systemctl is-active mlucas-amm` → `tray_id_stress.sh` → `blanton_fdr.sh rdcnt` → `sleep 60`
|
||||
|
||||
> 每輪間隔 = 指令執行時間 + 60 秒,不是固定 1 分鐘。
|
||||
> 看 `bgctl list` 的 job 數有沒有變少,是判斷壓力有沒有提早結束的唯一方法。
|
||||
|
||||
## 1.8 Script C 做了什麼
|
||||
|
||||
| # | 段落 | 主要指令 |
|
||||
|---|---|---|
|
||||
| 1 | 停壓力 | `kill $(jobs -p)`、`systemctl stop mlucas-amm`、`bgctl stop --all`×2、`systemctl stop qfx5252-bmc-usb-net-test`、`mgmt_ping_monitor.sh stop`、`nfc_polling.sh stop` |
|
||||
| 2 | 收尾快照 | `setup_pmon.ttl`、`show_dmesg.ttl` |
|
||||
| 3 | PCIe AER / EDAC | 同 Script A 的 7 組 + `ras-mc-ctl --summary` → **跟 A 相減才是本輪錯誤** |
|
||||
| 4 | BMC | `bmc_monitor.sh stop`;`journalctl -u qfx5252-bmc-usb-net-test > ~/Blanton_Script/log/bmc_usb_net.log` |
|
||||
| 5 | 壓力結果 | `cat` SSD / USB stress log、`mgmt_ping.log`、`nfc_polling.sh report` |
|
||||
| 6 | 流量判定 | `blanton_fdr.sh rdcnt` → `blanton_traffic_linespeed stop` → `fdr stop` → `report` |
|
||||
| 7 | BER 收尾 | `blanton_ber.sh init → start → sleep 30 → report → stop → clear` |
|
||||
| 8 | DSC(`EN_TX_FIR=1`) | `bcm_dsc_scan.sh -f blanton_dsc_ScriptC.log -F` |
|
||||
| 9 | NVMe / 開機原因 | `nvme smart-log`、`smartctl -x`、`show reboot-cause` |
|
||||
| 10 | Margin(`EN_Margin=1`) | `show_margin_status.ttl` |
|
||||
| 11 | Log 拷 USB | 掛 USB 到 `/mnt/usb` → 把 mlucas / bmc_usb_net / bmc_poll / mgmt_ping / nfc_poll log 拷進 `/host/hw-eval/jobs/` → `cp -r /host/hw-eval/jobs/ /mnt/usb/jobs-<YYYYMMDD>_<HHMM>` |
|
||||
| 12 | 收工 | `exit` → 等 `Script done` → `hw-test-session finish` → `bgctl reset --yes` → messagebox |
|
||||
|
||||
## 1.9 Log 在哪裡
|
||||
|
||||
| Log | 位置 | 誰寫的 |
|
||||
|---|---|---|
|
||||
| **主 log(A+B+C 全部 console)** | Windows:`<Tera Term 工作目錄>\Logs\Blanton_<strTestcase>_<YYYYMMDD-HHMMSS>.log` | Script A `logopen` |
|
||||
| 壓力 job log | DUT:`/host/hw-eval/jobs/` | `qfx5252-stress-*`、Script C 拷進來的 |
|
||||
| 工具 log | DUT:`~/Blanton_Script/log/`(`mgmt_ping.log` / `nfc_poll.log` / `bmc_poll.log` / `bmc_usb_net.log` / `blanton_dsc_*.log`) | 各 `.sh` |
|
||||
| **USB 備份** | USB:`/jobs-<YYYYMMDD>_<HHMM>/` | Script C 最後一步 |
|
||||
|
||||
> ⚠️ `bmc_usb_net.log` **不進主 log**,USB 上那份是唯一一份。
|
||||
> ⚠️ `show_dmesg.ttl` 會 `dmesg -C`,事後在 DUT 上 `dmesg` 撈不到舊訊息,只存在主 log 裡。
|
||||
|
||||
## 1.10 常見問題
|
||||
|
||||
| 症狀 | 原因 / 處理 |
|
||||
|---|---|
|
||||
| A 一開始就停在 `logopen` | `config.ttl` 是舊版,少了 `EN_timestamp` 之類的必要變數 → 換新版 `config.ttl` |
|
||||
| A 卡在登入 | 密碼還是 `YourPaSsWoRd`,或 prompt 跟 hostname 不符 |
|
||||
| A 卡在風扇那段 | 在等 `Set all configured fan channels to` 提示再回 `y`;提示字串改了就會永遠卡住 |
|
||||
| A 卡在 wait_init | 有 unit 的 up port 一直 < 216,或 `SWB_UNITx=1` 但 DUT 沒那張板子 |
|
||||
| `xxx.sh: Permission denied` | 沒做 [1.3 Step 4](#step-4加執行權限--檢查換行每次佈署都要做) 的 `chmod +x` |
|
||||
| `$'\r': command not found` | `.sh` 變成 CRLF → `sed -i 's/\r$//'` |
|
||||
| mgmt_ping / nfc / bmc log 是空的 | 沒 `chmod +x`(`start` 不會報錯) |
|
||||
| Script C 沒把 log 拷到 USB | USB 沒插、插了兩支、或檔案系統不能寫 → `bash ~/Blanton_Script/usb_target.sh -o both` 看錯誤碼 |
|
||||
| 跑完 C 之後 CPU 還是滿載 | `systemctl stop mlucas-amm` 沒跑到 → 手動下一次 |
|
||||
|
||||
---
|
||||
|
||||
# Part 2 — Blanton_Script 工具說明
|
||||
|
||||
## 2.0 通用規則
|
||||
|
||||
- 一律在 **root** 下跑:`sudo -i`,工具在 `~/Blanton_Script/`。
|
||||
- 兩種用法:
|
||||
- **直接執行**:`~/Blanton_Script/xxx.sh <子指令> [選項]`(需要 exec bit)
|
||||
- **source 後呼叫函式**:`source ~/Blanton_Script/xxx.sh` 再下 `xxx <子指令>`(A/B/C 對 `blanton_traffic_linespeed` 就是這樣用)
|
||||
- 大部分工具都支援:`-u 0|1`(只做一個 switch unit,預設兩個都做)、`-n`(dry-run,只印指令不碰硬體)、`-d`(印每一個底層指令)、`-h`(help)。
|
||||
- **`bcmcmd` 的 exit code 不能信**:BCM shell 拒絕指令時照樣回 0,看輸出內容判斷。
|
||||
- **互斥**:下面這幾支都會接管同一批 switch port,**一次只能跑一支**:
|
||||
`blanton_traffic_linespeed` / `blanton_ber` / `blanton_ber_debug` / `blanton_tr518` / `blanton_tr518_thermal` / `port_prbs_monitor` / `bcm_100g_dsc_cycle`
|
||||
- **會寫 NVM(永久)的指令**:`margin_save*`、`blanton_multiphase_margin.sh save` —— **測試流程中絕不執行**。
|
||||
|
||||
## 2.1 總覽表
|
||||
|
||||
| 工具 | 類別 | TTL 有沒有接 | 一句話 |
|
||||
|---|---|---|---|
|
||||
| `blanton_fpga_pcimem.sh` | 底層 | A(source) | CB / PMC / ICB FPGA 暫存器讀寫,自動偵測 BDF |
|
||||
| `blanton_cb_i2c.sh` | 底層 | A(source) | CB FPGA 的 I2C master(Ch0~Ch17) |
|
||||
| `blanton_icb_vi2c.sh` | 底層 | A(source) | 經 CB 的 VI2C 走到 ICB / PDB(Ch0~Ch4) |
|
||||
| `blanton_temp_sensor.sh` | 量測 | — | CB + ICB 溫感 |
|
||||
| `ddr5_temp.sh` | 量測 | PMON | DDR5 DIMM 溫度 |
|
||||
| `hsc_temp_readback.sh` | 量測 | PMON | LTC4287 HSC 溫度 |
|
||||
| `TH6_SWB0/1_power_readback.sh` | 量測 | PMON | SWB 19 條軌 V×I + 總功耗(平台 sensor) |
|
||||
| `blanton_multiphase_read.sh` | 量測 | — | 直接讀多相 VRM 的 V / I / T(含原始 hex) |
|
||||
| `blanton_pwr_data.sh` | 量測 | A(source) | SWB VRM + PDB 讀值(經 CB FPGA I2C) |
|
||||
| `pwr_brick.sh` | 量測 | — | PDB / CPB power brick |
|
||||
| `avt_pmpower.sh` | 量測 | Script 4 | AMD CPU 封裝功耗(需 NDA 工具) |
|
||||
| `LTC2980_Margin_Script/margin.sh` | Margin | A/C(`EN_Margin`) | 9 顆 LTC2980 電壓 margin |
|
||||
| `blanton_multiphase_margin.sh` | Margin | — | 多相 VRM 38 條軌 margin |
|
||||
| `blanton_traffic_linespeed.sh` | 交換晶片 | A/B/C | SWB loopback 線速流量 + 判定 |
|
||||
| `blanton_fdr.sh` | 交換晶片 | A/B/C | FDR 統計(`phydiag fdrstat`) |
|
||||
| `blanton_ber.sh` | 交換晶片 | A/C | 全機 SerDes BER(PRBS)+ 判定 |
|
||||
| `blanton_ber_debug.sh` | 交換晶片 | — | BER 原始輸出(`p=p31`) |
|
||||
| `blanton_tr518.sh` | 交換晶片 | Script 4 | `tr 518` 負載(量功耗用) |
|
||||
| `blanton_tr518_thermal.sh` | 交換晶片 | — | `tr 518` 熱測參數版(**未上機驗證**) |
|
||||
| `port_prbs_monitor.sh` | 交換晶片 | — | 100G Ethernet513/514 PRBS |
|
||||
| `unused_lanes.sh` / `retimer_lanes.sh` | 交換晶片 | A(`off`) | 沒接線的 retimer lane / TH6 port 關 TX |
|
||||
| `bcm_dsc_scan.sh` / `bcm_dsc_parse.sh` | DSC | A/C(`EN_TX_FIR`) | SerDes DSC 擷取 / 轉 CSV |
|
||||
| `bcm_100g_dsc_cycle.sh` | DSC | — | 100G link down/up 循環 + DSC(**未上機驗證**) |
|
||||
| `mgmt_ping_monitor.sh` | 背景監控 | A/B/C | 10G + 1G 管理網路 ping |
|
||||
| `nfc_polling.sh` | 背景監控 | A/B/C | NFC tag 輪詢 |
|
||||
| `bmc_monitor.sh` | 背景監控 | B/C | BMC `free -m` + I2C 寫讀圖樣 |
|
||||
| `bmc_monitor_ddr.sh` | 背景監控 | 已停用 | BMC memtester(改走 `bgctl`) |
|
||||
| `tray_id_stress.sh` | 其他 | A/B | Tray ID I2C 寫讀比對 |
|
||||
| `usb_target.sh` | 其他 | B/C | 找 USB 隨身碟、掛載 |
|
||||
| `blantons_nfc_validate.py` | 其他 | 由 nfc_polling 呼叫 | 客戶 NFC 驗證工具 v2.5 |
|
||||
|
||||
## 2.2 平台存取底層(source 進來用)
|
||||
|
||||
這三支是其他工具的基礎,平常不用直接下;debug 時 source 進來用。
|
||||
|
||||
```bash
|
||||
source ~/Blanton_Script/blanton_fpga_pcimem.sh # 會印 [INFO] CB FPGA BDF = ...
|
||||
source ~/Blanton_Script/blanton_cb_i2c.sh
|
||||
source ~/Blanton_Script/blanton_icb_vi2c.sh
|
||||
```
|
||||
|
||||
### blanton_fpga_pcimem.sh
|
||||
|
||||
| 指令 | 說明 |
|
||||
|---|---|
|
||||
| `cb_fpga <offset> [value]` | 讀 / 寫 CB FPGA 暫存器(32-bit) |
|
||||
| `pmc_fpga` / `icb_fpga` | 同上,其他 FPGA |
|
||||
| `fpga_rescan` | 重新偵測 BDF(換 DUT / 重新列舉後) |
|
||||
| `FPGA_BDF=0000:05:00 fpga_rescan` | 手動指定 BDF(偵測到多顆或選錯時) |
|
||||
| `echo $FPGA_BDF_ACTIVE` | 目前用的 BDF |
|
||||
| `blanton_fpga_help` | help |
|
||||
|
||||
```bash
|
||||
cb_fpga 0 0xD90 # 讀 RST_CAUSE_REG,讀得到 = BAR 通了
|
||||
```
|
||||
|
||||
### blanton_cb_i2c.sh
|
||||
|
||||
| 指令 | 說明 |
|
||||
|---|---|
|
||||
| `cb_i2c_init <ch>` | 初始化通道 |
|
||||
| `cb_i2c_scan <ch>` | 掃描通道上的裝置 |
|
||||
| `cb_i2c_read` / `cb_i2c_write` | 讀寫 |
|
||||
| `cb_pmbus_read` / `cb_pmbus_write` | PMBus 讀寫 |
|
||||
| `cb_i2c_muxsel` / `cb_i2c_reset` | 切 mux / 重置 |
|
||||
| `blanton_cb_i2c_help` | help |
|
||||
|
||||
```bash
|
||||
cb_i2c_init 11 && cb_i2c_scan 11 # Ch11 風扇控制器,應看到 0x20
|
||||
```
|
||||
|
||||
### blanton_icb_vi2c.sh
|
||||
|
||||
ICB / PDB **一律走這支(VI2C)**,不要走 VSPI(太慢會踩 SMBus timeout)。
|
||||
|
||||
| 指令 | 說明 |
|
||||
|---|---|
|
||||
| `vi2c_scan_all` | 掃 ICB / PDB 五個通道 |
|
||||
| `vi2c_scan <ch>` / `vi2c_init <ch>` | 單一通道 |
|
||||
| `vi2c_read` / `vi2c_write` / `vi2c_pmbus_read` / `vi2c_dump` | 讀寫 |
|
||||
| `vi2c_help` | help |
|
||||
|
||||
> `vi2c_scan` 只看 ACK,**仲裁失敗(ARB_LOST)會被誤報成有裝置**。
|
||||
|
||||
## 2.3 溫度 / 電壓 / 電流 / 功耗
|
||||
|
||||
### blanton_temp_sensor.sh — CB + ICB 溫感
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/blanton_temp_sensor.sh # CB + ICB 一次
|
||||
~/Blanton_Script/blanton_temp_sensor.sh -r # 多印 TMP432 remote1/remote2
|
||||
~/Blanton_Script/blanton_temp_sensor.sh -c # 只 CB(-i 只 ICB)
|
||||
~/Blanton_Script/blanton_temp_sensor.sh -n 10 -t 5 # 10 次、每次間隔 5 秒(-n 0 = 無限)
|
||||
```
|
||||
|
||||
### ddr5_temp.sh — DDR5 DIMM 溫度
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/ddr5_temp.sh # 預設 bus 5,位址 0x50 0x51
|
||||
~/Blanton_Script/ddr5_temp.sh 5 0x50 # 指定 bus / 位址
|
||||
```
|
||||
|
||||
### hsc_temp_readback.sh — HSC 溫度
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/hsc_temp_readback.sh # LTC4287 HSC_MAIN(0x40) / HSC_STBY(0x45),bus 28,約 4 秒
|
||||
```
|
||||
|
||||
### TH6_SWB0_power_readback.sh / TH6_SWB1_power_readback.sh — SWB 軌功耗
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/TH6_SWB0_power_readback.sh
|
||||
~/Blanton_Script/TH6_SWB1_power_readback.sh
|
||||
```
|
||||
|
||||
- 讀 `show platform voltage` / `show platform current` 各一次,算 19 條軌的 V×I,最後印 `TOTAL POWER`。
|
||||
- 某條軌在 sensor 表裡找不到時,stderr 印 `WARN` 並當 0 W 計。
|
||||
- 要量**有負載**的功耗:先 `blanton_tr518.sh start`。
|
||||
|
||||
### blanton_multiphase_read.sh — 多相 VRM 讀值(含原始 hex)
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/blanton_multiphase_read.sh # 兩片 SWB
|
||||
~/Blanton_Script/blanton_multiphase_read.sh -u 0 # 只 SWB0
|
||||
~/Blanton_Script/blanton_multiphase_read.sh -n # 只印 i2c 指令
|
||||
~/Blanton_Script/blanton_multiphase_read.sh -d # 印每個 i2c 指令與讀到的值
|
||||
```
|
||||
|
||||
- 直接 `i2cget` 讀 VRM(SWB0 = i2c-13/15,SWB1 = i2c-14/16),每顆一列:`VOUT / VOUT2 / IOUT / IOUT2 / POUT / POUT2 / TEMP`,
|
||||
電壓電流後面括號是讀到的 PMBus 原始 word,例如 `0.740(0x0128)`;最後印每片 SWB 的 Total Power。
|
||||
- POUT = V × I。讀完會把 PAGE 讀回確認沒被別人切走,被切走就重讀,一直不穩印 `NA`。
|
||||
- **不要跟 `blanton_multiphase_margin.sh` 同時跑**(兩支都會切 PAGE)。
|
||||
- ⚠️ 0x21 / 0x22 的 PU 名稱(PU105 / PU102)與 `blanton_multiphase_margin.sh` 的 PHYTILE 對應相反,待上機確認;總功耗不受影響。
|
||||
|
||||
### blanton_pwr_data.sh — SWB VRM / PDB(經 CB FPGA I2C)
|
||||
|
||||
```bash
|
||||
source ~/Blanton_Script/blanton_pwr_data.sh
|
||||
pwr_data # SWB0(預設)
|
||||
pwr_data swb1 # SWB1
|
||||
pwr_data pdb # PDB power brick + EFUSE(ICB VI2C ch4,mux 0x72 ch0)
|
||||
pwr_data all # 三個都印
|
||||
pwr_pdb_id # 讀 PDB 上每顆裝置的 MFR_ID / MFR_MODEL
|
||||
pwr_data_help
|
||||
```
|
||||
|
||||
> 讀不到或數值不合理時印 `NA`——寧可 NA 也不印看起來像數據的錯值。
|
||||
|
||||
### pwr_brick.sh — PDB / CPB power brick
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/pwr_brick.sh show # Vin / Iin / Vout / Iout / Temp × 5 顆
|
||||
~/Blanton_Script/pwr_brick.sh show -r # 多印 raw word
|
||||
PB_TRIES=1 ~/Blanton_Script/pwr_brick.sh show -r # 看不經重試的原始行為
|
||||
```
|
||||
|
||||
### avt_pmpower.sh — AMD CPU 封裝功耗
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/avt_pmpower.sh -p ~/AVT_Linux_NDA_2.8.37/AVTCMD # 印 PM table + 摘要
|
||||
~/Blanton_Script/avt_pmpower.sh -q -p ~/AVT_Linux_NDA_2.8.37/AVTCMD # 只印摘要
|
||||
```
|
||||
|
||||
- **AVT 是 NDA 工具,不在交付包裡**:要先解壓到 `~/AVT_Linux_NDA_2.8.37/`,沒有就 exit 2。
|
||||
- 數值是 SMU telemetry 不是量測,要準就對照 VR 的 PMBus READ_POUT。
|
||||
- exit:0 OK / 1 參數錯 / 2 找不到 AVTCMD / 3 AVTCMD 失敗 / 4 解析不到功耗欄位。
|
||||
|
||||
## 2.4 電壓 Margin
|
||||
|
||||
> ⚠️ **改電壓會弄壞 DUT**:套 profile 前確認該軌 OV / UV limit。
|
||||
> ⚠️ `margin.sh`(LTC2980)跟 `blanton_multiphase_margin.sh`(多相 VRM)**摸的是同一批軌**,兩支不要同時用。
|
||||
> ⚠️ 會寫 NVM 的指令(`margin_save*`、`... save`)**測試中絕不執行**,斷電也不會還原。
|
||||
|
||||
### LTC2980_Margin_Script/margin.sh — 9 顆 LTC2980
|
||||
|
||||
```bash
|
||||
source ~/Blanton_Script/LTC2980_Margin_Script/margin.sh
|
||||
margin_init Blanton_CB_CONN13 # 載入一顆(settings/ 底下的 .conf)
|
||||
margin_status # 看每個 channel 的電壓與偏差 %
|
||||
margin_set 0 high 8 # ch0 margin high 8%
|
||||
margin_set 5 low 5 # ch5 margin low 5%
|
||||
margin_set 3 nominal 8 # ch3 回標稱值
|
||||
margin_apply_profile profiles/combo_SWB_CONN13_high.conf # 批次套用
|
||||
margin_apply_profile profiles/all_off.conf # 全部回 nominal
|
||||
```
|
||||
|
||||
- 可載入的 9 顆:`Blanton_CB_CONN13`、`Blanton_SWB0_CONN13~16`、`Blanton_SWB1_CONN13~16`。
|
||||
- **SWB 的 profile 是 per-CONN 的**:`combo_SWB_CONN13_*` 只能套在 CONN13,套錯 CONN 會 margin 到錯的軌,**而且不會報錯**。CB 用通用的 `combo_high3` / `combo_low3`。
|
||||
- 一次看全部 9 顆:`source ~/Blanton_Script/LTC2980_Margin_Script/script/margin_status_all.sh`
|
||||
- `VNOM` 是 Blanton 實測中位數(2026-08-30 起),跨這個日期的 margin log 不能直接互比。
|
||||
|
||||
### blanton_multiphase_margin.sh — 多相 VRM(38 條軌)
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh high3 # 全部 +3%
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh low3 # 全部 -3%
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh comboA # 混合 A
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh comboB # 混合 B(comboA 的高低對調)
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh normal # 回標稱值
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh high3 -u 0 # 只 SWB0
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh high3 -n # 只印指令
|
||||
~/Blanton_Script/blanton_multiphase_margin.sh save # ⚠️ 永久寫 NVM
|
||||
```
|
||||
|
||||
- 每條軌印一行:`SWB0_0V9_ANLG0 - 0.930V Configure Done`。
|
||||
- 改完用 `blanton_multiphase_read.sh` 讀回確認。
|
||||
- `normal` 之後 TH6_CORE 讀回約 0.859 V 不是 0.8 V,那是 load line,不是寫失敗。
|
||||
|
||||
## 2.5 交換晶片:流量 / BER / FDR / 負載
|
||||
|
||||
### blanton_traffic_linespeed.sh — SWB loopback 線速流量
|
||||
|
||||
```bash
|
||||
source ~/Blanton_Script/blanton_traffic_linespeed.sh
|
||||
blanton_traffic_linespeed ps # 看有接線的 port link / speed
|
||||
blanton_traffic_linespeed init # 建 VLAN 30..137,cdN <-> cdN+32
|
||||
blanton_traffic_linespeed clear # 清計數器
|
||||
blanton_traffic_linespeed show # 看計數器
|
||||
blanton_traffic_linespeed start # 打流量
|
||||
blanton_traffic_linespeed stop # 移除 VLAN 成員(--destroy 連 VLAN 一起砍)
|
||||
blanton_traffic_linespeed report # 每一對 TX/RX 交叉比對 → PASS / FAIL / NA
|
||||
blanton_traffic_linespeed run # ps → init → clear → start → report 一條龍
|
||||
blanton_traffic_linespeed report -f <log> # 離線重解一份存下來的 console log
|
||||
```
|
||||
|
||||
- `ps` 實際下的是 `bcmcmd -n <u> -c 'ps <有接線的 port 清單>'`;`-p "<list>"` 換清單、`TL_PS_PORTS=all` 看全部。
|
||||
- `report` 的 exit:0 全 PASS、2 有 FAIL / NA。
|
||||
- 判定是**成對交叉比對**(cdA 的 TX = cdB 的 RX),不看絕對值。
|
||||
|
||||
### blanton_fdr.sh — FDR 統計
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/blanton_fdr.sh start # fdrstat STArt bin_group=both Interval=30
|
||||
~/Blanton_Script/blanton_fdr.sh clear # fdrstat clear
|
||||
~/Blanton_Script/blanton_fdr.sh rdcnt # fdrstat Counters(至少等 Interval 之後再讀)
|
||||
~/Blanton_Script/blanton_fdr.sh stop # fdrstat STOp(⚠️ 關鍵字未上機驗證)
|
||||
~/Blanton_Script/blanton_fdr.sh rdcnt -u 0 # 只 unit 0
|
||||
~/Blanton_Script/blanton_fdr.sh start -i 60 # Interval 改 60 秒
|
||||
```
|
||||
|
||||
- 原始輸出照印,不判定 PASS / FAIL。
|
||||
- 印目前參數:`grep -E '^FDR_[A-Z_]+=' ~/Blanton_Script/blanton_fdr.sh`
|
||||
- port 清單同 traffic 的有接線 port(不含 268),`FDR_PORTS="..."` 可改。
|
||||
|
||||
### blanton_ber.sh — 全機 SerDes BER(PRBS)
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/blanton_ber.sh init # prbs set p=3 + prbs get(檢查每條 lane 有沒有鎖上)
|
||||
~/Blanton_Script/blanton_ber.sh start # prbsstat STArt Interval=30
|
||||
sleep 40 # ⚠️ 必須「大於」Interval
|
||||
~/Blanton_Script/blanton_ber.sh report # 每條 lane 一列,BER < 1e-6 才 PASS,最後 summary
|
||||
~/Blanton_Script/blanton_ber.sh stop # prbsstat STOp
|
||||
~/Blanton_Script/blanton_ber.sh clear # prbs clear(解除 PRBS,lane 回正常運作)
|
||||
```
|
||||
|
||||
- 選項:`-u 0|1`、`-c 1e-9`(換門檻)、`-F`(只列失敗)、`-f <log>`(離線重解)、`--tsv`、`--raw`。
|
||||
- summary 每個 unit 三列:`200G ports` / `100G p268` / `TOTAL`。
|
||||
- **PRBS 跑的時候 `show interfaces status` 會顯示 DOWN,這是正常的。** `clear` 之後才回正常。
|
||||
- 某一組「一條 lane 都沒回報」算 FAIL。
|
||||
|
||||
### blanton_ber_debug.sh — BER 原始輸出
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/blanton_ber_debug.sh # unit 0+1:set p=p31 → get×2 → STArt 30 → sleep 40 → Ber → STOp → clear
|
||||
~/Blanton_Script/blanton_ber_debug.sh -u 0 # 單一 unit
|
||||
BER_PORTS="...,268" ~/Blanton_Script/blanton_ber_debug.sh # 加 port 268
|
||||
```
|
||||
|
||||
> 這支是 `p=p31`(已上機驗證),`blanton_ber.sh` 是 `p=3`,兩者量的碼型可能不同。
|
||||
|
||||
### blanton_tr518.sh — `tr 518` 負載(量功耗用)
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/blanton_tr518.sh start # 兩個 unit,跑完等 120 秒讓功耗穩定
|
||||
~/Blanton_Script/blanton_tr518.sh start -u 0 # 只 unit 0
|
||||
~/Blanton_Script/blanton_tr518.sh start --no-wait # 不等
|
||||
~/Blanton_Script/blanton_tr518.sh start -w 60 # 等 60 秒
|
||||
~/Blanton_Script/blanton_tr518.sh stop # port cd lb=none
|
||||
```
|
||||
|
||||
`start` 每個 unit 依序下:
|
||||
|
||||
```bash
|
||||
bcmcmd -n <u> -c 'port cd lb=mac'
|
||||
bcmcmd -n <u> -c 'l2 learn off'
|
||||
bcmcmd -n <u> -c 'dsh -c "test mode nr=yes"'
|
||||
bcmcmd -n <u> -c 'dsh -c "tr 518 Scenario=6 Profile=2 Count=260 PktSize=324 PortList=1-259,270-565 rm=ext CheckLinkTime=20 CheckDataTime=200 testphase=1"'
|
||||
```
|
||||
|
||||
- 輸出有 `TR 518 TEST PARAMETERS` 才算真的開始跑。
|
||||
- **`stop` 只解 loopback**,`l2 learn off` 與 `test mode nr=yes` 會留著。要一起還原:
|
||||
```bash
|
||||
TR_RESTORE_LEARN=1 TR_RESTORE_TESTMODE=1 ~/Blanton_Script/blanton_tr518.sh stop
|
||||
# 每個 unit 多送:'l2 learn on'、'dsh -c "test mode nr=no"'(這兩行未上機驗證)
|
||||
```
|
||||
|
||||
### blanton_tr518_thermal.sh — `tr 518` 熱測參數版(未上機驗證)
|
||||
|
||||
用法、選項、`stop` 都跟 `blanton_tr518.sh` 一樣,只有 `tr 518` 參數不同:
|
||||
|
||||
```bash
|
||||
bcmcmd -n <u> -c 'dsh -c "tr 518 Scenario=6 Profile=2 portstopktszstride=1 Count=260 PktSize=603,218 CheckLinkTime=20 CheckDataTime=200 TestPhase=1"'
|
||||
```
|
||||
|
||||
參數覆蓋用 `TR_THERMAL_ARGS="..."`(不是 `TR_TEST_ARGS`)。
|
||||
|
||||
### port_prbs_monitor.sh — 100G PRBS
|
||||
|
||||
```bash
|
||||
bash ~/Blanton_Script/port_prbs_monitor.sh start # Ethernet513 + 514
|
||||
bash ~/Blanton_Script/port_prbs_monitor.sh start a # 只 Ethernet513
|
||||
bash ~/Blanton_Script/port_prbs_monitor.sh start b # 只 Ethernet514
|
||||
bash ~/Blanton_Script/port_prbs_monitor.sh report # PASS / FAIL(沒跑的顯示 SKIP)
|
||||
bash ~/Blanton_Script/port_prbs_monitor.sh stop # prbsstat STOp + prbs clear
|
||||
```
|
||||
|
||||
> PRBS 打起來時 link 顯示 down 是正常的,所以 `start` 刻意不印 port status。
|
||||
|
||||
### unused_lanes.sh / retimer_lanes.sh — 沒接線的 lane 關 TX
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/unused_lanes.sh status # 兩個 unit 全部列出 rx_lock / tx_off
|
||||
~/Blanton_Script/unused_lanes.sh off # 預設 TX squelch
|
||||
~/Blanton_Script/unused_lanes.sh off --asic 0 --th6 # 只 unit 0,連 retimer 後面的 TH6 port 一起關
|
||||
~/Blanton_Script/unused_lanes.sh on # 開回來
|
||||
~/Blanton_Script/retimer_lanes.sh 0 0x102 0xff status # 單顆 retimer:<asic> <addr> <lane_map> <off|on|status>
|
||||
```
|
||||
|
||||
- lane 有 RX lock(有訊號進來)時 `off` 會被拒絕(exit 2),`--force` 才硬關。
|
||||
- Script A 會 `off`,**沒有任何腳本 `on` 回來**;需要 DUT 回正常狀態時手動 `on`。
|
||||
- 兩支都要 `chmod +x`(`unused_lanes.sh` 會檢查 `retimer_lanes.sh` 的 exec bit)。
|
||||
|
||||
## 2.6 SerDes DSC 擷取
|
||||
|
||||
### bcm_dsc_scan.sh — DUT 端擷取
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/bcm_dsc_scan.sh # unit 0+1 全掃,約 10 分鐘
|
||||
~/Blanton_Script/bcm_dsc_scan.sh -u 0 # 只掃一個 unit
|
||||
~/Blanton_Script/bcm_dsc_scan.sh -f my.log -F # 自訂檔名 + 覆蓋
|
||||
~/Blanton_Script/bcm_dsc_scan.sh -n # dry-run,只列要掃的 port
|
||||
```
|
||||
|
||||
- log 在 `~/Blanton_Script/log/`,掃完自動 cp 到 `/host/hw-eval/jobs`(`-C` 關掉)。
|
||||
- 結尾固定印 `### DSC_SCAN_DONE rc=<n>`,**rc=0 才是全部 port 都拿到完整 dump**。
|
||||
|
||||
### bcm_dsc_parse.sh — raw log 轉 CSV
|
||||
|
||||
```bash
|
||||
sh ~/Blanton_Script/bcm_dsc_parse.sh -i blanton_dsc_ScriptA_u0.log -o u0
|
||||
# 產出 u0_lane.csv(每 lane 一列)+ u0_pm.csv(每 pm_id 一列)
|
||||
```
|
||||
|
||||
Host / DUT 都能跑(純 sh + awk)。解不出來的列標成 `UNPARSED` 印到 stderr。
|
||||
|
||||
### bcm_100g_dsc_cycle.sh — 100G link down/up 循環(未上機驗證)
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/bcm_100g_dsc_cycle.sh # 印說明
|
||||
~/Blanton_Script/bcm_100g_dsc_cycle.sh 200 # 跑 200 輪
|
||||
~/Blanton_Script/bcm_100g_dsc_cycle.sh 200 -d # 每行指令以 [CMD] 印出
|
||||
~/Blanton_Script/bcm_100g_dsc_cycle.sh 20 -T # 跳過 tuning
|
||||
~/Blanton_Script/bcm_100g_dsc_cycle.sh 1 -n # dry-run
|
||||
```
|
||||
|
||||
log:`~/dsc_log/100G_dsc_cycle_test_<ts>.log`。
|
||||
|
||||
## 2.7 背景監控(start / stop 型)
|
||||
|
||||
這幾支共通:`start` 只等 1 秒就返回(**不是跑完一輪**)、`start` 會先清空 log、需要 exec bit。
|
||||
|
||||
> ⚠️ **`bmc_monitor.sh tail` 是 `tail -f`,永遠不返回**,TTL 裡絕對不要用。看 log 請用 `cat`(`nfc_polling.sh tail N` 不會卡住)。
|
||||
|
||||
### mgmt_ping_monitor.sh — 10G + 1G 管理網路 ping
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/mgmt_ping_monitor.sh start # 背景,log/mgmt_ping.log
|
||||
~/Blanton_Script/mgmt_ping_monitor.sh status
|
||||
~/Blanton_Script/mgmt_ping_monitor.sh stop # 停 + 產出報表(每張卡最近 N 筆 + 統計 + 判定)
|
||||
~/Blanton_Script/mgmt_ping_monitor.sh summary # 只看每段的 RESULT 行
|
||||
~/Blanton_Script/mgmt_ping_monitor.sh clear
|
||||
cat ~/Blanton_Script/log/mgmt_ping.log
|
||||
```
|
||||
|
||||
- IP 設定在腳本開頭的 **User Configurable Section**(預設 eth0 `192.168.1.99` → `192.168.1.30`、eth1 `192.168.1.101` → `192.168.1.31`),依現場網路改。
|
||||
- 兩張卡同網段會 ARP flux:判讀看 `RESULT` 行的 `nic_tx` / `nic_rx`——**ping 成功但 `nic_tx` 接近 0 = 封包從另一張卡出去的**。
|
||||
|
||||
### nfc_polling.sh — NFC tag 輪詢
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/nfc_polling.sh start # 背景
|
||||
~/Blanton_Script/nfc_polling.sh status # pid、已跑幾輪、最後一筆結果
|
||||
~/Blanton_Script/nfc_polling.sh report # PASS / FAIL / ERROR 統計(輪詢中也能跑)
|
||||
~/Blanton_Script/nfc_polling.sh tail 50 # 最後 50 行(不會卡住)
|
||||
~/Blanton_Script/nfc_polling.sh stop
|
||||
~/Blanton_Script/nfc_polling.sh fg # 前景跑
|
||||
```
|
||||
|
||||
- 每輪呼叫同目錄的 `blantons_nfc_validate.py test --debug`。
|
||||
- `ERROR` = 工具沒印出 `[PASS]` / `[FAIL]` 或逾時,跟「tag 讀不到(FAIL)」分開算。
|
||||
- `NFC_INTERVAL_SEC` / `NFC_TIMEOUT_SEC` / `NFC_ARGS` 可調(**每個子指令都要帶**)。
|
||||
|
||||
### bmc_monitor.sh — BMC 記憶體 + I2C 圖樣
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/bmc_monitor.sh start # 背景,log/bmc_poll.log
|
||||
~/Blanton_Script/bmc_monitor.sh status
|
||||
~/Blanton_Script/bmc_monitor.sh stop
|
||||
~/Blanton_Script/bmc_monitor.sh fg # 前景跑
|
||||
cat ~/Blanton_Script/log/bmc_poll.log
|
||||
```
|
||||
|
||||
每輪透過 `bmc-manager run` 在 BMC 上跑 `free -m` + I2C(bus 1, 0x41)寫 `55 AA 55 AA` / `AA 55 AA 55` 再讀回比對,間隔 10 秒。要加減指令改腳本開頭的 `COMMANDS=( ... )`。
|
||||
|
||||
### bmc_monitor_ddr.sh — 已停用
|
||||
|
||||
BMC DDR 壓力已改成 Script B 的 `bgctl run bmc-manager run '/usr/bin/memtester 64M'`。檔案保留,用法同 `bmc_monitor.sh`(log 為 `log/bmc_ddr.log`)。
|
||||
|
||||
## 2.8 其他
|
||||
|
||||
### tray_id_stress.sh — Tray ID I2C stress
|
||||
|
||||
```bash
|
||||
~/Blanton_Script/tray_id_stress.sh # bus 34/35/38/39,0x70 reg 0x02:寫 0xA5/0x5A 讀回比對 → Summary
|
||||
~/Blanton_Script/tray_id_stress.sh -n 100 # 重複 100 輪
|
||||
~/Blanton_Script/tray_id_stress.sh -R # 跑完不還原(預設會寫回原值並讀回確認)
|
||||
```
|
||||
|
||||
exit:0 全 PASS / 1 有 FAIL(讀回不符)或 ERROR(i2c 指令本身失敗)/ 2 參數錯。
|
||||
|
||||
### usb_target.sh — 找 USB 隨身碟
|
||||
|
||||
```bash
|
||||
bash ~/Blanton_Script/usb_target.sh # 掛好並印掛載點(預設 /mnt/usb)
|
||||
bash ~/Blanton_Script/usb_target.sh -o dev # 印 partition(例如 /dev/sda1)
|
||||
bash ~/Blanton_Script/usb_target.sh -o both # 印 "<dev> <mnt>"
|
||||
bash ~/Blanton_Script/usb_target.sh -o id # 印 /dev/disk/by-id/... 路徑
|
||||
bash ~/Blanton_Script/usb_target.sh -n -o both # 只偵測,不掛載
|
||||
```
|
||||
|
||||
| exit | 意思 |
|
||||
|---|---|
|
||||
| 0 | 成功 |
|
||||
| 1 | 找不到 USB 隨身碟 |
|
||||
| 2 | 偵測到多支(拒絕猜) |
|
||||
| 3 | 沒有可用的檔案系統 |
|
||||
| 4 | 掛載失敗 |
|
||||
| 5 | 掛上了但不能寫 |
|
||||
|
||||
### blantons_nfc_validate.py — 客戶 NFC 驗證工具(v2.5)
|
||||
|
||||
```bash
|
||||
python3 ~/Blanton_Script/blantons_nfc_validate.py inventory # 唯讀探測,不送 I2C、不寫硬體
|
||||
python3 ~/Blanton_Script/blantons_nfc_validate.py test --debug # 切 VEN 並跑廠商 NCI 輪詢流程
|
||||
python3 ~/Blanton_Script/blantons_nfc_validate.py --version
|
||||
```
|
||||
|
||||
平常由 `nfc_polling.sh` 呼叫,不需要手動跑。
|
||||
|
||||
---
|
||||
|
||||
## 附錄:一頁速查
|
||||
|
||||
```bash
|
||||
# 佈署
|
||||
mount /dev/sda1 /mnt/usb && cp -r /mnt/usb/Blanton_Script ~/
|
||||
find ~/Blanton_Script -name '*.sh' -exec chmod +x {} + ; grep -rlU $'\r' ~/Blanton_Script
|
||||
|
||||
# 載入(Script A 也是這 6 支)
|
||||
source ~/Blanton_Script/blanton_fpga_pcimem.sh
|
||||
source ~/Blanton_Script/blanton_cb_i2c.sh
|
||||
source ~/Blanton_Script/blanton_icb_vi2c.sh
|
||||
source ~/Blanton_Script/blanton_pwr_data.sh
|
||||
source ~/Blanton_Script/blanton_traffic_linespeed.sh
|
||||
source ~/Blanton_Script/LTC2980_Margin_Script/margin.sh
|
||||
|
||||
# 收拾一個被中斷的測試
|
||||
kill $(jobs -p); systemctl stop mlucas-amm; bgctl stop --all; bgctl reset --yes
|
||||
~/Blanton_Script/mgmt_ping_monitor.sh stop; ~/Blanton_Script/nfc_polling.sh stop; ~/Blanton_Script/bmc_monitor.sh stop
|
||||
systemctl stop qfx5252-bmc-usb-net-test.service
|
||||
blanton_traffic_linespeed stop; ~/Blanton_Script/blanton_fdr.sh stop
|
||||
~/Blanton_Script/blanton_tr518.sh stop # 跑過 Script 4 / tr 518 時
|
||||
~/Blanton_Script/unused_lanes.sh on # 需要 DUT 回正常狀態時
|
||||
```
|
||||
Reference in New Issue
Block a user