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

Subversion Repositories uart2bus_testbench

[/] [uart2bus_testbench/] [trunk/] [tb/] [agent/] [transaction/] [uart_transaction.svh] - Diff between revs 13 and 14

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 13 Rev 14
Line 16... Line 16...
// VERSION      NAME        DATE        DESCRIPTION
// VERSION      NAME        DATE        DESCRIPTION
//    1       HANY SALAH    31122015    FILE CREATION
//    1       HANY SALAH    31122015    FILE CREATION
//    2       HANY SALAH    01012016    COMPLETE ATTRIBUTES
//    2       HANY SALAH    01012016    COMPLETE ATTRIBUTES
//    3       HANY SALAH    26012016    ADD VALID TRANSACTION CONSTRAINTS
//    3       HANY SALAH    26012016    ADD VALID TRANSACTION CONSTRAINTS
//    4       HANY SALAH    11022016    IMPROVE BLOCK DESCRIPTION AND ADD CODING COMMENTS
//    4       HANY SALAH    11022016    IMPROVE BLOCK DESCRIPTION AND ADD CODING COMMENTS
 
//    5       HANY SALAH    25062017    ADD DO_COPY, DO_COMPARE METHODS
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// ALL COPYRIGHTS ARE RESERVED FOR THE PRODUCER ONLY .THIS FILE IS PRODUCED FOR OPENCORES MEMBERS
// ALL COPYRIGHTS ARE RESERVED FOR THE PRODUCER ONLY .THIS FILE IS PRODUCED FOR OPENCORES MEMBERS
// ONLY AND IT IS PROHIBTED TO USE THIS MATERIAL WITHOUT THE CREATOR'S PERMISSION
// ONLY AND IT IS PROHIBTED TO USE THIS MATERIAL WITHOUT THE CREATOR'S PERMISSION
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
class uart_transaction extends uvm_sequence_item;
class uart_transaction extends uvm_sequence_item;
Line 78... Line 79...
 
 
  // Represent the request to use false data through the read command.
  // Represent the request to use false data through the read command.
  rand req          false_data_en;
  rand req          false_data_en;
 
 
  // Represents random idle time before and after the UART stimulus
  // Represents random idle time before and after the UART stimulus
  rand time         time_before,time_after;
  rand int         time_before,time_after;
 
 
  // Represents the acknowledge byte driven by the DUT
  // Represents the acknowledge byte driven by the DUT
  byte            acknowledge;
  byte            acknowledge;
 
 
  // Represent the number of the transaction through the whole sequences
  // Represent the number of the transaction through the whole sequences
  int             _id;
  int             _id;
 
 
  // Represent the scale that is used to scale the idle time values described above
  // Represent the scale that is used to scale the idle time values described above
  int unsigned scale = 100;
  int unsigned scale = 100;
 
 
  `uvm_object_utils(uart_transaction)
  `uvm_object_utils_begin(uart_transaction)
 
     `uvm_field_int(wrong_prefix,UVM_ALL_ON)
 
     `uvm_field_enum(mode,_mode,UVM_ALL_ON)
 
     `uvm_field_enum(eol_type,_eoltype,UVM_ALL_ON)
 
     `uvm_field_enum(space_type,_spacetype1,UVM_ALL_ON)
 
     `uvm_field_enum(space_type,_spacetype2,UVM_ALL_ON)
 
     `uvm_field_enum(command,_command,UVM_ALL_ON)
 
     `uvm_field_enum(req,_reqack,UVM_ALL_ON)
 
     `uvm_field_enum(req,_reqinc,UVM_ALL_ON)
 
     `uvm_field_enum(char_type,_chartype,UVM_ALL_ON)
 
     `uvm_field_enum(arbit,_arbit,UVM_ALL_ON)
 
     `uvm_field_enum(req,false_data_en,UVM_ALL_ON)
 
     `uvm_field_int(wrong_prefix,UVM_ALL_ON)
 
     `uvm_field_int(space_wrong1,UVM_ALL_ON)
 
     `uvm_field_int(space_wrong2,UVM_ALL_ON)
 
     `uvm_field_array_int(_data,UVM_ALL_ON)
 
     `uvm_field_array_int(false_data,UVM_ALL_ON)
 
     `uvm_field_int(length_data,UVM_ALL_ON)
 
     `uvm_field_int(eol_wrong,UVM_ALL_ON)
 
     `uvm_field_int(address,UVM_ALL_ON)
 
     `uvm_field_int(time_before,UVM_ALL_ON)
 
     `uvm_field_int(time_after,UVM_ALL_ON)
 
     `uvm_field_int(acknowledge,UVM_ALL_ON)
 
     `uvm_field_int(_id,UVM_ALL_ON)
 
     `uvm_field_int(scale,UVM_ALL_ON)
 
  `uvm_object_utils_end
 
 
  function new (string name ="uart_transaction");
  function new (string name ="uart_transaction");
    super.new(name);
    super.new(name);
  endfunction: new
  endfunction: new
 
 
Line 146... Line 172...
      }
      }
  }
  }
 
 
  extern function void do_copy (uvm_object rhs);
  extern function void do_copy (uvm_object rhs);
 
 
  extern function bit do_compare(uvm_object rhs);
  //extern function bit do_compare(uvm_object rhs);
 
 
 
  extern function void do_print(uvm_printer printer=null);
 
 
 
 
endclass:uart_transaction
endclass:uart_transaction
 
 
 
 
Line 184... Line 212...
  false_data_en =_trans.false_data_en;
  false_data_en =_trans.false_data_en;
  _id           =_trans._id;
  _id           =_trans._id;
endfunction:do_copy
endfunction:do_copy
 
 
 
 
function bit uart_transaction::do_compare(uvm_object rhs,
/*function bit uart_transaction::do_compare(uvm_object rhs,
                                          uvm_comparer comparer);
                                          uvm_comparer comparer);
   uart_transaction t;
   uart_transaction t;
   do_compare=super.do_compare(rhs,comparer);
   do_compare=super.do_compare(rhs,comparer);
   $cast(t,rhs);
   $cast(t,rhs);
   do_compare &= comparer.compare_field_ ("_mode",_mode,rhs._mode);
   do_compare &= comparer.compare_field_ ("_mode",_mode,rhs._mode);
Line 211... Line 239...
   do_compare &= comparer.compare_field_ ("acknowledge",acknowledge, rhs.acknowledge);
   do_compare &= comparer.compare_field_ ("acknowledge",acknowledge, rhs.acknowledge);
   do_compare &= comparer.compare_field_ ("wrong_prefix",wrong_prefix, rhs.wrong_prefix);
   do_compare &= comparer.compare_field_ ("wrong_prefix",wrong_prefix, rhs.wrong_prefix);
   do_compare &= comparer.compare_field_ ("false_data",false_data, rhs.false_data);
   do_compare &= comparer.compare_field_ ("false_data",false_data, rhs.false_data);
   do_compare &= comparer.compare_field_ ("false_data_en",false_data_en, rhs.false_data_en);
   do_compare &= comparer.compare_field_ ("false_data_en",false_data_en, rhs.false_data_en);
   do_compare &= comparer.compare_field_ ("_id",_id, rhs._id);
   do_compare &= comparer.compare_field_ ("_id",_id, rhs._id);
endfunction // do_compare
endfunction // do_compare*/
 
 
 
function void uart_transaction::do_print(uvm_printer printer=null);
 
   super.do_print(printer);
 
endfunction // do_print

powered by: WebSVN 2.1.0

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