Tr4Maestro 电路自动优化Circuit optimization in Maestro
定好目标,
让 Maestro
自己调。Set the goals.
Let Maestro tune.
从 Maestro 的 Plug-in 菜单打开,六步走完:读取设计、勾选参数、设定目标、开始优化、看实时结果、读 Pareto 前沿。优化器自己改器件参数、跑仿真、比结果;原设计全程只读。Open it from Maestro's Plug-in menu and walk six steps: read the design, tick parameters, set goals, start, watch live results, read the Pareto front. The optimizer edits device parameters, runs the simulations and compares the results; your original design stays read-only throughout.
转动旋钮,两张图一起换代Turn to step both charts through generations
左 · 双目标Left · two objectives –
右 · 三目标Right · three objectives –
为什么做Why
调参的循环,
交给优化器。Hand the tuning loop
to an optimizer.
几十个 W/L、几个角点,增益、功耗、相位裕度互相拉扯。手工改一组参数、跑一轮仿真、看一眼结果,再改下一组,大部分时间都花在重复操作上。Dozens of W/L values, several corners, and gain, power and phase margin pulling against each other. Change a set of values, simulate, look, change again: most of the time goes into repetition.
演示片Film
七十秒,
从手调到自动寻优。Seventy seconds,
from hand-tuning to auto-search.
中英文版各有配音,随页面语言切换,结构和画面相同。开头的准备流程和手调循环是示意动画,耗时数字(准备按分钟、手调按小时)也是示意;双目标与三目标(3D)前沿、收敛和候选画面来自演示服务(合成数据,不调用 Cadence);从 Maestro 菜单打开并读入测试台、Library Manager 两段是自建中性演示库的 Virtuoso 实拍;提速数字出自产品文档的本机实测样本。Chinese and English versions share the same cut and visuals, each with its own narration, and follow the page language. The opening prep chores and hand-tuning loop are illustrative animation, and so are their clocks (minutes for prep, hours for tuning). The two- and three-objective (3D) fronts, convergence and candidate shots come from the demo service (synthetic data, no Cadence calls). Opening Crescendo from the Maestro menu and the Library Manager shot are real Virtuoso captures of a neutral demo library. The speed-up figure is a measured sample on this machine.
流程Workflow
六步,左边一条线。Six steps, one column on the left.
左侧导航就是流程本身,完成一步打一个勾。每一步对应下面一张实机截图。The navigation on the left is the workflow; each step gets a tick when it is done. Every step below is a real screen.
读取设计Read the design
从 Maestro 菜单打开时,当前 Maestro 已经选好。点“Load and Inspect”,选一个 Test,在层级里勾选要优化的模块(含子模块)。Crescendo 在 Maestro 和 config 的工作副本里工作,原库、原视图不写。Opened from the Maestro menu, the current Maestro is already selected. Read the design, choose one Test and tick the blocks to optimize, subcells included. Crescendo works in working copies of the Maestro view and config; the original library and views are never written.
勾选参数Tick the parameters
参数按层级或按名称排列,可以搜索。“W All”“L All”一键选中所有宽长;双击上下限即可修改。Parameters are listed by hierarchy or by name, with search. “W All” and “L All” select every width and length; double-click a bound to edit it.
- Hierarchy / By Name
- W All · L All
- linear / log
设定目标Set the goals
选输出、方向(最大化、最小化或逼近目标值)和角点;约束写成“PM ≥ 55”这样的形式。先聚合再比较:“max”压低所选角点里最差的那个,“mean”对每个原生点等权。两个以上目标自动用 NSGA-II。Pick an output, a direction (maximize, minimize or target) and corners; constraints read like “PM ≥ 55”. Aggregation comes first: “max” works on the worst selected corner, “mean” weights every native point equally. Two or more objectives switch to NSGA-II automatically.
开始优化Start
填迭代代数,点右上角“Start Optimization”。仪表盘实时显示已评估、满足约束、当前最优和当前代,收敛曲线画出历代最优。每个候选完成后存断点。Enter the number of generations and press Start. The dashboard shows evaluated, feasible, best-so-far and current generation, with a best-so-far convergence curve. A checkpoint is written after every candidate.
实时结果Live results
每个目标一张收敛图,下面是候选表:状态、是否可行、目标值、约束值,Pareto 候选标星。选中一行看全部参数,右键打开这个候选的仿真日志。结果可以导出 CSV 或完整数据集。One convergence chart per objective, then the candidate table: status, feasibility, objective and constraint values, Pareto candidates starred. Select a row for every parameter value; right-click for its simulator log. Export as CSV or as a complete dataset.
权衡分析Read the trade-off
每两个目标一张散点图,前沿点按完整维度判定并连成线。点任何一点,跳到对应候选。One scatter per pair of objectives; front points are judged in full dimension and joined by a line. Click any point to jump to that candidate.
两种模式Two modes
默认只看主线,
细节一键展开。The main line by default,
details one switch away.
简洁模式只留六步主流程。左下角打开“Pro mode”,所有高级设置原样出现;切换只改显示,不改任何设置。Simple mode keeps the six main steps. Turn on Pro mode at the bottom left and every advanced setting appears as before; switching changes what is shown, never the settings.
简洁模式Simple mode
读取设计、参数、目标、运行、结果、权衡。第一次用也能照着走完。Design, parameters, goals, run, results, trade-off. A first-time user can follow it end to end.
专业模式Professional mode
- 工作副本:整套保存、加载、局部更新Working copies: save, load, partial update
- 历史结果、Config、可选的 PDK 范围检查History, Config, optional PDK range checks
- 算法高级参数、断点加载Advanced algorithm parameters, checkpoint loading
- 网表来源、求解与提交命令、Job Setup、EDA 覆盖Netlist source, solver and submission commands, Job Setup, EDA overrides
- 三级仿真链路诊断Three-stage simulation diagnostics
大工程Large projects
五万个参数,
界面照样跟手。Fifty thousand parameters,
still responsive.
演示工程有 4000 个模块、50,726 个参数。同一套自动操作脚本跑两遍取平均,记录每步耗时,以及这段时间里界面最长一次没有响应的时间。耗时较长的步骤都在后台分批完成,界面始终可以点击和滚动。The demo project has 4,000 blocks and 50,726 parameters. The same scripted run was done twice and averaged; the table lists each step's elapsed time and the longest moment the window stopped responding. Longer steps run in the background in slices, so the window stays clickable and scrollable.
| 操作Action | 耗时Elapsed | 界面最长无响应Longest freeze |
|---|---|---|
| 读取所选模块的参数Apply selected cells | 0.67 s | 90 ms |
| 参数树(按层级)首次渲染Parameter tree (hierarchy), first render | 3.0 s | 74 ms |
| 勾选 W All / L AllW All / L All | 0.18 s | 168 ms |
| 切到“By Name”视图Switch to By Name | 3.3 s | 176 ms |
| 切回“Hierarchy”视图Back to Hierarchy | 0.04 s | 34 ms |
| 检查所选范围Check selected ranges | 2.4 s | 163 ms |
| 点“Start Optimization”到开始运行Start Optimization until running | 7.7 s | 708 ms |
| 续跑上一次运行Resume a previous run | 1.8 s | 300 ms |
“开始优化”的耗时主要是把完整配置和断点写盘;这一步不阻塞界面。Most of the Start time is writing the complete configuration and checkpoint to disk; it does not block the window.
开源与安装Open source and install
只要 Python 和 Tk,
不用装任何包。Python and Tk only.
Nothing to install.
源码以 MIT 许可证发布在 GitHub。只用 Python 标准库,没有 pip 依赖。演示模式不需要任何 EDA 工具;真正优化电路需要你自己的 Virtuoso、Maestro、Ocean、Spectre 或 ALPS,以及 PDK 和 license。The source is on GitHub under the MIT licence. It uses only the Python standard library, with no pip dependencies. Demo mode needs no EDA tools; real optimization needs your own Virtuoso, Maestro, Ocean, Spectre or ALPS, PDK and licences.
# 演示窗口,不调用 Cadence# demo window, no Cadence calls $ python3 -m crescendo.demo_main --scale small --autoload # 给 agent:JSON 环境报告、无界面优化# for agents: JSON environment report, headless run $ python3 -m crescendo doctor $ python3 -m crescendo run optimization-spec.json # 在 .cdsinit 里加一行,从 Maestro 的 Plug-in 菜单打开# one line in .cdsinit, then open it from Maestro's Plug-in menu load("/path/to/crescendo/load.il") # 只要搜索算法:作为 Python 库调用(ask/tell)# just the search: use it as a Python library (ask/tell) >>> from crescendo_engine.optimizers import PopulationGenerator >>> gen = PopulationGenerator(variables, "nsga2", seed=1) >>> batch = gen.ask(8) # 仿真这一代后# simulate them, then >>> gen.tell(rows)
- 运行环境Runtime
- Python 3.6+(仅标准库),Tk 8.5+,X 显示Python 3.6+ (standard library only), Tk 8.5+, an X display
- 真实优化Real runs
- Virtuoso(IC 6.1.8 已测)+ Maestro + Ocean,Spectre 或 ALPS,你的 PDK 与 license;集群调度器可选Virtuoso (IC 6.1.8 tested) with Maestro and Ocean, Spectre or ALPS, your PDK and licences; a cluster scheduler is optional
- 工艺适配PDK adapters
- 仓库只带虚构示例,真实工艺需要你提供适配清单Only fictional examples ship; real kits need adapter manifests you provide
- 工作副本Working copies
- 在原库同一个 cell 下建
cr_s_开头的 Maestro、config 和工作原理图视图,带归属标记;各候选借用并重置同一套副本,不逐个复制整库。候选的临时工作区在结果存盘后清理;副本本身在专业模式的“工作副本”列表里查看和删除。中断后重新打开会先核对归属记录再恢复。原设计全程只读。详见 README 的“Crescendo 会创建什么”Maestro, config and working schematic views namedcr_s_…are created next to the original in the same cell, each with an ownership marker. Candidates borrow and reset the same copy instead of copying the library. Raw candidate workspaces are removed once results are saved; the copies themselves are listed and deleted from the Working Copies list in Pro mode. After an interruption, ownership records are checked before anything resumes. The original design stays read-only. See “What Crescendo creates” in the README - 作为库调用As a library
- 1.1.3 起,
crescendo_engine.optimizers的 ask/tell 接口是固定契约:不需要窗口、Maestro 或调度器,root 和普通用户都能用,四种算法同一种子可复现。RF-FIELDWORK 的 VCO 设计系统就用它做参数优化From 1.1.3, the ask/tell API increscendo_engine.optimizersis a pinned contract: no window, Maestro or scheduler, works as root or a normal user, and all four algorithms are reproducible from a seed. The RF-FIELDWORK VCO Design System uses it for parameter optimization · HEADLESS_API.md - 许可证Licence
- MIT
数据口径About the data
- 页首显示屏、演示片和截图里的优化数据都来自 Crescendo 自带的演示服务:合成的运放式指标,没有调用 Cadence。它们演示界面和流程,不代表任何真实电路的性能。The optimization data in the display, film and screenshots comes from Crescendo's bundled demo service: synthetic op-amp-like metrics with no Cadence calls. It demonstrates the interface and workflow and makes no claim about any real circuit.
- “大工程”表格在本机(CentOS 7、8 核、Python 3.6.8、Tk 8.5)用演示服务测得,仿真延迟设为 0,只包含界面自身的开销;测量时同机还有其他仿真在运行(负载约 7–8)。真实工程还要加上 Virtuoso/Ocean 的原生等待。The large-project table was measured on this machine (CentOS 7, 8 cores, Python 3.6.8, Tk 8.5) with the demo service and zero simulated latency, so it covers the interface's own cost; other simulations were running on the machine at the time (load about 7–8). Real projects add native Virtuoso/Ocean time.
- 内核功能与验证范围以内核的发布记录为准;目标站点(ALPS、集群调度器、具体 PDK)的现场验收与本机测试分开进行。Kernel features and their validation follow the kernel's release records; acceptance on target sites (ALPS, cluster schedulers, specific PDKs) is separate from local testing.
另外三件工具The other three tools