当前位置: 首页 > news >正文

SDC命令详解:使用相对路径访问设计对象(current_instance命令)

相关阅读

SDC命令详解https://blog.csdn.net/weixin_45791458/category_12931432.html?spm=1001.2014.3001.5482


在使用get_cells等命令访问设计对象时,需要指定设计对象的名字,这个名字是一个相对路径,本文就将对此进行讨论。

本文针对Design Compiler,但该命令同样存在于PrimeTime、IC Compiler等工具中,它们大致相同,略有差别。

相对路径

使用相对路径来访问设计对象时,该对象必须位于当前设计(Current Design)中,且路径相对当前实例(Current Instance)指定,当前实例是当前设计中的一个层次单元,默认情况下当前实例就是当前设计,可以使用current_instance命令设置当前实例。

图1 一个简单的层次设计

以图1为例,如果想在当前设计中Multiplier_Booth_STG_0中设置单元M1/C150的dont_touch属性,可以使用下面两种方法:

// 方法一 prompt> current_design // 确认当前设计 Current design is 'Multiplier_Booth_STG_O'. (Multiplier_Booth_STG_0} prompt> set_dont_touch [get_cells M1/C150]
// 方法二 prompt> current_design // 确认当前设计 Current design is 'Multiplier_Booth_STG_O'. (Multiplier_Booth_STG_0} prompt> current_instance . // 确认当前实例,注意点的添加 Current instance is the top-level of design 'Multiplier_Booth_STG_0'. prompt> current_instance M1 // 设置当前实例 Current instance is '/Multiplier_Booth_STG_0/M1'. /Multiplier_Booth_STG_0/M1 prompt> set_dont_touch [get_cells C150]

在方法一中,路径相对当前设计(即顶层设计)指定;在方法二中,路径相对实例M1指定。若想将当前实例重置为当前设计,只需要使用不带参数或使用/作为参数的current_instance命令即可,如下所示。

prompt> current_instance Current instance is the top-level of design 'Multiplier_Booth_STG_0'. prompt> current_instance / Current instance is the top-level of design 'Multiplier_Booth_STG_0'.

需要注意的是,如果使用current_design重新设置了当前设计,则当前实例也会被重置为当前设计,如下所示。

prompt> current_design // 确认当前设计 Current design is 'Multiplier_Booth_STG_O'. (Multiplier_Booth_STG_0} prompt> current_design Datapath // 设置当前设计 Current design is 'Datapath'. {Datapath} Current design is 'Datapath'. prompt> current_instance . // 确认当前实例,注意点的添加 Current instance is the top-level of design 'Datapath'.

顺带一提,除了使用current_instance命令设置当前实例,current_instance变量也可以设置和查询当前实例,如下所示。

prompt> current_design // 确认当前设计 Current design is 'Multiplier_Booth_STG_O'. (Multiplier_Booth_STG_0} prompt> current_instance . // 确认当前实例,注意点的添加 Current instance is the top-level of design 'Multiplier_Booth_STG_0'. prompt> set current_instance M1 // 设置当前实例 Current instance is '/Multiplier_Booth_STG_0/M1'. /Multiplier_Booth_STG_0/M1 prompt> printvar current_instance // 直接查看变量值 current_instance = "/Multiplier_Booth_STG_0/M1"

当使用get_cells/report_cell等命令时,如果不指定对象作为参数,默认以当前实例为参数,如下所示。需要注意的是,即使是相对当前实例指定的get_cell命令,返回的对象名还是相对当前设计而言的。

prompt> current_design // 确认当前设计 Current design is 'Multiplier_Booth_STG_O'. (Multiplier_Booth_STG_0} prompt> current_instance . // 确认当前实例,注意点的添加 Current instance is the top-level of design 'Multiplier_Booth_STG_0'. prompt> report_cell // 报告当前实例内的单元 **************************************** Report : cell Design : Multiplier_Booth_STG_0 Version: W-2024.09-SP2 Date : Sat Apr 12 13:17:57 2025 **************************************** Attributes: b - black box (unknown) h - hierarchical n - noncombinational r - removable u - contains unmapped logic Cell Reference Library Area Attributes -------------------------------------------------------------------------------- M1 Datapath 0.000000 h, n, u M2 Controller 0.000000 h, n, u -------------------------------------------------------------------------------- Total 2 cells 0.000000 prompt> set current_instance M1 // 设置当前实例 Current instance is '/Multiplier_Booth_STG_0/M1'. /Multiplier_Booth_STG_0/M1 prompt> report_cell // 报告当前实例内的单元 **************************************** Report : cell Design : Multiplier_Booth_STG_0/M1 (Datapath) Version: W-2024.09-SP2 Date : Sat Apr 12 13:21:17 2025 **************************************** Attributes: b - black box (unknown) c - control logic h - hierarchical n - noncombinational r - removable s - synthetic operator u - contains unmapped logic Cell Reference Library Area Attributes -------------------------------------------------------------------------------- B_0 GTECH_BUF gtech 0.000000 c, u B_1 GTECH_BUF gtech 0.000000 c, u C128 *SELECT_OP_5.1_5.1_1 0.000000 s, u C129 *SELECT_OP_2.8_2.1_8 0.000000 s, u C130 *SELECT_OP_2.4_2.1_4 0.000000 s, u C131 *SELECT_OP_5.1_5.1_1 0.000000 s, u C132 *SELECT_OP_3.8_3.1_8 0.000000 s, u C142 GTECH_OR2 gtech 0.000000 c, u C143 GTECH_OR2 gtech 0.000000 c, u C144 GTECH_OR2 gtech 0.000000 c, u C147 GTECH_AND2 gtech 0.000000 c, u C148 GTECH_AND2 gtech 0.000000 c, u C150 GTECH_AND2 gtech 0.000000 c, u C152 GTECH_AND2 gtech 0.000000 c, u C153 GTECH_AND2 gtech 0.000000 c, u C154 GTECH_AND2 gtech 0.000000 c, u C156 GTECH_AND2 gtech 0.000000 c, u C157 GTECH_AND2 gtech 0.000000 c, u C158 GTECH_AND2 gtech 0.000000 c, u I_0 GTECH_NOT gtech 0.000000 u I_1 GTECH_NOT gtech 0.000000 c, u I_2 GTECH_NOT gtech 0.000000 c, u I_3 GTECH_NOT gtech 0.000000 c, u I_4 GTECH_NOT gtech 0.000000 c, u add_28_S2 *ADD_UNS_OP_8_8_8 0.000000 s, u multiplicand_reg[0] **SEQGEN** 0.000000 n, u multiplicand_reg[1] **SEQGEN** 0.000000 n, u multiplicand_reg[2] **SEQGEN** 0.000000 n, u multiplicand_reg[3] **SEQGEN** 0.000000 n, u multiplicand_reg[4] **SEQGEN** 0.000000 n, u multiplicand_reg[5] **SEQGEN** 0.000000 n, u multiplicand_reg[6] **SEQGEN** 0.000000 n, u multiplicand_reg[7] **SEQGEN** 0.000000 n, u multiplier_reg[0] **SEQGEN** 0.000000 n, u multiplier_reg[1] **SEQGEN** 0.000000 n, u multiplier_reg[2] **SEQGEN** 0.000000 n, u multiplier_reg[3] **SEQGEN** 0.000000 n, u product_reg[0] **SEQGEN** 0.000000 n, u product_reg[1] **SEQGEN** 0.000000 n, u product_reg[2] **SEQGEN** 0.000000 n, u product_reg[3] **SEQGEN** 0.000000 n, u product_reg[4] **SEQGEN** 0.000000 n, u product_reg[5] **SEQGEN** 0.000000 n, u product_reg[6] **SEQGEN** 0.000000 n, u product_reg[7] **SEQGEN** 0.000000 n, u sub_31_S2 *SUB_UNS_OP_8_8_8 0.000000 s, u -------------------------------------------------------------------------------- Total 46 cells 0.000000

有些命令只能在当前实例为当前设计时使用,如all_inputs/all_outputs等命令;有些命令需要配合current_instance命令使用才能完成某些效果,如create_cell/insert_buffer等命令。

current_instance命令

除了不带参数和使用当前实例下的层次单元作为参数,current_instance命令还可以接受其他类型的参数,就像Linux中的相对路径那样,可以接受.以表示当前实例和..表示上层实例,如下所示。

prompt> current_design // 确认当前设计 Current design is 'Multiplier_Booth_STG_O'. (Multiplier_Booth_STG_0} prompt> current_instance . // 确认当前实例,注意点的添加 Current instance is the top-level of design 'Multiplier_Booth_STG_0'. prompt> current_instance ./M1 // 设置当前实例,与current_instance M1等价 Current instance is '/Multiplier_Booth_STG_0/M1'. /Multiplier_Booth_STG_0/M1 prompt> current_instance .. // 设置当前实例 Current instance is the top-level of design 'Multiplier_Booth_STG_0'. prompt> current_instance ../../../M1 // 设置当前实例 Current instance is '/Multiplier_Booth_STG_0/M1'.

上例还有两点细节可以注意:1、参数末尾加不加/效果相同(2021版本后支持),这与Linux中作为参数的目录类似;2、如果索引超出了当前设计,则视为当前设计。

类似概念

在低功耗设计(UPF)中也存在类似当前实例的概念,叫做当前范围(Current Scope),使用set_scope命令可以设置当前范围,实际上使用本文的current_instance命令和current_instance变量也可以设置当前范围,它们之间的差别很小。

http://www.jsqmd.com/news/1353965/

相关文章:

  • MySQL转SQLite的3步解决方案:免费在线工具完全指南
  • 光伏电站智能安防监控系统解决方案:全方位防护+高效运维
  • 大数据架构演进:挑战、解决方案与实战案例
  • 基于FPGA的Game Boy Color硬件复刻:从原理到实践的完整指南
  • 想在成都找靠谱全案设计?一木匠心深耕本地机构别错过 - 品牌品鉴馆
  • 2026年宁波传祺M8改装哪家售后好 金利得实测解析 - 奔跑123
  • 基于FastAPI与SQLAlchemy构建轻量级用户反馈收集与分析系统
  • 达林顿晶体管:原理、应用与选型指南
  • 基于LoRA与ControlNet实现AI角色一致性生成:从原理到实战
  • LFM2.5-2.6B-5bit模型震撼发布:MLX社区首款多语言文本生成利器,5bit量化技术如何突破边缘设备性能瓶颈?
  • 革命性DNA调控元件预测工具Malinois:从序列到细胞活性的终极指南
  • 实测!Karmem与Flatbuffers性能对比:10倍速度提升背后的技术秘密
  • BPfold论文精读:碱基对基序能量如何推动RNA结构预测进入深度学习时代
  • 吴中区防坠落安全绳厂家加推,高空作业安全绳厂家哪家好?2026避坑指南:6个挑选要点,绕开90%的坑 - geo88
  • 汇川H5U PLC远程IO配置:从硬件连接到地址映射的实战指南
  • DDrawCompat:三步解决经典DirectX游戏兼容性问题的终极方案
  • 三菱PLC与信捷触摸屏通信配置实战:从原理到调试避坑指南
  • 解读Malinois输出结果:K562、HepG2和SK-N-SH细胞系活性值的生物学意义
  • 嘉兴热门化妆摄影培训学校盘点知美人学校零基础学化妆参考 - 港焙西点-知美人美学
  • G-Helper启动故障终极解决指南:从快速修复到深度排查
  • Win11系统Java环境配置全攻略:从JDK安装到多版本管理
  • JavaScript中Cannot read properties of undefined错误的深度解析与调试实战
  • Agent Skills设计指南:从核心原理到实战落地,构建AI智能体“动手能力”
  • Godot 4 GDExtension开发指南:从C++模块集成到高性能游戏扩展
  • 10分钟掌握开源AI视频平台:Open Generative AI完全指南
  • 5个高效技巧:掌握HCA音频解码工具的完整指南
  • 2026年高性价比|珠海耐用的汽车贴膜(贴车衣、汽车改装)哪家好?膜一姐(珠海店)口碑靠前效果绝佳不踩坑! - 汽车新知百晓生
  • 大数运算核心原理与实现:从溢出问题到高精度计算实战
  • 国家统计局宏观经济数据采集:OpenClaw 定时抓取公开经济指标,生成行业趋势分析报表
  • 基于MCP协议与AI技能实现Linear变更日志自动化生成