天天看點

【低功耗-驗證】UPF,低功耗流程,VCS NLP

UPF

Unified Power Format (UPF) 用于描述power intent(供電意圖)的标準,基于TCL語言編寫。

目前,最新版的UPF為UPF3.0 1801-2018。

【低功耗-驗證】UPF,低功耗流程,VCS NLP

SDC時序限制為Timing Spec;UPF為 POWER DESIGN SPEC,傳遞給後端作為輸入檔案,需要保證其為 Golden File。

【低功耗-驗證】UPF,低功耗流程,VCS NLP

UPF檔案主要包含4部分内容:power domain,PG connection,low power cell rule,power state 。

power domain: 對特定的RTL instance做電源管理,可以将其單獨定義為一個domain,需要primary net供電。實體實作為voltage area。

【低功耗-驗證】UPF,低功耗流程,VCS NLP

PG connection: 通過supply net或者supply set建構power network電源網絡,給各個power domain, IP Macro, I/O cell供電。實體實作為power rail。supply port供電端口。

【低功耗-驗證】UPF,低功耗流程,VCS NLP

在UPF2.0中引入了supply set的概念,是supply net的抽象集合。

對于一個MOS管,供電端必須有power Pin, ground Pin;在一些其他的低功耗政策中,如Body Bias中,還會對nwell,pwell,deepnwell,deeppwell做額外處理。是以supply set作為supply net的集合,對于供電網絡的描述更佳友好。

【低功耗-驗證】UPF,低功耗流程,VCS NLP
【低功耗-驗證】UPF,低功耗流程,VCS NLP

VNBPin對nwell供電,VPBPin對pwell。

【低功耗-驗證】UPF,低功耗流程,VCS NLP

low power cell rule:對于level shifter,isolation,retention register,power switch cell的行為描述。如level shifter從高到低還是從低到高,isolation cell鉗位的高低電平,power switch的控制信号等。

power state:Chip的一種供電模式,是特定條件下supply net的供電組合。

可以通過create_pst建立PST power state table,并作覆寫率分析。

PST有兩種方式,一種是add_power_state,将power_state加入PST(recommend):

【低功耗-驗證】UPF,低功耗流程,VCS NLP

另一種是add_port_state,将port_state加入PST(legacy):

【低功耗-驗證】UPF,低功耗流程,VCS NLP

power sate也可以用于建立Power Model。對于超大項目,需要在pre-RTL階段,在軟體應用層做架構探索,對性能,功耗,面積評估(Shift left and constant visibility)。

VPU Power Model示例:🔗5G Mobile SoC Pre-RTL Power/Performance Optimization

【低功耗-驗證】UPF,低功耗流程,VCS NLP

整個UPF的編寫和維護,根據實際項目需求,編寫SPEC-2-UPF的腳本,自動生成UPF檔案,減少工作量和書寫錯誤。

🔗An innovative and efficient approach for… UPF files

Low Power Simulation

Tools

VC LP: low power的靜态檢查工具,用于Static Verification。以 UPF/PST 作為Golden去檢查UPF本身的一緻性,以及檢查設計/網表是否有缺少/備援的低功耗器件,包括檢查帶有電源地資訊的網表裡面電源/地的連接配接是否和 UPF 的設計意圖一緻,等等,一般由UPF實作工程師完成,是 LP 驗證檢查的第一步。VC LP涉及LP實作的整個流程,為動态仿真和邏輯綜合提供一個"幹淨“的UPF(Hand-off前),保證最後的UPF實作與最初的設計意圖一緻(Sign-off前)。

VCS NLP: VCS Native Low Power 支援VCS帶UPF/CPF的Power-Aware的仿真,用于Dynamic Verification。Power-Aware就是仿真工具可以根據UPF對RTL model實作power-up,power-down,以及retention, isolation, and level shifting等功能,相當于插入虛拟的power cell來實作low power simulation。(VCS NLP天然內建了 low power simulation功能,以往的方式是采用 MVSIM工具,一款協同仿真器(Co-Simulator),同 VCS協同仿真)

vcs -upf <upf file>指定UPF檔案即可實作帶UPF的仿真。

Verdi Power-Aware Debug: dump POWER相關資訊後,verdi也支援Power-Aware的debug。🔗低功耗驗證 (三) Verdi Power-Aware Debug簡單使用

其餘的一些工具,如Design Compiler,IC Compiler,Formality,PrimeTime 等非Verification tool不在深入研究。

【低功耗-驗證】UPF,低功耗流程,VCS NLP

Low Power Flow

Synopsys®推薦的UPF-flow如下圖所示,仿真涉及三個階段,邏輯綜合前RTL+UPF,邏輯綜合後Gate-level netlist+UPF',實體實作後Gate-level netlist+UPF" 或者Gate-level netlist with PG pin。UPF file作為Golden file,貫穿整個流程,指導工具實作。(相比 traditional flow,Snps推薦的 Golden UPF Flow,工具會額外生成 supplemental UPF,可以參考🔗Golden UPF Flow Application Note)

【低功耗-驗證】UPF,低功耗流程,VCS NLP

Original RTL + UPF

在邏輯綜合之前,RTL model中還沒有插入Low Power cells(isolation cells, level shifters, retention registers, or power switches) 和 power and ground (PG) net。VCS NLP根據UPF插入虛拟cells和net,實作Power Aware功能。

Gate-Level Netlist + UPF’

使用DC邏輯綜合後,産生UPF'(UPF prime),此時網表插入了isolation cells,level shifters,retention registers,但是PG net和power switches還沒有。這一階段的仿真,需要gate-level netlist,UPF' file以及 .db file。(.db是binary格式,描述 Cell 每個 Pin 和電源直接的依賴關系,由test格式的.lib轉化得到)根據項目需求,這個階段的仿真不是必須要做的。

Gate-Level Netlist + UPF''及PG Netlist

經過IC Compiler,IC Compiler II, 或者 Fusion Compiler布局布線後,會産生UPF" (UPF double-prime)。這時沒有必要使用VCS NLP跑帶UPF" 的仿真了,可以直接跑PG Netlist的仿真。PG Netlist包含UPF中定義的各種low power cells以及PG pin組成的供電網絡。PG Netlist是Power-Aware的,直接使用vcs仿真。

帶PG pin的std cell多了VDD VSS VBP VBN四個PG pin,下電條件下通過三态門bufif1驅動x态,上電則正常導通,實作Power-Aware:

【低功耗-驗證】UPF,低功耗流程,VCS NLP

VCS-NLP Simulation

▶将頂層testbench建立為一個power domain,作為一個虛拟的always on domain。

▶ set_design_attributes設定屬性。例如-attribute UPF_dont_touch TRUE設定為不受UPF掉電影響,為always_on狀态。-attribute enable_bias TRUE使能bias functions。更多屬性參考手冊。

▶數字部分由模拟部分控制上下電,可以在UPF中加入power switches來模拟LDO/DC-DC的行為。

▶對于power sequence的time delay,例如power switch打開後,多久關閉isolation。可以根據後端結果評估設定一個安全時間cycle delay或者使用power switch的ack_port做判斷。

▶domain的供電來自供電端口,可以通過add_port_state定義端口電壓,也可以通過調用supply_on supply_off的方式控制。預設power_net 為 { FULL_ON, 1.0000V} ground_net為 {OFF, 0.0000V}。

▶Supply States: OFF, UNDETERMINED, PARTIAL_ON, FULL_ON四種狀态。

示例:power switch 兩個 control,input supply port為FULL_ON時,trickle_ctrl打開,output supply port為PARTIAL_ON,main_ctrl打開,為FULL_ON狀态。若控制信号出現X态或者高阻态,則為UNDETERMINED不确定狀态。
【低功耗-驗證】UPF,低功耗流程,VCS NLP

▶vcs_reinit

對于ROM,實際掉電資料不會丢失;但是仿真時掉電仿真器不會儲存ROM中的資料。可以手動monitor上電信号賦初值或者通過vcs_reinit自動再次觸發initial blocks。

也可以在upf中通過指令行控制:set_design_attributes -elements <element_list> -models <model_list> -attribute SNPS_reinit TRUE

【低功耗-驗證】UPF,低功耗流程,VCS NLP

▶Monitor Power Domain State

第一種:power domain下電時,内部信号(4-state variables)呈X态。根據是否為X态,監測是上電狀态還是下電狀态。

第二種:monitor power_state_simstate。

NORMAL,CORRUPT,CORRUPT_ON_ACTIVITY,CORRUPT_STATE_ON_CHANGE,CORRUPT_STATE_ON_ACTIVITY5種類型的simstate。若沒有額外聲明,預設NORMAL上電,CORRUPT下電兩種狀态。

*vcs_always_on*需要配合編譯指令-power=attributes_on使用,保證不受掉電影響。

也可以在testbench中先通過bind RTL module的方式加入,然後再通過XMR(Cross-Module References)的方式直接monitor simstate,避免掉電影響。

`ifdef UPF_POWER_AWARE
    import UPF::*;
    power_state_simstate upf_simstate;

(*vcs_always_on*)
always @(upf_simstate) begin
 if (upf_simstate == CORRUPT)
       begin
       $display ($time   , "SNPS =>DOMAIN IS CORRUPT");
       end
 else if (upf_simstate == NORMAL)
       begin
       $display ($time   , "SNPS => DOMAIN IS ON");
       end
 else 
    begin
       $display ($time   , "SNPS => DOMAIN IS NON-ON and NON-CURRUPT STAGE");
    end
 end
 `endif      
           

CORRUPT_STATE_ON_CHANGE就是low-vdd standy的操作,降低vdd,減少漏電流,但不至于存儲電平丢失。此時不可以進行存儲的通路操作,否則資料丢失。

【低功耗-驗證】UPF,低功耗流程,VCS NLP

第三種:Power Aware Verification Environment (PAVE) is an infrastructure that enables accessing the UPF objects, monitor low power events, and write power-aware assertions.

PAVE内建通路UPF object的API,使用TCL語言編寫,在編譯選項中-lpa_bind xxx.tcl bind。需要一些學習成本。

▶Log and Report:

VCS-NLP仿真會實時列印power相關的log,WARING, ERROR的需要清理。預設生成mvsim_native_reports report目錄。

▶覆寫率收集:-power=coverage會根據UPF檔案自動收集PST states, Power switch,Supply net/port/transitions等低功耗相關的覆寫率。

也可以-power=cov_pst+cov_psw+cov_iso+cov_pd_simstate+cov_port_state+cov_supply_set手動選擇需要收集的覆寫率條目。

合并覆寫率:urg -full64 -dir coverage/cov.vdb/ -dbname mergedir/merged

打開覆寫率:verdi -cov -covdir mergedir.vdb

▶VCS除了支援功能仿真,低功耗仿真外,還支援SPICE模拟部分仿真與X-Propagation X态傳播(🔗X态詳解 與 X态傳播 VCS X-Propagation)。

SNUG上兩篇 Best Paper Award 的Paper:

Power-Aware下的數模混仿:🔗Power aware simulation for Analog-Mixed Signal design

Power-Aware下的X态傳播:🔗Is X-optimism burning my low power design

Lower Power Verification

  1. Power sequence

不同power mode之間的切換;PMU中fsm的周遊;CPU 執行WFI指令請求下電;isolation操作在下電前,上電後;

  1. Wakeup interrupt

不同條件下,從SLEEP MODE喚醒,如Pin Wakeup,RTC Wakeup,IP Wakeup等。

  1. Memory retention testing

重新上電後,retention mem的資料保持不變。

  1. Assertion checker

assertion domain power down/up; Free-running clocks/gated clocks; Analog model signal assertion; isolation ctrl and power down/power up sequence assertion;clamp value check;

  1. Formal Verification

protocol compliant check : LPI(Low Power Interface,Q-channel/P-channel)protocol

parameters, tie-offs and connectivity check : the propagation of parameters, the value of tie-offs, the connectivity of combinatorial logic

deadlock check : no specific sequencing errors prevent power transitions

livness checks : activity on any of the Q-channels will always result in power transitions from a low to a high state

other functional point suitable for Formal

  1. Collect and Analysis Power Coverage
  1. Clean model and sim log error

————————————————

版權聲明:本文為CSDN部落客「Holden_Liu」的原創文章,遵循CC 4.0 BY-SA版權協定,轉載請附上原文出處連結及本聲明。

原文連結:https://blog.csdn.net/Holden_Liu/article/details/118439909

繼續閱讀