vram: make arbiter clients and servers connectable
This commit is contained in:
parent
aa048537ef
commit
81e5264d22
|
@ -1,5 +1,6 @@
|
|||
package MemArbiter;
|
||||
|
||||
import Connectable::*;
|
||||
import Vector::*;
|
||||
|
||||
export MemArbiterWrite(..);
|
||||
|
@ -22,6 +23,18 @@ interface MemArbiterClient#(type request);
|
|||
method Action grant();
|
||||
endinterface
|
||||
|
||||
instance Connectable#(MemArbiterClient#(req), MemArbiterServer#(req));
|
||||
module mkConnection(MemArbiterClient#(req) client, MemArbiterServer#(req) server, Empty ifc);
|
||||
rule send_request;
|
||||
server.request(client.request());
|
||||
endrule
|
||||
|
||||
rule send_grant (server.grant());
|
||||
client.grant();
|
||||
endrule
|
||||
endmodule
|
||||
endinstance
|
||||
|
||||
typedef struct {
|
||||
Bool write;
|
||||
addr addr;
|
||||
|
|
|
@ -71,8 +71,6 @@ function TestCase testCase(String name,
|
|||
endfunction
|
||||
|
||||
module mkTB();
|
||||
MemArbiter#(Addr) dut <- mkMemArbiter();
|
||||
|
||||
Vector#(29, TestCase) tests = vec(
|
||||
testCase("All idle",
|
||||
idle, idle, idle,
|
||||
|
@ -197,6 +195,8 @@ module mkTB();
|
|||
read(0), idle, idle,
|
||||
-1, 0));
|
||||
|
||||
MemArbiter#(Addr) dut <- mkMemArbiter();
|
||||
|
||||
Reg#(UInt#(32)) idx <- mkReg(0);
|
||||
|
||||
rule display_test (idx == 0);
|
||||
|
|
Loading…
Reference in New Issue