OpenCores
URL https://opencores.org/ocsvn/avalon-wishbone-bridge/avalon-wishbone-bridge/trunk

Subversion Repositories avalon-wishbone-bridge

[/] [avalon-wishbone-bridge/] [trunk/] [UVM/] [av_master_agent/] [av_mm_transaction.sv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sumanta.ch
import uvm_pkg::*;
2
 
3
 
4
 
5
class av_mm_transaction #(AW =32, DW=128, TW= 2) extends uvm_sequence_item;
6
`uvm_object_utils(av_mm_transaction);
7
rand t_direction dir;
8
rand logic [AW-1:0] addr;
9
rand logic [DW-1:0] data;
10
rand logic [TW-1:0] tags;
11
rand delay_t stall_time;
12
constraint DIR {dir dist {AVALON_RD:=50,AVALON_WAIT:=50};}
13
constraint ADDR_RANGE {addr inside {[32'h40000000:32'h80000000]};}
14
constraint DATA_RANGE {data inside {[0:32'hFFFFFFFF]};}
15
constraint TAG_RANGE {tags inside {[0:3]};}
16
constraint RANDOM_STALL {
17
                stall_time dist{
18
 
19
                        [1:100]:=50
20
                };
21
}
22
 
23
covergroup cov;
24
        ADDR: coverpoint addr;
25
        TYPE: coverpoint dir;
26
        TAG:  coverpoint tags;
27
endgroup
28
 
29
 
30
function new(string name="av_mm_transaction");
31
        super.new(name);
32
        cov=new();
33
endfunction
34
 
35
//method to randomize real
36
//function void post_randomize;
37
//      stall_time=$bitstoreal(stall_time_i);
38
//endfunction
39
 
40
function void do_record(uvm_recorder recorder);
41
        super.do_record(recorder);
42
        `uvm_record_attribute(recorder.tr_handle,"address",addr);
43
        `uvm_record_field("data",data);
44
        //if ((dir ==AVALON_RD) && (recorder.tr_handle !=0))
45
        if ((dir ==AVALON_RD))
46
                $add_color(recorder.tr_handle,"red");
47
        else
48
                $add_color(recorder.tr_handle,"green");
49
endfunction
50
endclass

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.