-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReceiver.sv
32 lines (28 loc) · 865 Bytes
/
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
`ifndef INC_RECEIVER_SV
`define INC_RECEIVER_SV
`include "ReceiverBase.sv"
class Receiver extends ReceiverBase;
pkt_mbox out_box; // Scoreboard mailbox
extern function new(string name = "Receiver", int port_id, pkt_mbox out_box, virtual router_io.TB rtr_io);
extern virtual task start();
endclass
function Receiver::new(string name, int port_id, pkt_mbox out_box, virtual router_io.TB rtr_io);
super.new(name, rtr_io);
if(TRACE_ON) $display("[TRACE]%t %s:%m", $realtime, name);
this.da = port_id;
this.out_box = out_box;
endfunction
task Receiver::start();
if(TRACE_ON) $display("[TRACE]%t %s:%m", $realtime, name);
fork
forever begin
this.recv();
begin
// if(this.da != this.pkt2cmp.da) continue;
Packet pkt = new this.pkt2cmp;
this.out_box.put(pkt);
end
end
join_none
endtask: start
`endif