sync: SHANGHAI-U9 2026-07-27 三个 Simulink→RTL skill 转系统级 + 新增 simulink-rtl-redev
- simulink_rtl_dev / rtl-ip-replace: 从工程级 .claude/skills 迁到用户级并去工程耦合 (模型名/Notes 文档依赖/工程实测基线移出; addpath 与脚本路径改用户级) - rtl-ip-replace/scripts/gen_cmp_tb.py: Vivado 路径不再写死, 改读 VIVADO_PATH / XILINX_VIVADO (兼容 install root / bin / bin\vivado.bat 三种写法), 回落时提示 去设 skills_env.md 的 VIVADO_PATH - simulink-rtl-redev: 新增。原生模型改动后的仿真模型同步规范, 含两个实测过的工具 check_sync.py (三条时序链新鲜度闸门) 与 measure_k.m (时域/频域/包络三估计器互证) - sim-rtl-flow/SKILL.md: 加入 sync_sim:* 步骤, 引用上述三个 skill
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Step 0 of every rtl-ip-replace run (MANDATORY, user directive 2026-07-23):
|
||||
move ALL existing content of the fixed output dir into backup_<timestamp>/,
|
||||
so the run always generates everything fresh while keeping full history.
|
||||
|
||||
Usage: python backup_outdir.py <outdir>
|
||||
Existing backup_* subdirectories are kept in place (not re-nested).
|
||||
"""
|
||||
import os, shutil, sys, time
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit('usage: backup_outdir.py <outdir>')
|
||||
d = os.path.abspath(sys.argv[1])
|
||||
os.makedirs(d, exist_ok=True)
|
||||
items = [x for x in os.listdir(d) if not x.startswith('backup_')]
|
||||
if not items:
|
||||
print('nothing to back up in', d)
|
||||
return
|
||||
bdir = os.path.join(d, 'backup_' + time.strftime('%Y%m%d_%H%M%S'))
|
||||
os.makedirs(bdir)
|
||||
for x in items:
|
||||
shutil.move(os.path.join(d, x), os.path.join(bdir, x))
|
||||
print(f'backed up {len(items)} item(s) -> {bdir}')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user