ahb時序解析


 

ahb 總線架構

 

 

 

 

AHB(Advanced High Performance Bus)總線規范是AMBA(Advanced Microcontroller Bus Architecture) V2.0總線規范的一部分,AMBA總線規范是ARM公司提出的總線規范,被大多數SoC設計采用,它規定了AHB (Advanced High-performance Bus)、ASB (Advanced System Bus)、APB (Advanced Peripheral Bus)。AHB用於高性能、高時鍾頻率的系統結構,典型的應用如ARM核與系統內部的高速RAM、NAND FLASH、DMA、Bridge的連接。APB用於連接外部設備,對性能要求不高,而考慮低功耗問題。ASB是AHB的一種替代方案。現在已經有AHB V5.0。

AHB總線的強大之處在於它可以將微控制器(CPU)、高帶寬的片上RAM、高帶寬的外部存儲器接口、DMA總線主機、各種擁有AHB接口的控制器等等連接起來構成一個獨立的完整的SOC系統,不僅如此,還可以通過AHB-APB橋來連接APB總線系統。AHB可以成為一個完整獨立的SOC芯片的骨架。

AHB特點:

分塊處理
單周期總線主機移交
單時鍾沿操作

無需三態門的實現方式
更寬的數據總線架構(64位或者128位)
流水線操作
可支持多個總線主設備(最多16個)

 

 

 

 ahb 總線組成

 

 

 

AHB總線由AHB總線主機(Master)、AHB總線從機(Slave)和Infrastructure構成。Infrastructure由仲裁器、數據多路選擇器、地址控制多路選擇器、譯碼器構成。

AMBA AHB 總線協議設計使用一個中央多路選擇器互聯方案。該方案中,所有總線主機設備輸出地址和控制信號來指示它們想執行的傳輸,同時仲裁器決定哪一個主機能夠將它
的地址和控制信號連通到所有的從機
。當然也需要一個譯碼器來控制讀數據和響應多路信號選擇器,多路信號選擇器選中來自傳輸中所包含從機的適當信號。

 

 

AHB 主機: 總線主機能夠通過提供地址和控制信息發起讀寫操作。任何時候只允許一個總線主機處於有效狀態並能使用總線。
AHB 從機: 總線從機在給定的地址空間范圍內響應讀寫操作。總線從機將成功、失敗或者等待數據傳輸的信號返回給有效的主機。
AHB 仲裁器: 總線仲裁器確保每次只有一個總線主機被允許發起數據傳輸。即使仲裁協議已經固定,任何一種仲裁算法,比如最高優先級或者公平訪問都能夠根據應用要求而得到執行。AHB 必須只包含一個仲裁器,盡管在單總線主機系統中這顯得並不重要。
AHB 譯碼器: AHB 譯碼器用來對每次傳輸進行地址譯碼並且在傳輸中包含一個從機選擇信號。
所有 AHB 執行都必須僅要求有一個中央譯碼器。

 

master interface

 

 

slave interface

 

 

 

 

 

 

 

 

master側時序和信號分析:

  •  hburst[2:0] :用於控制突發類型(模式)
  • hbusreq

     

     

     master向bus仲裁器申請bus總線使用權;最多可以有16個master。

  •  hlock

     

     

     

     當該信號為高時,表示master請求鎖定對總線的訪問,在HLOCK為LOW之前,其他master不允許獲得總線。

  • HSIZE[2:0]

      

  • HTRANS[1:0]

     

     

     

    在wait Undefine Length busrt(INCR)的傳輸期間,當HREADY為低時,允許主機從BUSY改變為任何其它傳輸類型。如果執行SEQ傳輸,則burst繼續,如果執行IDLE或NONSEQ傳輸,則burst終止。在T3~T5,HREADY為LOW時,HTRANS需保持。

     

     

  • HPROT

    HPROT[6:4]是AHB5新增的,用來表示extended memory types,如果Extended_Memory_Types是True,HPROT[6:4]有效。 Issue A of this specification defined a 4-bit HPROT signal, which is described in this section.
    Issue B of this specification adds extended memory types and this is described in more detail in Memory types on page 3-45.
    -------------Note---------------
    The name of HPROT[3] is changed between Issue A and Issue B of this specification, but the definition remains the same. In Issue A HPROT[3] was designated Cacheable, in Issue B it is designated Modifiable.                                                                                  
    -------------------------------------------------------------------------------------------------------------------------------                                                    The protection control signals, HPROT[3:0], provide additional information about a bus access and are primarily intended for use by any module that implements some level of protection.

     

     slave一般不使用HPROT信號。(Bufferable和Cacheable的區別詳見相應博客隨筆)

    AHB5 defines the Extended_Memory_Types property. This property defines whether an interface supports the extended memory types described in this section. If this property is not defined, then the interface does not support the extended memory types.
    This issue of the specification adds additional HPROT signaling and provides a more detailed list of requirements for each of the memory types.
    該規范的這一期增加了額外的HPROT信令,並提供了每種存儲器類型的更詳細的要求列表。     

        

  • HGRANT:

     

     

     

  • HRESP[1:0]

     在AHB 5.0中描述如下:

     在AHB 2.0中描述如下:

     除了OKAY之外,其他都需要兩拍;RETRY和SPLIT的發生時,當前master都會釋放總線,區別如下:

    • The difference between SPLIT and RETRY is the way the arbiter allocates the bus after a SPLIT or a RETRY has occurred:
      • For RETRY the arbiter will continue to use the normal priority scheme and therefore only masters having a higher priority will gain access to the bus.
      對於RETRY,只有較高優先級的master可以獲得總線。
      • For a SPLIT transfer the arbiter will adjust the priority scheme so that any other master requesting the bus will get access, even if it is a lower priority. In order for a SPLIT transfer to complete the arbiter must be informed when the slave has the data
      available. 
      對於SPLIT,仲裁器會調整優先級,讓其他所有master都可以獲得總線,即使是優先級低的master也可以獲得總線,當slave有足夠的空間完成split傳輸時,通知arbiter,arbiter恢復master的優先級,等待高優先級傳輸完成之后,傳輸該master的split傳輸。
    • The SPLIT and RETRY responses provide a mechanism for slaves to release the bus when they are unable to supply data for a transfer immediately. Both mechanisms allow the transfer to finish on the bus and therefore allow a higher-priority master to get access to the bus

   疑問:當slave返回split之后,arbiter仍然按照優先級優先處理其他優先級mater的業務,還是處理完上一個master的業務之后,優先初理split?----恢復該master的優先級,按照優先級正常傳輸。

slave側時序和信號分析:

 

 

  • HSPLIT[15:0]:當slave認為需要多次初理時,用於分割傳輸,該信號在slave和arbiter之間使用。

     

     


     

     

     

     

     

  • hmaster[3:0]:用來表示哪個master正在占用總線

     

     

     

     

  • hmastlock:表示當前master正在執行鎖定的傳輸序列,該信號與hmaster具有相同的時序。

     

     

    參考資料:

    https://www.cnblogs.com/mikewolf2002/p/10335422.html


免責聲明!

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



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