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