发布时间:2026/8/8 16:55:41
SDC命令详解:使用相对路径访问设计对象(current_instance命令) 相关阅读SDC命令详解https://blog.csdn.net/weixin_45791458/category_12931432.html?spm1001.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变量也可以设置当前范围它们之间的差别很小。

相关新闻

2026/8/8 16:55:41

机器学习模型创建与调用全流程:从数据准备到生产部署

1. 从零到一:理解模型创建与调用的核心脉络在任何一个涉及数据驱动或智能化的项目中,模型的创建与调用都是承上启下的关键一步。它既不是凭空而来的魔法,也不是一蹴而就的代码堆砌。简单来说,创建模型,就是基于你的业务…

2026/8/8 16:50:40

Python图像处理实战:Pillow库核心功能与应用

1. 为什么选择Python处理计算机图形学?十年前我第一次接触计算机图形处理时,用的还是C和OpenGL。直到2015年一个图像批处理项目让我发现了Pillow这个宝藏库,从此Python成了我的图形处理主力工具。Pillow作为PIL(Python Imaging Li…

2026/8/8 18:00:45

AI科技热点日报 | 2026年8月7日

文章目录AI科技热点日报 | 2026年8月7日📌 今日摘要一、大模型军备赛:参数规模再上台阶事件概要事件概要来源 / Sources二、AI 商业化兑现:阿里 Qwen 分成机制与宇树科技 IPO事件概要事件概要来源 / Sources三、智能体进入 L3 时代&#xff1…

2026/8/7 19:43:11

如何用免费工具突破游戏窗口限制:SRWE完整使用指南

如何用免费工具突破游戏窗口限制:SRWE完整使用指南 【免费下载链接】SRWE Simple Runtime Window Editor 项目地址: https://gitcode.com/gh_mirrors/sr/SRWE 你是否遇到过这样的困扰?想为心爱的游戏截图,却发现游戏不支持自定义分辨率…

2026/8/8 0:04:22

Java图像处理实战指南

要执行这些 Java AWT 图像处理程序,你需要将它们分别保存为独立的 .java 文件,并使用 javac 编译,然后使用 java 运行。以下是每个程序的核心执行步骤、依赖关系和要点。 通用执行步骤 保存文件:将每个 listing 的代码复制到文本…

2026/8/8 0:04:23

昇腾AI代理实现多号通话自动化

基于昇腾(Ascend)硬件与AtomGit AI社区的开源生态,结合AI Agent技术,可以实现一个模拟“通话重复使用机号复制”功能的安卓手机应用原型。其核心是利用AI Agent进行意图理解、任务编排和自动化操作,模拟或管理多号码的…

2026/8/8 0:04:23

2026年Graph+AI Agents最新创新思路

本次围绕GraphAI Agents这个方向筛选了15篇高质量论文,都是近年来具有较高引用价值或方法创新的研究工作,其中部分来自IJCAI、AAAI、ICRA。 对于论文er来说,这些论文方法结构清晰、可复现性较强,在多个任务上都有可延展的空间。如…

2026/8/7 9:44:18

实测才敢推 AI论文网站 2026最新测评与推荐

2026年真正好用的AI论文网站,核心看生成的论文质量、低AI味、格式正确、学术适配四大指标。综合实测,千笔AI、ThouPen、豆包、DeepSeek、Grammarly 是当前最值得推荐的梯队,覆盖从免费到付费、从中文到英文、从文科到理工的全场景需求。一、综…

2026/8/7 19:03:32

2026必备!AI论文网站测评:最新推荐与深度对比

2026年真正好用的AI论文网站,核心看生成的论文质量、低AI味、格式正确、学术适配四大指标。综合实测,千笔AI、ThouPen、豆包、DeepSeek、Grammarly 是当前最值得推荐的梯队,覆盖从免费到付费、从中文到英文、从文科到理工的全场景需求。 一、…

2026/8/8 2:17:42

摆脱论文困扰!盘点2026年全网爆红的的AI论文写作工具

一天写完毕业论文在2026年已不再是天方夜谭。2026年最炸裂、实测能大幅提速的AI论文写作工具,覆盖选题构思、文献整理、内容生成、格式排版等核心场景,真正帮你高效搞定论文难题。 一、全流程王者:一站式搞定论文全链路(一天定稿首…