derek8955
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    5
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Synthesis Flow ###### tags: `Digital IC Design` [回到主頁面](https://hackmd.io/@derek8955/BkK2Nb5Jo/https%3A%2F%2Fhackmd.io%2FdpcBlBL8TlShpQ-wSi9Quw) :+1: design compiler 的指令使用的是 [tcl](http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html) 語言,有興趣的可以先去看一下 ### <font color="blue"> Brief introduce to synthesis flow </font> ![](https://i.imgur.com/eYNThO4.png) ### <font color="blue"> Detail of synthesis flow </font> <font color="orange">1. 準備 HDL code </font> synthesizable code <font color="orange">2. Specify Libraries </font> 設定於 .synopsys_dc.setup 這個 file 中(前面的句點代表這個檔案是隱藏檔) - Symbol library : 提供 design compiler 具有 symbol view 的功能 - Synthetic library: 即 design ware library。在初始化 DC 時,會自動 include DesignWare library 中的 standard.sldb,這個 library 用於實現 verilog 描述的運算子(例如 +, -, *, / ),先轉換至性能較差的電路。若要性能比較好的電路,我們再額外填入 dw_foundation.sldb , DC 再幫我們替代 > 結論 : Synthetic library is for optimization purposes - link library : 設計中不可避免的要用到一些合作廠商的 hard IP,這些IP並不是 designer 設計的而是直接例化( [instantiation](https://hackmd.io/DUc5Ud-4Sg-OmIbTjeavOw) )使用。在合成的過程中並不希望 DC 把這些模型轉換為 standard cell,所以就需要用到 link library,link library 就是告訴 DC 這些 IP 不用你合成,直接調用 link Library 的 lib 即可 - target library : 即 technology library,由 ASIC vendor 提供(台積電、聯電)。在合成的最後一步,將先前的 GTECH library mapping 成 target library。 > DC 就是根據 target library 中給出的 delay 資訊來計算 path delay <font color="orange">3. Read Design </font> ```tcl= analyze -f verilog $DESIGN\.v elaborate $DESIGN current_design $DESIGN ``` > 讀檔後, design compiler 會檢查 RTL code 是否有誤,所以可以在 terminal 上觀察是否有 LATCH <font color="orange">4. Setting Design Environment </font> |![](https://i.imgur.com/7A5QzJm.png)| |:---:| |Design environment| |![](https://i.imgur.com/mbbZRNj.png)| | Script of design compiler | - Operating Conditions : 模擬 PVT( Process, Voltage, Temperature ) 改變後對電路的影響 > 製程提供了三種情況 best case( fast )、typical case、worst case( slow ),一般 worst case 必須為最先考慮的 - Wire Load Model : 預測線路之間的 RC 效應 > net delay 是根據 wire load model 所決定 - System Interface : 模擬自己的 design 與其他外部的關係 - set_drive : drive characteristics for input ports. - set_fanout_load : fanout loads on output ports. - set_load : loads on input and output ports. - set_driving_cell : 外部的驅動電路 <font color="orange">5. Setting Design Constraints </font> - Design Rule Constraints - Design Optimization constraints ( 使用者自定義 speed, area ) :::warning #### Design Rule Constraints 1. set_max_capacitance : 定義 output pin 可以驅動的最大負載電容 2. set_max_transition : 定義轉態時間的最大容忍值 3. set_fanout_load, set_max_fanout : 直接看例子 Input pins have **fanout_load** attribute( load they place on driving nets ) Output pins have **max_fanout** attribute( max load they can drive ) ![](https://i.imgur.com/mnN33TS.png) 注意: max_fanout( 7 ) 必須大於或等於 total fanout load ( 1.0 + 3.0 + 2.0 = 6 ) , 如果沒辦法達成就得依靠 buffer 幫助提高 driving 能力或者替代成更強的 driving cell, max_fanout constraint 就可以設更大 :computer: set_ideal_network : 因為有些情況下 transition time or capacitance 必須 assign 0,可以透過這個 command 設定。例如 clock 訊號,一般在合成時不會處理,等到 APR 才做 clock tree synthesis ::: :::info #### Design Optimization constraints - create_clock : 設定電路的 clock period - set_clock_latency - clock source latency: clk source 到 clk definition point - clock network latency: clk definition point 到 FF 的 clock pin > latency(延遲) : 處理 1 個 operation 需要花的時間 > throughput(吞吐量) : 單位時間內可以執行幾次 operation > > 舉例: 一間農場專門製造牛奶,製造一罐牛奶需要3小時,整個生產線一天可以製造80罐。 latency 則為 3 小時, throughput 為1天80罐 |![](https://i.imgur.com/OBmN6rQ.png)|![](https://i.imgur.com/vLtHPyb.png)| |:---:|:---:| |Clock latency|Clock jilter| - set_clock_jitter : 與真實事件的理想時間的誤差,通常是受到訊號干擾,如 crosstalk...等(synthesis 沒有這個指令,通常會加到 clock_uncertainty內) - set_clock_uncertainty : 解決 Pre-CTS前的 clock skew - clock skew : 電路中有些 FF 與 clock source 距離比較近,有些則比較遠。但 net 上都會有一些的電阻存在,導致每顆 FF 收到的 clock 訊號都有些許的誤差,我們稱這個誤差為 clock skew (Pre-CTS: uncertainty = margin + skew) (Post-CTS: uncertainty = margin ) - set_input_delay / set_output_delay:模擬 前一級/後一級 別人的 IP ```tcl= set t_in Tclk2q + Tc1 set_input_delay $t_in -clock clk [all_inputs] ``` ```tcl= set t_out Tsetup + Tc2 set_output_delay $t_out -clock clk [all_outputs] ``` |![](https://i.imgur.com/HVYGKfl.png)| |:---:| |Condition of input delay| |![](https://i.imgur.com/vhmSstF.png)| |Condition of ouput delay| > set_max_delay:如果電路中沒有 clock signal 使用此 command( 純組合電路 ) > set_fix_hold:跟 DC 說請幫忙修復 hold time violation。但通常不在合成做這件事 ::: <font color="orange">6. Select Compile Strategy </font> - Top-down Compile : 把 top module design 與 submodule 攤開來,一併合成,對 DC 來說可以一次看到所有的 design ,最後出來的 performance 會比較棒。但這跟做法比較耗時 - Bottom-up Compile : 從子電路開始合成,一路到 Top module - Mixed Compile : 手動指定哪塊電路要 Top-down 還是 Buttom-up <font color="orange">7. Optimize the design </font> 這一步要開始 compile,轉換 RTL code 至 netlist. 在 compile之前,由於我們在寫電路的時候,常常會在 module 內部 call 很多次 submodule,所以我們要先解決 multiple instance的問題。DC 內建提供了三種方式來解決: |![](https://i.imgur.com/FhHVXjG.png)| |:---:| | Multiple instance of cell | :::warning #### multiple instance of a design reference |![](https://i.imgur.com/dr12SHa.png)|![](https://i.imgur.com/I45N62z.png)|![](https://i.imgur.com/oikRGfu.png)| |:---:|:---:|:---:| |uniquify|set_dont_touch|ungroup| - uniquify:每個 submodule 獨立出來 > 這個方法需要更多 compile 的時間 - set_dont_touch {U2/U3 U2/U4}: 同個 submodule 只 compile 一次,之後有相同的 submodule 直接 reference - ungroup {U3 U4}:直接把 submodule 打散 > performance 最好,但它是這三種方法中最耗時、最吃記憶體) ::: - compile : Default sythesis algorithm. - compile_ultra : 有點像 ungroup 在做的事,把電路的 hierarchy 打散。所以這種方法當然 performance 更好,但更吃記憶體與耗時 <font color="orange"> 8. Analyze </font> |![](https://i.imgur.com/R7F1XJG.png)|![](https://i.imgur.com/WIaqBP6.png)| |:---:|:---:| |report area|report timing| - report_area: - Total cell area : 所有 cell 的面積 - Total area:net area + total cell area > 在合成階段還未實際繞線,net area 則是透過 wire load model 初估而成(非常不准),所以一般我們合成完只看 total cell area - report_timing : check slack 是不是 non-negative(MET) > “slack” = 電路所需時間 (required time) 減實際到達時間 (arrival time) > design compiler default 只會顯示一條 critical path ( 最花時間的 path ) <font color="orange"> 9. Save Design </font> - gate level verilog file(.v):儲存 gate level netlist - standard delay format(.sdf):記載 線路/cell 的 delay - synopsys deisgn constraint(.sdc): APR 需要知道我們在 design compiler 中都打了什麼 delay constraint > 前面有說 synthesis = translate + optimization + mapping,可以想想 translate/optimization/mapping 分別對應到什麼 command ### <font color="blue"> Reference Image </font> [1~2] https://www.eng.auburn.edu/~nelson/courses/elec5250_6250/slides/LogicSynthesis.pdf [3] https://blogs.cuit.columbia.edu/zp2130/clock_tree_latency_skew_uncertainty/ [4] https://pro.focusrite.com/what-is-jetpll [5~8] https://slideplayer.com/slide/3478219/ [待補] 1. set_multicycle_path

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully