OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [BFM/] [src/] [axis_video_frame/] [avf_sequence_item.svh] - Blame information for rev 45

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 45 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2018 Authors and OPENCORES.ORG                 ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 2.1 of the License, or (at your option) any   ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27
 
28
// --------------------------------------------------------------------
29
typedef enum {AVF_REQUEST, AVF_TRANSACTION} avf_sequence_item_t;
30
 
31
// --------------------------------------------------------------------
32
class avf_sequence_item
33
  extends uvm_sequence_item;
34
  `uvm_object_utils(avf_sequence_item)
35
 
36
  // --------------------------------------------------------------------
37
  avf_sequence_item_t kind = AVF_TRANSACTION;
38
  video_frame_class f_h;
39
  mailbox #(video_frame_class) frame_buffer;
40
  random_delay delay_h;
41
  random_delay_type_e sof_delay = REGULAR;
42
  random_delay_type_e eol_delay = REGULAR;
43
  random_delay_type_e eof_delay = REGULAR;
44
  random_delay_type_e pixel_delay = SPORADIC;
45
  random_delay_type_e slave_delay = REGULAR;
46
 
47
  // --------------------------------------------------------------------
48
  function int unsigned get_delay(bit eol, bit eof);
49
    if(eof)
50
      return(delay_h.get(eof_delay));
51
    else if(eol)
52
      return(delay_h.get(eol_delay));
53
    else
54
      return(delay_h.get(pixel_delay));
55
  endfunction : get_delay
56
 
57
  // --------------------------------------------------------------------
58
  function new(string name = "");
59
    super.new(name);
60
    delay_h = new();
61
  endfunction : new
62
 
63
  // // --------------------------------------------------------------------
64
  // function bit do_compare(uvm_object rhs, uvm_comparer comparer);
65
    // avf_sequence_item tested;
66
    // bit same;
67
 
68
    // if (rhs==null)
69
      // `uvm_fatal(get_type_name(), "| %m | comparison to a null pointer");
70
 
71
    // if (!$cast(tested,rhs))
72
      // same = 0;
73
    // else
74
      // same  = super.do_compare(rhs, comparer);
75
 
76
    // return same;
77
  // endfunction : do_compare
78
 
79
  // // --------------------------------------------------------------------
80
  // function void do_copy(uvm_object rhs);
81
    // avf_sequence_item item;
82
    // assert(rhs != null) else
83
      // `uvm_fatal(get_type_name(), "| %m | copy null transaction");
84
    // super.do_copy(rhs);
85
    // assert($cast(item,rhs)) else
86
      // `uvm_fatal(get_type_name(), "| %m | failed cast");
87
    // delay     = item.delay;
88
    // command   = item.command;
89
    // wr_full   = item.wr_full;
90
    // rd_empty  = item.rd_empty;
91
    // wr_data   = item.wr_data;
92
    // rd_data   = item.rd_data;
93
    // count     = item.count;
94
  // endfunction : do_copy
95
 
96
  // // --------------------------------------------------------------------
97
  // function string convert2string();
98
    // string s0, s1, s2, s3;
99
    // s0 = $sformatf( "| %m | wr | rd | full | empty |\n");
100
    // s1 = $sformatf( "| %m | %1h  | %1h  | %1h    | %1h     |\n"
101
                  // , (command == FIFO_WR) || (command == FIFO_BOTH)
102
                  // , (command == FIFO_RD) || (command == FIFO_BOTH)
103
                  // , wr_full
104
                  // , rd_empty
105
                  // );
106
    // s2 = $sformatf("| %m | wr_data: %h\n" , wr_data);
107
    // s3 = $sformatf("| %m | rd_data: %h\n" , rd_data);
108
 
109
    // if(command == FIFO_NULL)
110
      // return {s1, s0};
111
    // else if(command == FIFO_BOTH)
112
      // return {s3, s2, s1, s0};
113
    // else if(command == FIFO_WR)
114
      // return {s2, s1, s0};
115
    // else if(command == FIFO_RD)
116
      // return {s3, s1, s0};
117
  // endfunction : convert2string
118
 
119
// --------------------------------------------------------------------
120
endclass : avf_sequence_item

powered by: WebSVN 2.1.0

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