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] - Rev 49

Go to most recent revision | Compare with Previous | Blame | View Log

//////////////////////////////////////////////////////////////////////
////                                                              ////
//// Copyright (C) 2018 Authors and OPENCORES.ORG                 ////
////                                                              ////
//// This source file may be used and distributed without         ////
//// restriction provided that this copyright statement is not    ////
//// removed from the file and that any derivative work contains  ////
//// the original copyright notice and the associated disclaimer. ////
////                                                              ////
//// This source file is free software; you can redistribute it   ////
//// and/or modify it under the terms of the GNU Lesser General   ////
//// Public License as published by the Free Software Foundation; ////
//// either version 2.1 of the License, or (at your option) any   ////
//// later version.                                               ////
////                                                              ////
//// This source is distributed in the hope that it will be       ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
//// PURPOSE.  See the GNU Lesser General Public License for more ////
//// details.                                                     ////
////                                                              ////
//// You should have received a copy of the GNU Lesser General    ////
//// Public License along with this source; if not, download it   ////
//// from http://www.opencores.org/lgpl.shtml                     ////
////                                                              ////
//////////////////////////////////////////////////////////////////////

// --------------------------------------------------------------------
typedef enum {AVF_REQUEST, AVF_TRANSACTION} avf_sequence_item_t;

// --------------------------------------------------------------------
class avf_sequence_item
  extends uvm_sequence_item;
  `uvm_object_utils(avf_sequence_item)

  // --------------------------------------------------------------------
  avf_sequence_item_t kind = AVF_TRANSACTION;
  video_frame_class f_h;
  mailbox #(video_frame_class) frame_buffer;
  random_delay delay_h;
  random_delay_type_e sof_delay = REGULAR;
  random_delay_type_e eol_delay = REGULAR;
  random_delay_type_e eof_delay = REGULAR;
  random_delay_type_e pixel_delay = SPORADIC;
  random_delay_type_e slave_delay = REGULAR;

  // --------------------------------------------------------------------
  function int unsigned get_delay(bit eol, bit eof);
    if(eof)
      return(delay_h.get(eof_delay));
    else if(eol)
      return(delay_h.get(eol_delay));
    else
      return(delay_h.get(pixel_delay));
  endfunction : get_delay

  // --------------------------------------------------------------------
  function new(string name = "");
    super.new(name);
    delay_h = new();
  endfunction : new

  // // --------------------------------------------------------------------
  // function bit do_compare(uvm_object rhs, uvm_comparer comparer);
    // avf_sequence_item tested;
    // bit same;

    // if (rhs==null)
      // `uvm_fatal(get_type_name(), "| %m | comparison to a null pointer");

    // if (!$cast(tested,rhs))
      // same = 0;
    // else
      // same  = super.do_compare(rhs, comparer);

    // return same;
  // endfunction : do_compare

  // // --------------------------------------------------------------------
  // function void do_copy(uvm_object rhs);
    // avf_sequence_item item;
    // assert(rhs != null) else
      // `uvm_fatal(get_type_name(), "| %m | copy null transaction");
    // super.do_copy(rhs);
    // assert($cast(item,rhs)) else
      // `uvm_fatal(get_type_name(), "| %m | failed cast");
    // delay     = item.delay;
    // command   = item.command;
    // wr_full   = item.wr_full;
    // rd_empty  = item.rd_empty;
    // wr_data   = item.wr_data;
    // rd_data   = item.rd_data;
    // count     = item.count;
  // endfunction : do_copy

  // // --------------------------------------------------------------------
  // function string convert2string();
    // string s0, s1, s2, s3;
    // s0 = $sformatf( "| %m | wr | rd | full | empty |\n");
    // s1 = $sformatf( "| %m | %1h  | %1h  | %1h    | %1h     |\n"
                  // , (command == FIFO_WR) || (command == FIFO_BOTH)
                  // , (command == FIFO_RD) || (command == FIFO_BOTH)
                  // , wr_full
                  // , rd_empty
                  // );
    // s2 = $sformatf("| %m | wr_data: %h\n" , wr_data);
    // s3 = $sformatf("| %m | rd_data: %h\n" , rd_data);

    // if(command == FIFO_NULL)
      // return {s1, s0};
    // else if(command == FIFO_BOTH)
      // return {s3, s2, s1, s0};
    // else if(command == FIFO_WR)
      // return {s2, s1, s0};
    // else if(command == FIFO_RD)
      // return {s3, s1, s0};
  // endfunction : convert2string

// --------------------------------------------------------------------
endclass : avf_sequence_item

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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