# Design Compiler ## 1. 介紹 > [!Note] **Design Compiler** > - **將寫好的 ==RTL Code== 模擬測試完後,下一步為 ==合成 (Synthesis)==** > - **==合成== 會將 ==RTL Code== 從 ==行為描述== 轉換成 ==Gate Level 電路==** > - **合成後的 ==Gate== 來自 ==標準 cell library==,==(ex:tsmc18.db)==** > - **這些 ==Gate== 為 實際電路 會使用的 ==實體元件==,具有 ==Delay== 等參數** ## 2. 合成指令 (==dc_shell==) > [!Tip] **合成電路前需要準備** > - **==`.tcl` 檔==:為合成電路的 ==執行腳本== 檔案** > - **==`.sdc` 檔==:為合成電路的 ==限制條件== 設定** > [!Important] **合成指令** > - **開啟 ==dc_shell== > 執行腳本 ==dc_syn.tcl== > 並將 ==報告== 輸出到 ==syn.log==** >> ```robotframework >> dc_shell -f dc_syn.tcl | tee syn.log >> ``` ## 3. 執行腳本 ==`.tcl` file== #### [● dv.4 (Compiler & Save) <i class="ph ph-arrow-square-out"></i>](http://hackmd.io/@C2N2/HJO6fiILlg) --- > [!Important] **`line 1` ~ `line 5`** > - **設定要 ==合成== 的 ==原始程式檔== (可能有==多個檔案==)** > - **設定 ==Top module== 為哪個 ==module==** > - **設定要 ==連結== 的 ==Library==** > ```bash= > #Read All Files > read_file -format verilog geofence.v > #read_file -format sverilog geofence.v > current_design geofence > link > ``` --- > [!Important] **`line 7` ~ `line 12`** > - **設定要 ==讀入== 的 ==`.sdc` 設定檔==** > - **檢查 ==RTL Code== 有無語法錯誤** > - **一些 ==電路設定==** > ```bash=7 > #Setting Clock Constraints > source -echo -verbose geofence.sdc > check_design > set high_fanout_net_threshold 0 > uniquify > set_fix_multiple_port_nets -all -buffer_constants [get_designs *] > ``` --- > [!Important] **`line 14` ~ `line 17`** > - **==合成電路== 指令** > - **可以設定 ==合成的品質==** > - **品質選項:==`low`==、==`medium`==、==`high`==,預設為 ==`medium`==** > - **`-map_effort`:控制合成時,的 ==最佳化程度==** > - **ex:設定==最小 delay==、==最小 area==** > - **`-area_effort`:控制 ==總體面積== 的 ==最佳化程度==** > ```bash=14 > #Synthesis all design > #compile -map_effort high -area_effort high > #compile -map_effort high -area_effort high -inc > compile > ``` --- > [!Important] **`line 19` ~ `line 21`** > - **設定合成結束後的 ==輸出檔案==** > - **`.ddc`:合成後電路的的 ==設計專案檔==** > - **包含整個設計的 ==邏輯結構==、==單元==、==時序==、==限制==、==層次資訊== ...** > - **`.sdf`:(Standard Delay Format, 標準延遲格式檔)** > - **包含合成後電路的 ==cell delay==、==net delay==、==setup/hold== 等 ==timing 資訊==** > - **`.v` :合成後電路的 ==Gate Level 程式碼==** > ```bash=19 > write -format ddc -hierarchy -output "geofence_syn.ddc" > write_sdf -version 1.0 geofence_syn.sdf > write -format verilog -hierarchy -output geofence_syn.v > ``` --- > [!Important] **`line 22` ~ `line 27`** > - **設定合成結束後的 ==輸出報告==** > - **report_area:顯示 ==整體面積==** > - **report_timing:顯示 ==timing 是否達標==** > - **report_qor:==綜合品質報告==** > ```bash=22 > report_area > area.log > report_timing > timing.log > report_qor > geofence_syn.qor > > report_area > report_timing > ``` --- ## 4. 限制條件 ==`.sdc` file== #### [● dv.2 (Design Condition) <i class="ph ph-arrow-square-out"></i>](http://hackmd.io/@C2N2/rkjnZj8Ulg) #### [● dv.3 (Design Environment) <i class="ph ph-arrow-square-out"></i>](http://hackmd.io/@C2N2/rk8C-s88xe) --- ## 5. Report Log ### (1) Area Report 關注內容 > [!Tip] **Total Cell Area** > - **用途:真實 ==邏輯閘元件== 的 ==面積總和==** > - **`Total Cell Area = Total Area - Net Interconnect Area`** > - **數值異常:檢討整體 ==設計結構== (功能分層 / 重複邏輯)** --- > [!Tip] **Combinational Area** > - **用途:評估 ==邏輯複雜度==** > - **數值異常:調整 ==組合邏輯== 的 ==描述==** > [!Tip] **Noncombinational Area** > - **用途:評估 ==暫存器使用量==** > - **數值異常:優化 ==reg 資料處理== 的 ==方式==** > [!Tip] **Buf / Inv Area** > - **用途:評估 ==驅動== 與 ==緩衝器== 用量** > - **數值異常:==檢查 assign 驅動== 的 ==描述==** > [!Tip] **Macro / Black Box Area** > - **用途:表示 ==未合成== 或 ==未展開== 的模組** > - **數值異常:提供 ==cell library== 以完成合成** > [!Tip] **Net Interconnect Area** > - **用途:代表 ==連線複雜度==,影響實體設計布局** > - **數值異常:檢查 ==wireload model==、==模組分布結構==** --- > [!Tip] **Number of Cells / Ports / Nets** > - **用途:評估 ==邏輯規模==,會影響 ==STA== / ==功耗== / ==模擬效能==** > - **數值異常:精簡 ==模組==、==訊號線== 數量** > [!Tip] **Number of References** > - **用途:使用的 ==cell 類別總數==** > - **==太多== → 難布局** > - **==太少== → 最佳化空間有限** ### (2) Timing Report 關注內容 > [!Tip] **Slack** > - **用途:代表訊號通過,距離時脈結束的 ==剩餘時間==** > - **`Slack = Required Time – Arrival Time`** > - **`Slack < 0` 代表 ==時序錯誤==** > - **數值異常:找到 ==`某個 Path > Required Time` 的訊號==** > **重新 ==分割邏輯== 或加 ==pipeline==** > [!Tip] **Data Arrival Time** > - **用途:訊號 ==到達目的地== 的 ==需求時間==** > - **數值異常:`Slack < 0`** > [!Tip] **Required Time** > - **用途:訊號 ==最晚== 的 ==到達時間==** > - **數值異常:`Slack < 0`** --- > [!Tip] **Path** > - **用途:代表從 ==起點== 到 ==輸出訊號== 的 ==delay 總和==** > - **數值異常:`Path > Required Time`** > [!Tip] **Clock Skew / Latency / Uncertainty** > - **用途:時脈 ==傳遞延遲== 與 ==不確定性==** > - **數值異常:** --- ## ● Conmand :::spoiler **`.tcl` file** ```bash= #Read All Files read_file -format verilog geofence.v #read_file -format sverilog geofence.v current_design geofence link #Setting Clock Constraints source -echo -verbose geofence.sdc check_design set high_fanout_net_threshold 0 uniquify set_fix_multiple_port_nets -all -buffer_constants [get_designs *] #Synthesis all design #compile -map_effort high -area_effort high #compile -map_effort high -area_effort high -inc compile write -format ddc -hierarchy -output "geofence_syn.ddc" write_sdf -version 1.0 geofence_syn.sdf write -format verilog -hierarchy -output geofence_syn.v report_area > area.log report_timing > timing.log report_qor > geofence_syn.qor report_area report_timing ``` ::: --- :::spoiler **`.sdc` file** ```bash= # operating conditions and boundary conditions # set cycle 10.0 create_clock -name clk -period $cycle [get_ports clk] set_dont_touch_network [all_clocks] set_fix_hold [all_clocks] set_clock_uncertainty 0.1 [all_clocks] set_clock_latency 0.5 [all_clocks] set_ideal_network [get_ports clk] #Don't touch the basic env setting as below set_input_delay 0 -clock clk [remove_from_collection [all_inputs] [get_ports clk]] -clock_fall set_output_delay 0 -clock clk [all_outputs] -clock_fall set_load 1 [all_outputs] set_drive 0.1 [all_inputs] set_operating_conditions -max_library slow -max slow set_wire_load_model -name tsmc090_wl10 -library slow set_max_fanout 20 [all_inputs] ``` ::: ---
×
Sign in
Email
Password
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