-
Notifications
You must be signed in to change notification settings - Fork 3
/
Receiver.sv
48 lines (31 loc) · 1.07 KB
/
Receiver.sv
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
42
43
44
45
46
47
48
///////////////////////////////////////////////
//
// Receiver.v
//
///////////////////////////////////////////////
package pkg_arbiter_receiver;
import pkg_arbiter_types::*;
class MiniReceiver;
virtual if_to_arbiter bfm; // interface signal //
string name; // unique identifier
logic [NUMUNITS-1 : 0] grant_response;
mailbox scoreboard_mailbox;
extern function new(string name = "Receiver", virtual if_to_arbiter bfm, mailbox scoreboard_mailbox);
extern virtual task start();
endclass
function MiniReceiver::new(string name = "Receiver", virtual if_to_arbiter bfm, mailbox scoreboard_mailbox);
this.scoreboard_mailbox = scoreboard_mailbox;
this.name = name;
this.bfm = bfm;
endfunction
task MiniReceiver::start();
//Wait one cycle for sending the data, plus one cycle for the data to be ready
bfm.wait_clk(2);
forever begin
bfm.read_grant_if(grant_response);
scoreboard_mailbox.put(grant_response);
//$display (" [RECEIVER] Attribution du bus obtenu %b", grant_response );
bfm.wait_clk(1);
end //forever
endtask
endpackage : pkg_arbiter_receiver