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

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

相关阅读

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


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

相对路径

        使用相对路径来访问设计对象时,该对象必须位于当前设计(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"

        当使用report_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 - hierarchicaln - noncombinationalr - removableu - contains unmapped logicCell                      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 logich - hierarchicaln - noncombinationalr - removables - synthetic operatoru - contains unmapped logicCell                      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

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、参数末尾加不加/效果相同,这与Linux中作为参数的目录类似;2、如果索引超出了当前设计,则视为当前设计。

类似概念

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


http://www.mrgr.cn/news/98139.html

相关文章:

  • 多线程(Java)
  • Ubuntu 系统深度清理:彻底卸载 Redis 服务及残留配置
  • 第十六届蓝桥杯省赛JavaB组题解
  • cdp-(Chrome DevTools Protocol) browserscan检测原理逆向分析
  • LINUX基础 [二] - Linux常见指令
  • 【STM32】ST7789屏幕驱动
  • 2025届蓝桥杯JavaB组个人题解(题目全)
  • 【前端小技巧】实现详情页滚动位置记忆,提升用户体验
  • 02-MySQL 面试题-mk
  • simpy仿真
  • 第十六届蓝桥杯大赛软件赛省赛 Python 大学 B 组 部分题解
  • ChatRex: Taming Multimodal LLM for Joint Perception and Understanding 论文理解和翻译
  • 电感、互感器、变压器和磁珠综合对比——《器件手册--电感/线圈/变压器/磁珠篇》
  • 如何优化多线程上下文切换?
  • Webpack中的文件指纹:给资源戴上个“名牌”
  • ”插入排序“”选择排序“
  • 【unity游戏开发介绍之UGUI篇】UGUI概述和基础使用
  • 蓝桥杯嵌入式考前模块总结
  • 四月第二周C++,信息学,洛谷,字符串
  • STM32HAL库学习笔记