ARM-CPU DynamlQ技術及其power架構介紹


參考博文:http://www.diankeji.com/pingce/32006.html和http://blog.chinaaet.com/weiqi7777/p/5100063155

DynamlQ技術

一直以來,運算領域都在進行對更高性能的追求與突破。但是在移動運算領域,出於對便攜性的妥協,性能受到能耗指標的鉗制。在性能與能耗之間的取得微妙的平衡,讓以智能手機為首的移動設備兼具優異的性能和出色的續航,是ARM工程師們長期以來面臨的挑戰。

對此,2011年,ARM推出了全球第一的應用於手機市場的異構處理技術——big.LITTLE。該技術的架構包括一個高性能“大”CPU集群和一個高效率“小”CPU集群,它們之間通過一致互聯實現連接。在該架構上運行的軟件可以將正確的應用程序任務調度到正確的CPU上。

 之后的幾年,隨着CPU不斷推陳出新,軟件層也得到了更新,引入了更加智能化的任務調度算法。然而,在此期間,硬件技術架構基礎卻基本保持不變,仍是大小若干個CPU集群。該技術在手機市場迅速得到應用。因此,如今基於ARMv8 的已出貨安卓設備有三分之二都依靠 big.LITTLE優化功耗和性能。

為了進一步優化移動設備的性能與能耗,ARM近期發布了最新技術DynamIQ,因其對big.LITTLE技術未來發展影響深遠,甚至可能大范圍顛覆移動運算領域,而引起了科技行業和“技術愛好者”的強烈興趣。

DynamIQ技術帶來了一種可以改變異構處理格局的新型技術架構,它的做法是將大小兩個集群合並,從而形成一個兼具大小CPU、完全集成化的CPU 集群。使用DynamIQ技術構建的big.LITTLE 設計被稱為DynamIQ big.LITTLE。DynamIQ big.LITTLE技術在CPU集群中引入了智能化功耗功能,有助於在一定發熱量之內最大限度地發揮性能。這就意味着數據處理能力和性能將會更加強大,在所有的應用程序都能創造更加豐富的體驗。

DynamIQ big.LITTLE技術的到來, 將為消費者和移動設備廠商帶來眾多好處。

完全集成化的解決方案提供更廣泛的產品差異化

消費者們一直期待智能手機的計算能力可以不斷提高——對於每一款新上市的設備都是如此,無論是高端智能手機,還是入門級機型。客觀地說,PokemonGo在 2016 年登陸手機市場之后一舉成為人手必備的頭號應用程序,即便在入門級智能手機上也一樣。為了滿足消費者對更高性能的需求,尤其是在對價格敏感的市場,SoC,系統級芯片內的產品差異化變得更加重要。

DynamIQ big.LITTLE系統中的新型集成式集群推出了可以拓寬產品差異化的全新組合。這些全新組合將會讓“大”CPU越來越多地應用於中端市場,以便讓性能水平相較於只有“小”CPU的傳統設計有所提升。然而,可擴展性的范圍並未到此為止。DynamIQ big.LITTLE 系統還允許在一個集群內將單個或成組的CPU調整到不同的性能和功耗點,從而讓設計延伸出幾乎無窮無盡的可能性。DynamIQ 提供的高度靈活性為價格敏感型市場創造了差異化機會。

 單線程性能的提升帶來更勝一籌的用戶體驗

雖然用戶體驗由於應用程序的不斷發展而不斷變化,但是有一件事情始終不變:用戶體驗在響應速度上十分依賴於單線程計算性能。諸如人工智能和增強現實之類的高級用途將對用戶體驗不斷提出更高要求。然而,手機市場很快就提醒我們:發熱量限制了設備能夠實現的性能大小。熱效率問題的范圍已經超出了手機市場,它在汽車和筆記本電腦等其他市場也是不容忽視的一大因素。

為了克服該問題,big.LITTLE依靠動態電壓/頻率調節等技術,可以實現兩個互補的性能域,其中每個性能域都能一致地調節電壓和頻率。而DynamIQ通過在單個集群中支持多個可配置的性能域,進一步發展了該技術。這些性能域由單個或多個ARM CPU組成,可以在性能和功耗方面進行調節,並獲得更佳的精細程度,比以前的 Cortex-A 四核心集群在調節精度方面可獲得多達4倍的提升。 

該DynamIQ技術的特性意味着DynamIQ big.LITTLE系統能夠在更嚴格的發熱量限制之下發揮更多性能,從而延長性能的持續時間。此類系統還可以利用瞬時性能提升,在觸摸屏或是觸摸板上為應用程序啟動或手勢操作(如旋轉、滑動和捏拉縮放)等活動帶來更快的響應速度和更好的用戶體驗。

通過先進的電源管理功能實現更高的能效

在智能手機等移動計算市場競爭越來越激烈的同時,消費者的需求也在被市場放大。而設備的能耗與續航越來越受到消費者的重視,也成為了廠商重點關注的用戶痛點。

DynamIQ big.LITTLE系統中,大小CPU之間所有任務轉移現在都可以通過共享內存在單個CPU集群之內進行,共享數據在“大”CPU和“小”CPU之間的轉移也可以在單個集群之內進行。從系統角度來看,這減少了數據流量,從而減少了功耗,帶來了整體系統效率的優勢。

此外,受益於在CPU集群中更大的緩存空間,在集群內進行更大量的異構處理成為可能,這樣可以減少對外部存儲器的訪問,從而減少運行某些應用程序時系統使用的功耗。這也意味着減少了 CPU的數據等待時間,從而也在降低功耗的同時提高性能。

DynamIQ big.LITTLE 還采用了 DynamIQ 技術的先進電源管理功能。DynamIQ 系統的設計能夠加快在不同 CPU 電源狀態(例如開機、關機和休眠)之間的轉換速度。這縮短了 CPU 進入待機模式或掉電模式所花費的時間,從而讓進/出待機狀態的轉換更加高效。此外,還有一項自動內存功耗管理功能,它可以根據 CPU 上運行的應用程序的類型,智能地調整集群中可用的本地內存量。

新一代創新用戶體驗

綜上所述,big.LITTLE改進了受限環境中的功耗和熱效率問題,提高了設備的計算能力,從而為消費者提供了更豐富的用戶體驗。DynamIQ技術讓我們站在了一個全新的異構處理時代。DynamIQ big.LITTLE 提高了 AR 和 VR 等高性能高級用途的效率,開啟了豐富創新用戶體驗的新紀元。

 在DynamIQ技術之下,移動運算技術再次向前跨出了一大步,智能手機等移動設備廠商獲得了更大的施展空間,消費者可以期待在后續的產品更新中得到在性能與能耗上更進一步的優質產品。

DynamlQ的power架構

ARM的處理器,在power架構,根據cluster的架構的變化而發生了變化。

 

一、big-little的power架構

 

如下圖,是big-little的power 架構,整個cluster的所有組件,均使用相同的電壓域。用虛線框包圍的區域,表示該模塊,有單獨的power domain。

    

二、DynamlQ的power架構

 

arm在推出DynamlQ架構之后,也推出了新的power架構,不然,無法精細化的控制power。如下圖所示:

不同的顏色,表示不同的電壓域,用虛線框包圍的,表示該模塊,有單獨的power domain。

可以看出,采用DynamlQ架構之后,每個core,有自己的電壓域。

相比之前的big-little架構,取消了,很多信號。

    左邊,是big-little架構下,core與power controller(以下簡稱PMU)的信號連接:

信號

說明

STANDBYWFI

core是否進入wfi狀態

Q_Channel

Q-channel通道,用於控制core的power

DBGPWRDUP

debugger的core上電請求

DBGNOPWDRDWN

debugger強制片內PMU,不允許對core下電的請求

WARMRSTREQ

core的warm reset請求

SMPEN

core的snoop使能請求

而cluster,與PMU的信號連接如下:

信號

說明

Q-Channel

Q-Channel通道,用於控制cluster的power

STANDYWFIL2

cluster是否處於wfi狀態

ACINACTM

 

右邊,是DynamlQ架構下,core與pmu的信號連接:

信號

說明

P-Channel

P-channel通道,用於控制core的power

DBGRSTREQ

core的warm reset請求

而cluster與pmu的信號連接如下:

信號

說明

P-Channel

P-channel通道,用於控制cluster的power

SYSCOREQ

cluster coherency請求

SYSCOACK

CCI/CCN總線矩陣的coherency響應

關於SYSCOREQ和SYSCOACK的解釋如下:

 

三、P-Channel

 

P-channel的詳細解析,可以看我之前寫的博文:http://www.lujun.org.cn/?p=3634

對於P-Channel,有以下的一些信號:

Signal

Description

PREQ

Power transition request.

PSTATE

Power transition state. PSTATE[3:0] is for power mode, and PSTATE[7:4] is for operating mode.

PACTIVE

The minimum power transition state requirement.

The highest set HIGH bit indicates the required minimum power requirement separately for

power mode and operating mode.

This can be hint for power controller.

PACTIVE[15:0] is for power mode, and PACTIVE[31:16] is for operating mode.

PACCEPT

Power transition request is accepted.

PDENY

Power transition request is denied.

    PMU就是通過P-Channel,來和core以及cluster來通信,實現power的控制。

 

四、power mode

 

power mode,表示硬件power的狀態,分為core的power mode和cluster的power mode。

1、core的power mode

    power mode有以下一些模式:

Power Mode

Description

ON

In this mode, the core is fully functional.

FUNC_RET

This is a retention mode for the Ad-SIMD/FP unit. It can be entered when there are no instructions in the

pipeline or pending for this unit.

This mode can be enabled or disabled by software.

A timeout value for entry into this mode from the last SIMD/FP instruction execution can be programmed.

FULL_RET

This is a retention mode for the full core domain. It can be entered when the core is in WFI/WFE.

This mode can be enabled or disabled, separately for WFE and WFI.

Separate timeout values for entry into this mode from WFE and WFI entry can be programmed.

Direct transitions between ON and FULL_RET are only allowed when:

  • FUNC_RET is not present.
  • FUNC_RET is disabled by software.

OFF_EMU

This mode allows functional emulation of power off, whilst still maintaining debug state and allowing debug

access.

OFF

This mode allows the core to be powered off.

This mode powers off the complete core power domain.

Hardware flushing of the L1 and L2 caches when OFF or OFF_EMU should be added.

DBG_RECOV

This mode allows cache memory contents and RAS registers to be preserved over a reset for debug purposes.

This mode can be used to assist debug of external watchdog-trigger reset events when the whole system hangs.

In this application, cluster power on reset or warm reset should be used together.

    可見,在DynamiQ架構下的power,core的power模式,有多種模式。定義這么多模式,也是為了能夠精細化的控制。

    PSTATE and PACTIVE 編碼如下:

Power Mode

PSTATE[3:0]

PACTIVE[15:0] Related bit

ON

4'b1000

8

FUNC_RET

4'b0111

7

FULL_RET

4'b0101

5

OFF_EMU

4'b0001

1

OFF

4'b0000

0 (always tied to 1'b0)

DBG_RECOV

4'b1010

-

    比如,core要進入OFF狀態,那么core會驅動P-Channel上的PACTIVE信號的0bit為1,PMU發現該bit為1,表示core要進入OFF狀態。於是驅動PSTATE為4'b0000,並設置PREQ為1,發起power mode切換請求。core接收到該請求后,如果允許外部的PMU對core下電,會將PACCEPT信號拉高,PMU檢測到該信號為高后,就可以將core斷電了。

    如果core不允許外部的PMU對core下電,會將PDENY信號拉高,PMU檢測到該信號為高后,就知道不能對core斷電。

2、cluster的power mode

    cluster的power mode有如下4種:

Power Mode

Description

ON

In this mode, the cluster is fully functional.

FUNC_RET

This is a retention mode for the L3 Cache RAM whilst the cluster is still functional.

This mode can be enabled and disabled by software running on any of the cluster cores.

A timeout value for entry into this mode from the last L3 cache access can be programmed.

MEM_RET

This mode allows the cluster logic to be off whilst retaining the L3 Cache RAM. This mode

can be entered when the cluster is idle and all cores are OFF.

OFF

This mode allows the cluster to be powered off.

This mode powers off the full cluster domain.

Hardware flushing of the L3 Cache should be added when OFF is requested on the cluster

P-Channel.

    PSTATE和PACTIVE編碼:

Power Mode

PSTATE[3:0]

PACTIVE[15:0] Related bit

ON

4'b1000

8

FUNC_RET

4'b0111

7

MEM_RET

4'b0010

2

OFF

4'b0000

0 (always tied to 1'b0)

DBG_RECOV

4'b1010

-

比如,cluster要進入OFF狀態,那么core會驅動P-Channel上的PACTIVE信號的0bit為1,PMU發現該bit為1,表示cluster要進入OFF狀態。於是驅動PSTATE為4'b0000,並設置PREQ為1,發起power mode切換請求。cluster接收到該請求后,如果允許外部的PMU對core下電,會將PACCEPT信號拉高,PMU檢測到該信號為高后,就可以將cluster斷電了。

如果cluster不允許外部的PMU對cluster下電,會將PDENY信號拉高,PMU檢測到該信號為高后,就知道不能對cluster斷電。

 

五、寄存器

 

為了支持DnyamlQ架構的power精細化控制,arm定義了一些系統寄存器,用來軟件控制硬件的power mode。

寄存器分為,對core和cluster。

1、對core

    CPUWRCTLR_EL1和 DBGPRCR_EL1,兩個系統寄存器。

Registers

Bit

Name

Description

CPUPWRCTLR_EL1

[0]

PWRDN_EN

Power off enable bit. This is used by software when the core is ready to be inactive at the next entry to WFI.

The SMPEN bit from previous generation processors is removed.

[3:0]

RESERVED

 

[6:4]

WFI_RET_CTRL

System counter tick control. When in multi-thread processor, larger one will be selected for whole core retention control.

[9:7]

WFE_RET_CTRL

System counter tick control. When in multi-thread processor, larger one will be selected for whole core retention control.

[12:10]

SIMD_RET_CTRL

System counter tick control. When in multi-thread processor, larger one will be selected for whole core retention control.

[31:13]

RESERVED

 

DBGPRCR_EL1

[0]

CORENPDRQ

Request emulate power down if the system will power down the core.

In multi-thread processor, if one thread has set this bit, the "no power down" request will be

active.

    軟件如果寫bit0為1,表示要將core下電。當后續的程序執行wfi指令之后,core就會通過P-Channel的pactive,向PMU,發送off請求。

2、對cluster

cluster有以下寄存器:

  • cluster-down寄存器,控制power off和memory retention
  • power 控制寄存器:控制function retention,L3 cache RAM size
  • performance monitor:控制cache部分power off

Registers

Bit

Name

Description

CLUSTERPWRDN_EL1

(banked per-thread per-

core)

[0]

Cluster power

required

Cluster power down request.

If a thread sets its bit to 1'b1, it request that the cluster remains ON when all cores are off.

If a thread sets to 1'b0, it requests that the cluster goes to OFF when all cores are

off.

If any of the banked cluster power requests is set to 1'b1, the cluster will remain ON when all cores are off.

If all of the banked cluster power requests are set to 1'b0, the cluster will go to OFF when all cores are off.

[1]

Memory retention

required

Memory retention enable bit.

If a thread sets its bit to 1'b1, it request that the cluster goes to MEM_RET when all cores are off.

If a thread sets to 1'b0, it requests that the cluster goes to OFF when all cores are

off.

If any of the banked cluster power requests is set to 1'b1, the cluster will go to MEM_RET when all cores are off.

If all of the banked cluster power requests are set to 1'b0, the cluster will go to OFF when all cores are off.

[31:2]

RAZ

 

CLUSTERPWRCTLR_EL1

[2:0]

L3 Cache Ram

Retention Control

System counter tick control.

[3]

RAZ

 

[7:4]

Cache Portion Power

Request

These bits are output on CLUSTERPACTIVE[19:16] to indicate to the power

controller which cache portions must be powered.

[31:8]

RAZ

 

CLUSTERL3HIT_EL1

[31:0]

L3 Cache hit count

Count of number of L3 Cache hit.

CLUSTERL3MISS_EL1

[31:0]

L3 Cache miss count

Count of number of L3 Cache misses.

 

六、cache的power

 

DynamlQ架構的cache的power mode,是多種組合。如下圖:

就是看tag ram和data ram的上電狀態。至於為什么cache,會有這么多種power mode,是因為DynamlQ架構下,cache變大很大。L2 cache成每個core私有的,並且還增加了L3 cache。如果不對cache的power,做精細化的管理,那么功耗,也就上去了。

下圖是power mode的轉換圖:

    以下是power mode的編碼:

  

七、總結

 

    為了適應復雜的DynamIQ架構,arm將power的架構也做了很大的修改。其中一點,是引入了P-Channel,實現更負責的power狀態控制。以及對硬件,定義了很多的power mode,用於軟件來方便的控制,從而實現低功耗。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM