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

Subversion Repositories uart2bus_testbench

[/] [uart2bus_testbench/] [trunk/] [tb/] [test/] [uart_test.svh] - Diff between revs 9 and 10

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

Rev 9 Rev 10
Line 62... Line 62...
 
 
  uart_config       _config;
  uart_config       _config;
 
 
  int               matched ;
  int               matched ;
 
 
 
  uvm_report_server    report_server;
 
 
  `uvm_component_utils_begin(uart_base_test)
  `uvm_component_utils_begin(uart_base_test)
     `uvm_field_int(matched,UVM_ALL_ON)
     `uvm_field_int(matched,UVM_ALL_ON)
  `uvm_component_utils_end
  `uvm_component_utils_end
 
 
  function new (string name,uvm_component parent);
  function new (string name,uvm_component parent);
Line 77... Line 79...
 
 
    env = uart_env::type_id::create("env",this);
    env = uart_env::type_id::create("env",this);
 
 
    _config = uart_config::type_id::create("_config",this);
    _config = uart_config::type_id::create("_config",this);
 
 
    uvm_config_db#(uart_config)::set(this,"*","UART_CONFIGURATION",_config);
 
 
 
    printer = new();
    printer = new();
    printer.knobs.depth = 3;
    report_server = new();
    env_configuration();
    env_configuration();
    uvm_resource_db#(int)::set("Reporting","matched_packets",0,null);
    TE_configuration();
 
    uvm_config_db#(uart_config)::set(this,"*","UART_CONFIGURATION",_config);
  endfunction:build_phase
  endfunction:build_phase
 
 
  function void connect_phase (uvm_phase phase);
  function void connect_phase (uvm_phase phase);
    super.connect_phase(phase);
    super.connect_phase(phase);
  endfunction:connect_phase
  endfunction:connect_phase
Line 100... Line 101...
    _config._paritymode   = parity_off;
    _config._paritymode   = parity_off;
    _config.response_time = 8680;
    _config.response_time = 8680;
    _config.use_false_data= no;
    _config.use_false_data= no;
  endfunction:env_configuration
  endfunction:env_configuration
 
 
 
 function void TE_configuration();
 
    report_server.set_server(report_server);
 
    printer.knobs.depth = 3;
 
    uvm_resource_db#(int)::set("Reporting","matched_packets",0,null);
 
    uvm_root::get().set_timeout(10s);
 
 endfunction // TE_configuration
 
 
  task run_phase (uvm_phase phase);
  task run_phase (uvm_phase phase);
    phase.phase_done.set_drain_time(this,5000);
    phase.phase_done.set_drain_time(this,5000);
  endtask:run_phase
  endtask:run_phase
 
 
  function void report_phase (uvm_phase phase);
  function void report_phase (uvm_phase phase);
 
     int num_errors;
 
     string status;
 
     num_errors = report_server.get_severity_count(UVM_ERROR);
     uvm_resource_db#(int)::read_by_name("Reporting","matched_packets",matched);
     uvm_resource_db#(int)::read_by_name("Reporting","matched_packets",matched);
 
     if(num_errors == 0) status =  "PASSED";
 
     else status = "FAILED";
 
     $display("--------------------------------------------------\n");
 
     $display("\t\t SIMULATION %s \n",status);
 
     $display("--------------------------------------------------");
     `uvm_info("FINAL STATUS",$sformatf("The number of matched packets are %0d",matched),UVM_NONE);
     `uvm_info("FINAL STATUS",$sformatf("The number of matched packets are %0d",matched),UVM_NONE);
  endfunction // report_phase
  endfunction // report_phase
 
 
endclass:uart_base_test
endclass:uart_base_test
 
 

powered by: WebSVN 2.1.0

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