-
Notifications
You must be signed in to change notification settings - Fork 11
/
rcc_scoreboard.sv
executable file
·71 lines (46 loc) · 2.02 KB
/
rcc_scoreboard.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Checker receives the output from the Ref. Model and the output from DUT
// It compares both the outputs
// In this way it perform DUT vs Ref model verification
class rcc_scoreboard extends uvm_scoreboard;
`uvm_component_utils(rcc_scoreboard)
uvm_analysis_export #(rcc_transaction) out_dut;
uvm_analysis_export #(rcc_transaction) out_ref;
uvm_tlm_analysis_fifo #(rcc_transaction) dut_fifo;
uvm_tlm_analysis_fifo #(rcc_transaction) ref_fifo;
//logic [7:0] dut_output, ref_output;
virtual rcc_if vif;
rcc_transaction dut_trans;
rcc_transaction ref_trans;
function new(string name= "", uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
out_dut = new("out_dut", this);
out_ref = new("out_ref", this);
dut_fifo = new("dut_fifo", this);
ref_fifo = new("ref_fifo", this);
dut_trans = rcc_transaction::type_id::create("dut_trans", this);
ref_trans = rcc_transaction::type_id::create("ref_trans", this);
// get the virtual interface handle that was stored in the uvm_config_db
// and assign it to the local vif field
if(!uvm_config_db#(virtual rcc_if)::get(this, "", "vif", vif))
`uvm_fatal("No Vif", {"virtual interface must be set for: ", get_full_name(), ".vif"});
endfunction: build_phase
function void connect_phase(uvm_phase phase);
out_dut.connect(dut_fifo.analysis_export);
out_ref.connect(ref_fifo.analysis_export);
endfunction: connect_phase
task run_phase(uvm_phase phase);
forever begin
@(posedge vif.digit_clk)
dut_fifo.get(dut_trans);
ref_fifo.get(ref_trans);
// using assertion to check the ref model and dut output
assert(dut_trans.dout == ref_trans.dout)
// $display("SUCCESS %c %c %d \n", dut_trans.dout, ref_trans.dout, $time);
else
$error("ERROR %c %c %d \n", dut_trans.dout, ref_trans.dout, $time);
end// forever
endtask
endclass