# dv.3 (Design Environment) ###### Previous:[dv.2 (Design Condition)](/@C2N2/rkjnZj8Ulg) ###### Next:[dv.4 (Compiler & Save)](/@C2N2/HJO6fiILlg) --- #### ● [Synopsys Design Constraints (.sdc) <i class="ph ph-arrow-square-out"></i>](http://hackmd.io/@C2N2/rkrVNgYLxe) > [!Note] **Design Environment:分析模式、驅動、負載、I/O 介面、Library** > 1. [Operating Condition](#1-操作條件-Operating-Condition) > - **Minimum operating condition** > - **Maximum operating condition** > 2. [Driving Cell](#2-驅動元件-Driving-Cell) > - **Clocks driving cell** > - **Inputs driving cell** > 3. [Output-Load](#3-輸出負載-Output-Load) > - **Capacitive load** > 4. [Input & Output Delay](#4-輸入-amp-輸出延遲-Input-amp-OutputnbspDelay) > - **Minimum rise/fall delay** > - **Maximum rise/fall delay** > 5. [Wire Load Model](#5-線路負載模型-Wire-Load-Model) > 6. [Check & Check & uniquify Design](#6-Check-amp-uniquify-Design) --- ## 1. 操作條件 (Operating Condition) ### (1) 使用圖形介面操作 1. **開啟設定視窗:==Attributes== > ==Operating Environment== > ==Operating Conditions==** <iframe src="https://drive.google.com/file/d/1-JJqr-WVeP4vB7c9XoOHMuHPgwFpgBvb/preview" height="300"></iframe> 2. **設定操作條件:==選擇分析種類== > ==選擇分析條件==** > [!Tip] **Single** > **在 某個 ==製程(PVT) 情況== 下做 ==電路模擬== / ==分析==** > [!Tip] **Min/max case** > **在 ==最好== / ==最壞== 的 2 種 ==製程(PVT) 情況== 下做 ==電路模擬== / ==分析==** <iframe src="https://drive.google.com/file/d/1i5oSF3QS3dsSO5Q6-1_0PCcdgClNUJEd/preview" height="300"></iframe> ### (2) 使用 CMD 操作 > [!Important] **設定內容** > - **設定 ==操作條件==:`set_operating_conditions`** > - **電路操作在 ==最快情況 (`min`)== 下的電路分析** > - **使用 ==最好的製程== 的 ==library==:`-min_library fast`** > - **操作在 ==最好的環境== (ex:高電壓、低溫):`-min fast`** > - **電路操作在 ==最慢情況 (`max`)== 下的電路分析** > - **使用 ==最差的製程== 的 ==library==:`-max_library slow`** > - **操作在 ==最差的環境== (ex:低電壓、高溫):`-max slow`** > > ```sdc= > > set_operating_conditions -min_library fast -min fast -max_library slow -max slow > > ``` ## 2. 驅動元件 (Driving Cell) > [!Important] **設定內容** > - **==clk== 的 ==驅動源== 設定** > - **設為 ==最差製程== 中的某顆 ==buffer `BUFX4`== 的 ==輸出 `Y`==** > - **除 ==clk 外== 的 ==驅動源== 設定** > - **設為 ==最差製程== 中的某顆 ==D-flip-flop `DFFX1`== 的 ==輸出 `Q`==** > > ```sdc= > > set_driving_cell -library slow -lib_cell BUFX4 -pin {Y} [get_ports clk] > > set_driving_cell -library slow -lib_cell DFFX1 -pin {Q} [remove_from_collection [all_inputs] [get_ports clk]] > > ``` ## 3. 輸出負載 (Output Load) ### (1) 使用圖形介面操作 1. **開啟設定視窗:==選擇輸出線== > ==Attributes== > ==Operating Environment== > ==Load==** <iframe src="https://drive.google.com/file/d/1z19z9qu9Mg9GcoHEiXHc7gXcwBFaM6Qi/preview" height="300"></iframe> 2. **設定輸出附載:==選擇每一個 port== > ==設為 `0.001913`==** <iframe src="https://drive.google.com/file/d/1_i9mUwAFPatL7Yy6gpyCa6Le7dJoHWaN/preview" height="350"></iframe> ### (2) 使用 CMD 操作 > [!Important] **設定內容** > - **設定 ==所有輸出負載== 的 ==電容值== 為 ==`0.001913 pF`==** > > ```sdc= > > set_load 0.001913 [all_outputs] > > ``` ## 4. 輸入 & 輸出延遲 (Input & Output Delay) ### (1) 使用圖形介面操作 1. **開啟設定視窗:** - **Input Delay:==選擇輸入線== > ==Attributes== > ==Operating Environment== > ==Input Delay==** - **Output Delay:==選擇輸出線== > ==Attributes== > ==Operating Environment== > ==Output Delay==** <iframe src="https://drive.google.com/file/d/1BVZejvglQLv7pBDfLYzybCiQapXyJZ7o/preview" height="400"></iframe> 2. **設定延遲:==選擇基準時脈== > ==輸入最大/最小延遲時間==** <iframe src="https://drive.google.com/file/d/1VG6TAOKjTrkpqKGLUdUxvS5May-BlzKB/preview" height="400"></iframe> ### (2) 使用 CMD 操作 > [!Important] **設定內容** > - **設定 ==輸入延遲==(除 ==clk==),以 ==時脈 clk== 為基準** > - **==最大延遲==:==`1 ns`==** > - **==最小延遲==:==`0.2 ns`==** > - **設定 ==輸出延遲==,以 ==時脈 clk== 為基準** > - **==最大延遲==:==`1 ns`==** > - **==最小延遲==:==`0.1 ns`==** > > ```sdc= > > set_input_delay -clock clk -max 1 [remove_from_collection [all_inputs] [get_clocks clk]] > > set_input_delay -clock clk -min 0.2 [remove_from_collection [all_inputs] [get_clocks clk]] > > > > set_output_delay -clock clk -max 1 [all_outputs] > > set_output_delay -clock clk -min 0.1 [all_outputs] > > ``` ## 5. 線路負載模型 (Wire Load Model) ### (1) 使用圖形介面操作 1. **開啟設定視窗:==Attributes > Wire Load==** <iframe src="https://drive.google.com/file/d/1LB95ot3U9KSdExTaXkDlQrO9LfugKNey/preview" height="300"></iframe> 2. **設定模型:==選擇你要的製程==** <iframe src="https://drive.google.com/file/d/1mrPRAOCImpVLN7MO6QGOdOxuUH0u9CkF/preview" height="300"></iframe> ### (2) 使用 CMD 操作 > [!Important] **設定內容** > - **設定 ==線路負載模型== 為 ==library `slow`== 中的 ==模型 `tsmc18_wl10`==** > > ```sdc= > > set_wire_load_model -name tsmc18_wl10 -library slow > > ``` ## 6. Check & uniquify Design ```sdc= check_design -multiple_designs uniquify ``` --- ## ● Conmand ```sdc= set_operating_conditions -min_library fast -min fast -max_library slow -max slow set_driving_cell -library slow -lib_cell BUFX4 -pin {Y} [get_ports clk] set_driving_cell -library slow -lib_cell DFFX1 -pin {Q} [remove_from_collection [all_inputs] [get_ports clk]] set_load 0.001913 [all_outputs] set_input_delay -clock clk -max 1 [remove_from_collection [all_inputs] [get_clocks clk]] set_input_delay -clock clk -min 0.2 [remove_from_collection [all_inputs] [get_clocks clk]] set_output_delay -clock clk -max 1 [all_outputs] set_output_delay -clock clk -min 0.1 [all_outputs] set_wire_load_model -name tsmc18_wl10 -library slow check_design -multiple_designs uniquify ```