-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.sv
More file actions
41 lines (31 loc) · 816 Bytes
/
driver.sv
File metadata and controls
41 lines (31 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class driver;
transaction t;
mailbox gen_drv;
// mailbox drv_scb;
virtual mem_intf vif;
int txns_received;
function new(mailbox gen_drv, virtual mem_intf vif);
this.gen_drv= gen_drv;
// this.drv_scb=drv_scb;
this.vif=vif;
txns_received=0;
t=new();
endfunction
task run();
forever begin
t=new(,,,4);
gen_drv.get(t);
// drv_scb.put(t);
// if(got_t) begin
@(negedge vif.clk);
vif.read=t.read;
vif.write=t.write;
vif.data_in=t.data_in;
vif.addr = t.addr;
@(posedge vif.clk);
$display("[%0t] DRIVER: Drove Addr=%0d, DataIn=%h, Write=%b, Read=%b", $time, t.addr, t.data_in, t.write, t.read);
txns_received++;
// end
end
endtask
endclass