


Gnt : out std_logic_vector(ARBITER_W - 1 downto 0) Req : in std_logic_vector(ARBITER_W - 1 downto 0) Let's see a Modelsim simulation of the thee-input arbiter: The logic for gnt selection is a priority encoder where only one gntbit is asserted for any combination of reqsignals. After busy goes low, all grant signals are de-asserted for one clock (line 39), and then the logic for choosing the next bus master is activated.Īrchitecture rtl of arbiter is signal busy_d : std_logic Įlsif (rising_edge(clk)) then if (busy_fe = '1') then The process and logic at lines 21 to 31 detects the falling edge of the busy signal. The gnt signal is changes only if the bus is not busy. Master 2 is awarded grant only if it requests the bus and neither master 0 nor master 1 request the bus. Master 1 is given grant only if it requests the bus and master 0 doesn't request the bus. If the first master (master 0) asserts a request, it is awarded grant. The logic for generating the grant signals (lines 41-43) is quite simple. If the bus has already been granted to an agent, even if a bigger priority master requests the bus, the current transaction must complete before the arbiter gives grant signal to another master.

Arbitration of the bus is done only while it is inactive. The arbiter of this example has three request inputs and three grant outputs.Īdditionally, it has a 'busy' signal. In this entry of the tutorial, we will see a simple implementation of a VHDL arbiter. In the previous installment, we defined what a HW arbiter is. This tutorial was designed using Quartus and Modelsim-Altera
