Repository navigation
Conversation
…viewed against Write down the idioms flow/scripts/*.tcl keeps to as hard-stop rules, each with what breaks when it is broken, plus the review suggestions on these scripts that are declined again and again, so that a contributor's AI writes code consistent with the existing scripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new documentation file, TclContract.md, which outlines the rules, idioms, and guidelines for writing and reviewing stage scripts in flow/scripts/*.tcl. It also updates AGENTS.md, DeveloperGuide.md, and the table of contents (toc.yml) to reference this new contract. The review feedback focuses on improving readability by refining clunky phrasing in TclContract.md and DeveloperGuide.md, as well as ensuring formatting consistency for list items in the new contract.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
The stage scripts in
flow/scripts/*.tclkeep to idioms that have grown up in review and were never written down. This writes them down indocs/contrib/TclContract.mdas hard-stop rules, so that a contributor's AI writes stage-script code that is congruent with the existing scripts, and automated review has something to check against. The goal is more contributor autonomy: fewer review rounds spent restating the same conventions. Each rule says what breaks when it is broken.util.tclhelpers (append_env_var,log_cmd,orfs_write_db/orfs_write_sdc) rather than writing them again; a command's arguments go throughlog_cmdso the log shows the full command line that a user copies into<STEP>_ARGS; procs take arguments rather than globals, and state that crosses steps lives in the.odb; never repeat an OpenROAD default; an explicit flag over a sentinel value; plain Tcl astclint/tclfmtcheck it.variables.yaml, a declared input file); a failing step writes<step>-failed.odband callserror, never the success artifact; no error numbers or tool checks in ORFS.open.tclnever writes a file; a refactor never changes behavior.file existschecks,error $msg $::errorInfo, prefixingRESULTS_DIRwithout reading the callee, "robustness" for cases the flow does not have, and untested yosysselectrewrites. It also says which suggestions are worth taking.The rules come from review threads on
flow/scripts/*.tcl, among them #4563, #4543, #4416, #4365, #4619, #4688, #4685, #4418, #3680, #4168, #3076, #2700, #3330, #3610, #1652, #2100, #2236, #1596, #2610, #4486, #4212 and #4179. Existing code that breaks a rule is technical debt, not precedent.The page links to the Makefile contract (#4689) for the step and variable rules, which apply to the stage scripts too and are not repeated. The two PRs are independent and merge without conflict; this one's link to
MakefileContract.mdresolves once #4689 is merged.AGENTS.mdgets one line pointing agents at the page, and the Developer's Guide anddocs/toc.ymllist it.Documentation only.
🤖 Generated with Claude Code