Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem with bus arbiter priority algorithm

Not open for further replies.


Member level 2
Dec 2, 2009
Reaction score
Trophy points
Activity points
Hi friends,
I have been working very very hard for the past few days on the arbiter part of the amba ahb bus architecture. I am using a fixed priority algorithm for allocating grant to the bus master. I tried simulating the arbiter verilog code on modelsim with the testbench that I wrote. I was very disappointed. :cry: Even a simple grant signal is not asserted when a highest priority master sends a request signal. In plain words, none of the output grant signals are changing. They are holding constant zero values throughout the run length which indicates to me that only the power reset part of the logic alone is working and rest of the logic does not work. Can anyone throw some light on what might be wrong on the code?

I have enclosed the arbiter verilog code and its testbench in this thread. I have included comments almost everywhere on the code to make it as self explanatory as possible. Hope it helps while viewing the code. :-|:sad:


  • arbiter.txt
    4.5 KB · Views: 69
  • arbiter_tb 1.txt
    1.7 KB · Views: 54

I wanted to check if my entire ahb bus arbiter logic itself is correct first. So what I did was I created a skeletal ahb arbiter verilog code by stripping off all the control signals such as hresp, htrans, hburst etc from the code and also removing the split operation, bus idle check etc. Then I wrote a basic testbench in the same manner in which I had coded the testbench previously as you can see on this thread.

And surprise! It works. All the grant signals occur correctly upon asserting the requests and get deasserted upon deasserting the requests.

So the problem comes when I add those whole bunch of control signals and a bunch of nested if else conditions which is kind of inevitable if they were to be included in the code. That is when the grant signals fail to get asserted.

I am enclosing the simplified arbiter code again in this thread so that you guys can compare this and my original code to spot what may be the changes that can be made to the original complex code to make it work.


  • verybasic_amba_ahb_arbiter - Copy.txt
    1.3 KB · Views: 67
  • verybasic_amba_ahb_arbiter_tb- Copy.txt
    526 bytes · Views: 50

Not open for further replies.

Part and Inventory Search

Welcome to