Grlib での AMBA  bus 記述

GrlibはすべてのIPがAHBまたはAPBのAMBA BUSでインターフェースが記述されている 。   
また、SPLIT転送に対応するかどうかをオプションで指定できる。


f                    Grlib-AHB 

上記図中のahbmi, ahbmo.........等のinterface定義はamba.vhdlで記述されている。セレクタバスやアービター、デコーダ等の
バス論理回路の実態は ahbctrl.vhdに記述されている。その他 AHB/APB Bridge等が提供されている。
以下はamba.vhdに記述されているインターフェースである。基本的にAMBA2.0の仕様書に従っているが、一部AMBA仕様に
含まれない信号もこのインターフェース内に記述されている。

-- AHB master inputs
  type ahb_mst_in_type is record
    hgrant    : std_logic_vector(0 to NAHBMST-1);     -- bus grant
    hready    : std_ulogic;                             -- transfer done
    hresp    : std_logic_vector(1 downto 0);     -- response type
    hrdata    : std_logic_vector(31 downto 0);     -- read data bus
    hcache    : std_ulogic;                             -- cacheable
    hirq      : std_logic_vector(NAHBIRQ-1 downto 0);    -- interrupt result bus
  end record;

-- AHB master outputs
  type ahb_mst_out_type is record
    hbusreq    : std_ulogic;                             -- bus request
    hlock    : std_ulogic;                             -- lock request
    htrans    : std_logic_vector(1 downto 0);     -- transfer type
    haddr    : std_logic_vector(31 downto 0);     -- address bus (byte)
    hwrite    : std_ulogic;                             -- read/write
    hsize    : std_logic_vector(2 downto 0);     -- transfer size
    hburst    : std_logic_vector(2 downto 0);     -- burst type
    hprot    : std_logic_vector(3 downto 0);     -- protection control
    hwdata    : std_logic_vector(31 downto 0);     -- write data bus
    hirq       : std_logic_vector(NAHBIRQ-1 downto 0);    -- interrupt bus
    hconfig     : ahb_config_type;             -- memory access reg.
    hindex      : integer range 0 to NAHBMST-1;         -- diagnostic use only
  end record;

-- AHB slave inputs
  type ahb_slv_in_type is record
    hsel    : std_logic_vector(0 to NAHBSLV-1);     -- slave select
    haddr    : std_logic_vector(31 downto 0);     -- address bus (byte)
    hwrite    : std_ulogic;                             -- read/write
    htrans    : std_logic_vector(1 downto 0);     -- transfer type
    hsize    : std_logic_vector(2 downto 0);     -- transfer size
    hburst    : std_logic_vector(2 downto 0);     -- burst type
    hwdata    : std_logic_vector(31 downto 0);     -- write data bus
    hprot    : std_logic_vector(3 downto 0);     -- protection control
    hready    : std_ulogic;                             -- transfer done
    hmaster    : std_logic_vector(3 downto 0);     -- current master
    hmastlock    : std_ulogic;                             -- locked access
    hmbsel     : std_logic_vector(0 to NAHBAMR-1);    -- memory bank select
    hcache    : std_ulogic;                             -- cacheable
    hirq      : std_logic_vector(NAHBIRQ-1 downto 0);    -- interrupt result bus
  end record;

-- AHB slave outputs
  type ahb_slv_out_type is record
    hready    : std_ulogic;                             -- transfer done
    hresp    : std_logic_vector(1 downto 0);     -- response type
    hrdata    : std_logic_vector(31 downto 0);     -- read data bus
    hsplit    : std_logic_vector(15 downto 0);     -- split completion
    hcache    : std_ulogic;                             -- cacheable
    hirq       : std_logic_vector(NAHBIRQ-1 downto 0); -- interrupt bus
    hconfig     : ahb_config_type;             -- memory access reg.
    hindex      : integer range 0 to NAHBSLV-1;         -- diagnostic use only
  end record;

-- APB slave inputs
  type apb_slv_in_type is record
    psel    : std_logic_vector(0 to NAPBSLV-1);     -- slave select
    penable    : std_ulogic;                             -- strobe
    paddr    : std_logic_vector(31 downto 0);     -- address bus (byte)
    pwrite    : std_ulogic;                             -- write
    pwdata    : std_logic_vector(31 downto 0);     -- write data bus
    pirq    : std_logic_vector(NAHBIRQ-1 downto 0); -- interrupt result bus
  end record;

-- APB slave outputs
  type apb_slv_out_type is record
    prdata    : std_logic_vector(31 downto 0);     -- read data bus
    pirq     : std_logic_vector(NAHBIRQ-1 downto 0); -- interrupt bus
    pconfig     : apb_config_type;             -- memory access reg.
    pindex      : integer range 0 to NAPBSLV -1;    -- diag use only
  end record;



AMBA仕様に含まれない信号の一つにhconfig, pconfigという信号がある。これは以下の図のようにアドレス空間の指定
情報をハードウェアに埋め込みデコーダがそれを用いてバスセレクタをコントロールする。
各IPのインスタンス中のgeneric文によりアドレス情報が指定できる。

                          AMBA-config


他のAMBA仕様に含まれない信号の一つに割り込み信号バスがある。これは以下のように
IPに入出力され、割り込み信号をIP間で通信できるようにしている。どのIPが割り込み信号バスの何番に当たるかは
各IPのインスタンス中のgeneric文により指定できる。
 
           Grlib-IRQ