1. 传统方法
状态机如下(三个request)
显然随着request增加,状态机会变得异常复杂,难于管理。
针对这种情况,提出了一种改良的方法:
从定义开始: 在每个cycle,只有一个master拥有最高优先权,如果这个拥有token的master没有request,则他的下一个master发出的request可以被ack。如下图
这样我们只需要实现priority logic 和ring counter两个部分就行了。各个request和priority logic的连接顺序有所调整变化,请务必注意。这种方法适合于4-8个master 的request。
下面我们来介绍一种更加通用的方法(主要利用二的补码)
Consider the following problem. You have a bit-string that represents the current scheduled slave in one-hot encoding. For example, "00000100" (with the leftmost bit being #7 and rightmost #0) means that slave #2 is scheduled.
Now, I want to pick the next scheduled slave in