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'.

? ? ? ? 需要注意的是,如果使用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.pswp.cn/bicheng/76632.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/76632.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/76632.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【問題記錄】記錄2個安裝Centos/Anolis系統卡死在安裝包階段的問題?(硬盤分區?換設備)

背景 問題就不詳細記錄了,本文記錄的是Centos/Anolis安裝中卡主的問題。這個問題遇到過幾十次了,嘗試過各種方法。最近一個偶然因素找到了原因。然后翻看歷史上出現這個問題的照片居然是相同的地方卡死。。。 有點意思。特此記錄,希望未來遇…

微信小程序中的openid的作用

微信小程序中的openid的作用 引言 在當今數字化時代,用戶體驗成為了產品成功與否的關鍵因素之一。微信小程序作為連接用戶與服務的重要橋梁,在提升用戶體驗方面發揮著重要作用。其中, openid(開放身份標識符)是微信小…

《Python星球日記》第25天:Pandas 數據分析

名人說:路漫漫其修遠兮,吾將上下而求索。—— 屈原《離騷》 創作者:Code_流蘇(CSDN)(一個喜歡古詩詞和編程的Coder😊) 訂閱專欄:《Python星球日記》 目錄 一、引言二、數據分組與聚合1. 分組操…

分布式系統-腦裂,redis的解決方案

感謝你的反饋!很高興能幫到你。關于你提到的“腦裂”(split-brain),這是一個分布式系統中的常見術語,尤其在像 Redis Cluster 這樣的高可用集群中會涉及。既然你問到了,我會從頭解釋“腦裂”的含義、Redis …

重構藝術 | 如何優雅地“提煉函數“

在工作中總數遇到非常多的長代碼,俗稱“屎山”,這類代碼讀起來特別費勁。自己想重構一遍,但是總感覺缺乏經驗指導,因此,多讀書,讀好書可能是最優解之一。讀《重構改善即有代碼的設計》有感,便寫…

每天學一個 Linux 命令(13):touch

Linux 文件管理命令:touch touch 是 Linux 中一個簡單但高頻使用的命令,主要用于創建空文件或修改文件的時間戳(訪問時間、修改時間)。它是文件管理和腳本操作的實用工具。 1. 命令作用 創建空文件:快速生成一個或多個空白文件。更新時間戳:修改文件的訪問時間(Access …

STM32HAL庫學習筆記

目錄 定時器 一些小細節 輸入捕獲計算信號頻率 輸入捕獲計算占空比與頻率 使用定時器不改變占空比的同時改變頻率的方法 串口 重定向原理 重定向代碼 怎么從串口接收到的字符串數據中解析出float型的數據 strchr sscanf memset 第一種實現方法 RTC實時時鐘 LCD顯…

Docker 鏡像、容器與數據卷的高效管理:最佳實踐與自動化腳本20250411

Docker 鏡像、容器與數據卷的高效管理:最佳實踐與自動化腳本 引言 在現代軟件開發中,容器化技術正變得越來越重要。Docker 作為容器化的代表工具,在各大企業中得到了廣泛的應用。然而,隨著容器化應用的增多,如何高效…

Selenium之Actions事件

鼠標、鍵盤組合鍵 在使用selenium的時候,有的時候我們需要鼠標單擊、雙擊、拖動;或者是按下鍵盤的某個鍵,松開某個按鍵,以及組合鍵的使用;今天我們就來看一看,怎么樣實現上面的操作 先把準備工作做好&…

如何在 CentOS 7 系統上以容器方式部署 GitLab,使用 ZeroNews 通過互聯網訪問 GitLab 私有倉庫,進行代碼版本發布與更新

第 1 步: 部署 GitLab 容器? 在開始部署 GitLab 容器之前,您需要創建本地目錄來存儲 GitLab 數據、配置和日志: #創建本地目錄 mkdir -p /opt/docker/gitlab/data mkdir -p /opt/docker/gitlab/config mkdir -p /opt/docker/gitlab/log#gi…

.py文件和.ipynb文件的區別:完整教程

一、概述 Python開發者常用的兩種文件格式.py和.ipynb各有特點,本教程將通過對比分析、代碼示例和場景說明,幫助開發者全面理解二者的區別與聯系。 二、核心區別對比 1. 文件格式本質 特性.ipynb文件.py文件文件類型JSON結構化文檔純文本文件存儲內容…

Go 字符串四種拼接方式的性能對比

簡介 使用完整的基準測試代碼文件,可以直接運行來比較四種字符串拼接方法的性能。 for 索引 的方式 for range 的方式 strings.Join 的方式 strings.Builder 的方式 寫一個基準測試文件 echo_bench_test.go package mainimport ("os""stri…

從代碼學習深度學習 - Bahdanau注意力 PyTorch版

文章目錄 1. 前言為什么選擇Bahdanau注意力本文目標與預備知識2. Bahdanau注意力機制概述注意力機制簡述加性注意力與乘性注意力對比Bahdanau注意力的數學原理與流程圖數學原理流程圖可視化與直觀理解3. 數據準備與預處理數據集簡介數據加載與預處理1. 讀取數據集2. 預處理文本…

19【動手學深度學習】卷積層

1. 從全連接到卷積 2. 圖像卷積 3. 圖形卷積代碼 互相關操作 import torch from torch import nn from d2l import torch as d2ldef corr2d(X, K):"""計算2維互相關運算"""h, w K.shapeY torch.zeros((X.shape[0]-h1, X.shape[1]-w 1))for …

Linux xorg-server 解析(一)- 編譯安裝Debug版本的xorg-server

一:下載代碼 1. 配置源,以Ubuntu24.04 為例( /etc/apt/sources.list.d/ubuntu.sources): 2. apt source xserver-xorg-core 二:編譯代碼 1. sudo apt build-dep ./ 2. DEB_BUILD_OPTIONS="nostrip" DEB_CFLAGS_SET="-g -O0" dpkg-buildpac…

大模型SFT用chat版還是base版 SFT后災難性遺忘怎么辦

大模型SFT用chat版還是base版 進行 SFT 時,基座模型選用 Chat 還是 Base 模型? 選 Base 還是 Chat 模型,首先先熟悉 Base 和 Chat 是兩種不同的大模型,它們在訓練數據、應用場景和模型特性上有所區別。 在訓練數據方面&#xf…

【圖像生成之21】融合了Transformer與Diffusion,Meta新作Transfusion實現圖像與語言大一統

論文:Transfusion: Predict the Next Token and Diffuse Images with One Multi-Modal Model 地址:https://arxiv.org/abs/2408.11039 類型:理解與生成 Transfusion模型?是一種將Transformer和Diffusion模型融合的多模態模型,旨…

動態多目標進化算法:基于知識轉移和維護功能的動態多目標進化算法(KTM-DMOEA)求解CEC2018(DF1-DF14)

一、KTM-DMOEA介紹 在實際工程和現實生活中,許多優化問題具有動態性和多目標性,即目標函數會隨著環境的變化而改變,并且存在多個相互沖突的目標。傳統的多目標進化算法在處理這類動態問題時面臨著一些挑戰,如收斂速度慢、難以跟蹤…

部署NFS版StorageClass(存儲類)

部署NFS版StorageClass存儲類 NFS版PV動態供給StorageClass(存儲類)基于NFS實現動態供應下載NFS存儲類資源清單部署NFS服務器為StorageClass(存儲類)創建所需的RBAC部署nfs-client-provisioner的deployment創建StorageClass使用存儲類創建PVC NFS版PV動態供給StorageClass(存儲…

Vue使用el-table給每一行數據上面增加一行自定義合并行

// template <template><el-table:data"flattenedData":span-method"objectSpanMethod"borderclass"custom-header-table"style"width: 100%"ref"myTable":height"60vh"><!-- 訂單詳情列 -->&l…