Commit Graph
22 Commits
Author SHA1 Message Date
etwenandClaude Opus 5 419b680980 feat(publish): Add publish.sh and sync docs for V1.0.3
publish/publish.sh packages src/Script_ABC_Blanton into
publish/Script_ABC_Blanton_<Ver>/, with -z for a zip, -f to overwrite,
-n for a dry run.

The version is read from Script A's "; Version :" header rather than
passed in, so the folder name cannot disagree with what the tester sees
on opening the macro. The header is CRLF, so the carriage return is
stripped -- left in, it becomes part of the directory name. Captured
logs are excluded (they carry DUT serials) but the empty logs/ is kept
because logopen writes there. .gitignore now admits the tool while
still ignoring its output.

config.ttl: testcase ENV, margin scan off for this run.

Docs brought up to date with the 14 commits since 8aa5c90 -- SWB
channel/address map, the traffic and BMC tooling, line-ending policy,
and the exec-bit and tail -f traps.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-21 09:33:06 +08:00
etwenandClaude Opus 5 4ed283d0ca feat(ttl): Wait for thermal sensors before taking baseline data
New utils/wait_init.ttl polls `show platform temperature` every 10 s
until it stops reporting "Thermal Not detected", so Script A does not
record a baseline while pmon is still coming up. Script A calls it right
after `show boot` and bumps to V1.0.3.

The include pointed at utils/wait_thermal.ttl while the file is
wait_init.ttl -- as Script A's own V1.0.3 history line says. Corrected;
Tera Term aborts the macro when an include cannot be opened, so this
would have stopped Script A at line 59 on the first run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-21 09:17:50 +08:00
etwenandClaude Opus 5 491e807cf8 feat(ttl): Log 100G port status, run traffic on both switch units
Script A and B: `show interfaces status Ethernet513,Ethernet514` before
the traffic stage, so the uplink state is on record next to the counters
it explains. In B this takes the slot the empty "eye measurement"
placeholder held.

Script B: drop -u 0 from the traffic calls. A and C already defaulted to
TL_UNITS="0 1", so B was pinned to unit 0 while C stopped both -- the
soak only ever loaded one switch board, and C's stop hit a unit that was
never initialised. All three scripts now cover both units.

Script B: post-clear settle 10 s -> 15 s, matching A.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-20 23:51:28 +08:00
etwenandClaude Opus 5 18ce7a1a73 fix(ttl): Dump BMC logs with cat instead of the blocking tail
`bmc_monitor.sh tail` runs `tail -n 50 -f`, which never returns, so
Script C stopped at the first call and never reached CHECK Stress
results, the traffic counters, or the closing messagebox. Stopping the
monitors first made it worse: with the file no longer growing, tail -f
just waits forever.

Read the two logs directly instead, so the whole BMC capture lands in
the master log and the macro carries on.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-20 11:14:34 +08:00
etwenandClaude Opus 5 d1b5cfea0b feat(ttl): Wire BMC monitors into Script B/C, log BMC version in A
Script A: dump the BMC banner via `bmc-manager run 'cat /etc/issue'`,
and add the missing `wait` before `show boot`.

Script B: start bmc_monitor_ddr.sh and bmc_monitor.sh alongside the
host stress load.

Script C: stop both and dump their logs into the master log.

bmc_monitor.sh: INTERVAL_SEC 5 -> 10.

Known blockers, filed here so they are not lost -- this wiring does not
work yet as written:

1. `bmc_monitor.sh tail` runs `tail -n 50 -f`, which never returns.
   Script C blocks on the first one and never reaches CHECK Stress
   results, the traffic counters, or the final messagebox. It needs a
   non-following dump (cat) instead.

2. Both scripts are mode 100644 and are the first .sh here meant to be
   executed rather than sourced. do_start re-execs "$SCRIPT_PATH"
   __daemon directly, so the execute bit is required even when invoked
   through bash -- and a Windows -> USB -> DUT copy cannot carry it.
   A chmod +x is needed before the start calls, as Script B already
   does for mlucas-avx2.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-20 11:12:03 +08:00
etwenandClaude Opus 5 5e63e3da6b fix(bmc): Give bmc_monitor_ddr its own log so the two can run together
Both scripts defaulted to LOG_NAME="bmc_poll.log", and PID_FILE is
derived from it, so the monitor and the DDR stress shared one log and
one pid file -- while the whole point of the split is to run them at
the same time.

The failure was quiet rather than loud: is_running greps the pid's
cmdline for its own SCRIPT_NAME, so the second script did not recognise
the first as running and started anyway. prepare_log_on_start then
truncated the log the first one was writing (START_LOG_MODE=new), both
raced on the pid file, and a later stop could only reap whichever wrote
it last, orphaning the other.

bmc_monitor_ddr.sh now uses bmc_ddr.log, which also moves its pid file
to bmc_ddr.pid. Both remain covered by the *.log ignore rule.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-20 11:03:44 +08:00
etwenandClaude Opus 5 855b7a6e30 feat(bmc): Split DDR stress out of bmc_monitor into bmc_monitor_ddr.sh
bmc_monitor.sh was doing two unrelated jobs: sampling `free -m` every
few seconds, and running `memtester 500M 1` as a stress load. They want
different timeouts -- a monitor should give up in 30 s, a memtester
pass legitimately runs for minutes -- and mixing them meant either
cutting memtester short or letting a hung sample stall the loop.

bmc_monitor.sh now polls `free -m` only, keeping CMD_TIMEOUT_SEC=30.
bmc_monitor_ddr.sh is the stress half: memtester only, with
CMD_TIMEOUT_SEC raised to 3600. The two are otherwise identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-20 11:00:04 +08:00
etwenandClaude Opus 5 310f897067 feat(bmc): Add bmc_monitor.sh, log build/uptime/reboot-cause in A and C
bmc_monitor.sh (V1.1.0): polls the BMC from the SONiC host via
`bmc-manager run`, appending to a rotating log. Runs detached, so no
interactive SSH session to the BMC is needed and the BMC's busybox
toolchain never comes into play. Subcommands start/stop/status/fg/tail/
clear; the polled command list, interval, per-command timeout and log
rotation are configured at the top of the file. START_LOG_MODE defaults
to "new", so one run means one log. Default COMMANDS are `free -m` and
`memtester 500M 1`, i.e. the BMC is memory-stressed alongside the host
soak.

Script A: `show boot` after the time sync to record the image the DUT
booted, and `show uptime` at the end of the traffic baseline.

Script C: `show reboot-cause` and `show uptime` after the traffic
report, so an unplanned reset during the soak is visible in the
closing snapshot rather than only in dmesg.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-20 10:47:35 +08:00
etwenandClaude Opus 5 fedf697977 docs(margin): Realign channel-pairing comments with bench wiring
The values were corrected in ababb2c but every comment describing the
pairing still said the old one, leaving four confs where the comment
contradicted the line it sat on:

    CB_I2C_CH=8           # CB F3 Ch6 = SWB0 CONN13/CONN14 ...

That reads as a typo waiting to be "fixed" back to 6, which would undo
a bench-verified value. Comments now state the real pairing:

    Ch6 = SWB0 CONN14/CONN16    Ch8 = SWB0 CONN13/CONN15
    Ch7 = SWB1 CONN14/CONN16    Ch9 = SWB1 CONN13/CONN15

Same map corrected in margin.sh's header (two places).

Ref/margin_command_trace.md gets a staleness banner rather than an
edit. Its 1223 expanded cb_pmbus_* commands were generated from the old
values - 487 of them use addresses that no longer exist (0x5D, 0x5F,
0x63, 0x65) - so patching the headings would leave the bodies wrong and
look authoritative. The banner carries the correct table and says the
SWB chapters need regenerating; chapters 1-4 are transport-independent
and remain valid.

Comments only: no CB_I2C_CH value and no CHIPS address was touched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-19 12:19:44 +08:00
etwenandClaude Opus 5 ababb2c3d1 fix(margin): Correct SWB I2C channels and LTC2977 addresses from bench
Verified against the DUT. Two things were wrong in the SWB confs.

Channel assignment: CONN13/CONN15 and CONN14/CONN16 were paired the
wrong way round. The bench wiring is

    SWB0  Ch6 = CONN14/CONN16    Ch8 = CONN13/CONN15
    SWB1  Ch7 = CONN14/CONN16    Ch9 = CONN13/CONN15

LTC2977 addresses: the high half of each LTC2980 was recorded one step
above the low half (0x5C/0x5D, 0x62/0x63). These are 7-bit addresses
derived from 8-bit pairs, so they step by two: 0x5C/0x5E and 0x62/0x64.

This also clears the collision noted in v2.6.0, where SWB0_CONN13 chip2
and SWB0_CONN14 chip1 both landed on 0x5E on Ch6. Each channel now
carries two disjoint address pairs (0x5C/0x5E and 0x62/0x64), verified
collision-free across all eight SWB confs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-19 12:10:39 +08:00
etwenandClaude Opus 5 a9c3dafc22 fix(traffic): Stop report saturating counters at INT32_MAX
Every value in the report printed as 2147483647 because grp() rendered
counters with sprintf("%d", v). The DUT's awk casts to a 32-bit int for
%d, so any counter above 2^31-1 saturates -- and a real line-speed run
is around 7e11, three orders of magnitude past that. Formatting with
%.0f keeps the value in awk's double domain, which is exact to 2^53.

The FAIL delta line had the same defect (%+d): a dead port makes the
delta as large as the counter itself, so the one number needed to
diagnose the failure would have been the one that saturated.

Verdicts were never affected. The cross-check compares the TX[]/RX[]
doubles directly and only the display path goes through grp(), so past
PASS results stand; only the printed numbers were wrong.

Verified against a captured run (secret/Counter.log, 108 pairs): values
now match the raw MIB_TPOK/MIB_RPOK lines exactly, and the loopback
identity holds (cd0.TX == cd32.RX, cd0.RX == cd32.TX).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-19 09:21:16 +08:00
etwenandClaude Opus 5 4088a828c6 feat(ttl): Add traffic baseline to Script A, tune waits and unit args
Script A: the TRAFFIC-SETUP-STAGE placeholder is now a full loopback
round (ps, init, clear, show, start, stop, report) with 15 s settles, so
the run has a traffic baseline before the soak starts.

Script B: widen the post-clear settle from 3 s to 10 s.
Script C: drop -u 0 from stop/report so both switch units are covered.

Note: Script B still pins -u 0 while A and C now default to both units.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-19 09:02:41 +08:00
etwenandClaude Opus 5 afb7b1e283 fix(margin): Convert margin.sh and settings to LF, pin line endings
margin.sh and settings/*.conf carried CRLF into the repo, so sourcing
them on the SONiC DUT failed outright:

    -bash: $'\r': command not found
    margin.sh: line 126: syntax error near unexpected token `$'{\r''

settings/*.conf was the quieter half of the same bug: margin_init
sources them, and an unquoted assignment such as CB_I2C_CH=6 became
"6\r", so the SWB transport would have driven I2C with a malformed
channel number.

Content is unchanged - the diff is carriage returns only, and bash -n
passes on every converted file.

Add .gitattributes so this cannot come back: *.sh/*.conf/*.py/*.txt/*.md
are pinned to LF, *.ttl stays CRLF (Tera Term runs on Windows only) and
office formats are marked binary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-18 16:34:55 +08:00
etwenandClaude Opus 5 fd35857d80 refactor(margin): Drop duplicated cb_i2c/pcimem copies
margin.sh v2.6.0 resolves the SWB backend via _swb_find_backend, which
searches the parent Blanton_Script/ dir, so the copies bundled inside
LTC2980_Margin_Script/ are dead weight and would silently drift from
the shared originals.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-18 10:38:59 +08:00
etwen cdf38a09ae feat(margin): Wire SWB transport to shared cb_i2c package, bump to v2.6.0
margin.sh (swb path only, CB/i2c path untouched):
- Search blanton_cb_i2c.sh / blanton_fpga_pcimem.sh in the parent
  Blanton_Script/ dir as well; the old code only looked next to margin.sh
  where those files do not exist, so TRANSPORT=swb always failed to load.
- _swb_setup: validate CB_I2C_CH, cb_i2c_init <ch> 0x88 0x00 once per
  session, then CB_I2C_AUTO_INIT=0 to drop 4 pcimem writes per transfer.
- Probe every LTC2977 in CHIPS with cb_pmbus_read <ch> <addr> 0x00 1.
- Check cb_pmbus_read/write return codes; a NACK is now reported instead
  of silently becoming Vout=0.0000.
- Fix DEBUG_MODE collision with blanton_fpga_pcimem.sh: pcimem tracing is
  gated by MARGIN_SWB_PCIMEM_DEBUG via _swb_call.
- Add margin_swb_info / probe / scan / reset / sem wrappers.

settings: fix CB_I2C_CH per bench wiring (CONN14/CONN15 were swapped)
  Ch6 = SWB0 CONN13/14, Ch8 = SWB0 CONN15/16,
  Ch7 = SWB1 CONN13/14, Ch9 = SWB1 CONN15/16

Ref/margin_command_trace.md: new command trace reference - every i2c /
  cb_pmbus command issued by margin_init, margin_status and
  margin_apply_profile combo_high3, expanded per channel for the CB conf
  and all 8 SWB confs, with LINEAR16 values and register meanings.

Known issue documented, not changed: SWB0_CONN13 chip2 (0x5E) collides
with SWB0_CONN14 chip1 (0x5E) now that both sit on Ch6; SWB1 pattern
suggests 0x5D, pending hardware confirmation.
2026-08-18 10:38:59 +08:00
etwenandClaude Opus 5 8aa5c90166 docs(arch): Sync ARCHITECTURE and CLAUDE with 20260817 changes
Bring both docs in line with the five commits pulled from Gitea.

- BDF: pcimem V1.5.0 auto-detects the CB FPGA BDF, so the "edit the four
  lines per DUT" guidance was inverted. Documented the detection order
  and fpga_rescan, and flagged that utils/show_pcie_error_reg_*.ttl
  still hard-codes its 7 BDFs -- the footgun is only half gone
- Traffic: documented blanton_traffic_linespeed.sh (bcmcmd SWB loopback,
  per-pair TX/RX cross-check) and tools/bcm_mibpair_report + the three
  loopback command tables; noted the route taken differs from the
  SONiC-CLI approach Phase 4 originally planned
- Stress: stress_hhmd and stress_pcie were removed on 08-17, so the job
  count is 8 not 10; soak loop now pulls full setup_pmon (9 items)
- Constraints: added the bcmcmd exit-0 and stdin-eating gotchas
- Phases: ticked 10 completed items, corrected Phase 3/4 acceptance
  criteria, and moved BDF auto-detect out of Future Extensions

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-17 21:51:17 +08:00
etwenandClaude 224ddbd21c feat(traffic): Report all pairs and add -tx/-length aliases
V0.4.0 -- report now lists ALL 108 pairs, PASS / FAIL / NA alike,
one line per port (two lines per pair). Missing counters render as
'-', so -a becomes the default (the flag is still accepted) and the
long "# NA (no counters): ..." summary line is dropped since every
NA pair is now a visible row. The table printer is generalised to a
column array with per-column alignment, keeping the pad-then-colour
order so ANSI codes do not break the column widths. This is the only
intentional difference from tools/bcm_mibpair_report_V1.1.0.py.

V0.3.3 -- accept -tx / -length as aliases for -c / -l so a tx burst
can be written the way the bcm command reads
("start -u 0 -tx 100 -length 512"); both are validated as positive
integers. Fix --dry-run printing nothing for init/start/stop/report
since V0.3.1, where the new bcm wrapper discarded the "[DRY ]" lines.
Offline report notes now go to stderr so the table on stdout stays
pipe/diff clean.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-17 21:20:36 +08:00
etwen 9d61b1aa43 docs(status): Add TTL script status sheet 20260817 2026-08-17 16:32:44 +08:00
etwen 071244fde1 feat(traffic): Add SWB loopback line-speed traffic tool
Blanton_Script/blanton_traffic_linespeed.sh V0.3.2 drives the whole
loopback traffic run from the DUT shell via bcmcmd, for both switch
boards (unit 0 and 1):

- init  : vlan remove 1 pbm=cd, then create/add the 108 loopback
          pairs (VLAN 30..137, cdN <-> cdN+32)
- clear : clear c
- show  : show c (raw)
- start : tx <count> length=<len> VLantag=<vid> per VLAN
- stop  : remove the pairs, optional --destroy
- ps    : port status of the cabled ports
- report: parse the show c MIB_TPOK/MIB_RPOK counters and lay them
          out one pair per block with a cross-check verdict
          (cdA.TX == cdB.RX and cdA.RX == cdB.TX), PASS green /
          FAIL red / NA yellow, --tolerance for snapshot skew,
          --tsv, --raw and -f <log> for offline analysis; the raw
          capture is kept under /tmp
- run   : ps -> init -> clear -> start -> report

Options -u/-c/-l/-p/-T/-d/-n and a sourceable function API, in the
style of the other blanton_*.sh tools. Command output matches the
former Tera Term macros byte for byte; report output matches
tools/bcm_mibpair_report_V1.1.0.py, added here as the off-box
equivalent, together with the raw bcmcmd command lists under tools/.

ScriptA sources the tool, ScriptB runs ps/init/clear/show/start and
drops stress_hhmd and stress_pcie, ScriptC stops the traffic and
prints the pair counter report.
2026-08-17 16:32:43 +08:00
etwen 9bf4291d17 feat(fpga): Auto-detect CB FPGA BDF at source time
blanton_fpga_pcimem.sh V1.5.0.

The four FUNCT0..3_RES sysfs paths were hard-coded and had to be
edited for every DUT, because the CB FPGA's BDF changes with the
PCIe enumeration (0000:03:00.x / 0000:05:00.x seen so far).

Detection order at source time: FPGA_BDF override -> sysfs scan for
vendor 0x1590 with all four functions exposing resource0 -> lspci
-Dnn name/id match -> FPGA_BDF_FALLBACK. Adds fpga_rescan for a
DUT swap, FPGA_BDF / FPGA_VENDOR_ID / FPGA_LSPCI_MATCH overrides,
FPGA_BDF_ACTIVE reporting and FPGA_QUIET. Detection runs once, so
cb_fpga / pmc / icb / swb keep zero per-command overhead.
2026-08-17 16:32:42 +08:00
etwen 725f51681a feat(ttl): Add leakage status to PMON snapshot, bump A/B/C to V1.0.2
- utils/setup_pmon.ttl: add 'show platform leak status' and 'leak channels'
- Script A: move setup_pmon include into the TAKE DATA block
- Script B: soak loop now reuses utils/setup_pmon.ttl instead of inline fan/temperature
- Script C: fix header title (was 'Script B')
2026-08-17 10:06:24 +08:00
etwenandClaude Opus 5 24c704c667 docs(arch): Add ARCHITECTURE.md and CLAUDE.md, init repo
Bring the Blanton Tera Term TTL test suite under version control and
document how the pieces fit together.

- ARCHITECTURE.md: A/B/C script roles, host-to-DUT-to-FPGA data path,
  config/settings/profile data models, PCIe AER + EDAC topology table,
  10 key constraints, and 6 development phases derived from the
  Status_20260814 spreadsheet's On-Going items
- CLAUDE.md: stack, smoke-test commands, conventions, and the hardware
  footguns (per-unit BDF, VSPI vs VI2C timing, repeated START,
  STORE_USER_ALL, ARB_LOST false positives)
- secret/: gitignored credential store with README + .example template,
  so the DUT login stops living in 1_Blanton_Script_A.ttl
- .gitignore: secret/*, For_AI/, *.log, publish/, *.DSN

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RetWKFZFG1ZHcitQAyhwM
2026-08-17 08:52:11 +08:00