IDLE, North, East, West, South, Local | IDLE, North, East, West, South, Local
✓
Credit input
credit
Always 1 (constant)
?
“Default” state
IDLE
Same as before (sticky)
✗
Grant is given
When preserving the state
Always (unless no requests)
So everything except last two points can be done with arbiter_out, and of course last two points can be implemented in arbiter_out using parameterization. In fact, I'm not sure if the default state matters at all, but I don't understand that part of the behavior fully.
I think arbiter_in should be removed and arbiter_out can be renamed to just arbiter.
Oh, another option would be to reuse just the state machine (and keep two different modules), but that would still leave us with copy-pasted unit tests (or worse, a parameterizable test bench…).
Took a while to realize, but it finally came to me when I was looking at the tests…
X_N_Y
,X_E_Y
,X_W_Y
,X_S_Y
,X_L_Y
|req_X_N
,req_X_E
,req_X_W
,req_X_S
,req_X_L
grant_Y_N
,grant_Y_E
,grant_Y_W
,grant_Y_S
,grant_Y_L
|X_N
,X_E
,X_W
,X_S
,X_L
IDLE
,North
,East
,West
,South
,Local
|IDLE
,North
,East
,West
,South
,Local
credit
IDLE
So everything except last two points can be done with
arbiter_out
, and of course last two points can be implemented inarbiter_out
using parameterization. In fact, I'm not sure if the default state matters at all, but I don't understand that part of the behavior fully.I think
arbiter_in
should be removed andarbiter_out
can be renamed to justarbiter
.Somewhat related issue: #12