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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [basal/] [sim/] [tests/] [tb_fifo/] [s_debug.svh] - Blame information for rev 44

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 44 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
class s_debug
29
  extends uvm_sequence #(fifo_sequence_item);
30
  `uvm_object_utils(s_debug)
31
 
32
  // --------------------------------------------------------------------
33
  function new(string name = "s_debug");
34
    super.new(name);
35
  endfunction
36
 
37
  // --------------------------------------------------------------------
38
  task body();
39
    logic wr_full = 0;
40
    logic rd_empty = 1;
41
    int count;
42
    fifo_sequence_item item;
43
    fifo_sequence_item c_item;
44
    item = fifo_sequence_item::type_id::create("item");
45
 
46
    repeat(64)
47
    begin
48
      $cast(c_item, item.clone);
49
      start_item(c_item);
50
      assert(c_item.randomize());
51
      if(wr_full)
52
        c_item.command = FIFO_RD;
53
      else if(rd_empty)
54
        c_item.command = FIFO_WR;
55
      finish_item(c_item);
56
      wr_full = c_item.wr_full;
57
      rd_empty = c_item.rd_empty;
58
    end
59
 
60
    count = c_item.count;
61
    repeat(count)
62
    begin
63
      $cast(c_item, item.clone);
64
      start_item(c_item);
65
      assert(c_item.randomize());
66
      c_item.command = FIFO_RD;
67
      finish_item(c_item);
68
    end
69
  endtask: body
70
 
71
// --------------------------------------------------------------------
72
endclass : s_debug

powered by: WebSVN 2.1.0

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