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 14 and 16

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

Rev 14 Rev 16
Line 63... Line 63...
 
 
  uart_config       _config;
  uart_config       _config;
 
 
  int               matched ;
  int               matched ;
 
 
 
  `ifdef UVM_1p2
 
  uvm_default_report_server    report_server;
 
  `else
  uvm_report_server    report_server;
  uvm_report_server    report_server;
 
  `endif
  int               hit_text_cov=90;
  int               hit_text_cov=90;
  int               hit_bin_cov=90;
  int               hit_bin_cov=90;
  int               hit_mode_cov=90;
  int               hit_mode_cov=90;
 
 
  `uvm_component_utils_begin(uart_base_test)
  `uvm_component_utils_begin(uart_base_test)
Line 85... Line 88...
    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);
 
 
    printer = new();
    printer = new();
    report_server = new();
    report_server = new("report_server");
    env_configuration();
    env_configuration();
    TE_configuration();
    TE_configuration();
    uvm_config_db#(uart_config)::set(this,"*","UART_CONFIGURATION",_config);
    uvm_config_db#(uart_config)::set(this,"*","UART_CONFIGURATION",_config);
    uvm_resource_db #(int)::set("coverage_cloud","text_coverage",0,null);
    uvm_resource_db #(int)::set("coverage_cloud","text_coverage",0,null);
    uvm_resource_db #(int)::set("coverage_cloud","binary_coverage",0,null);
    uvm_resource_db #(int)::set("coverage_cloud","binary_coverage",0,null);
Line 110... Line 113...
    _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();
 function void TE_configuration();
    report_server.set_server(report_server);
 
    printer.knobs.depth = 3;
    printer.knobs.depth = 3;
    uvm_resource_db#(int)::set("Reporting","matched_packets",0,null);
    uvm_resource_db#(int)::set("Reporting","matched_packets",0,null);
    uvm_root::get().set_timeout(10s);
    uvm_root::get().set_timeout(10s);
    //uvm_root::get().finish_on_completion=1'b0;
    //uvm_root::get().finish_on_completion=1'b0;
 endfunction // TE_configuration
 endfunction // TE_configuration
Line 124... Line 126...
  endtask:run_phase
  endtask:run_phase
 
 
  function void report_phase (uvm_phase phase);
  function void report_phase (uvm_phase phase);
     int num_errors;
     int num_errors;
     string status;
     string status;
     num_errors = report_server.get_severity_count(UVM_ERROR);
     num_errors = report_server.get_severity_count(UVM_INFO);
 
     //num_errors = uvm_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";
     if(num_errors == 0) status =  "PASSED";
     else status = "FAILED";
     else status = "FAILED";
     $display("--------------------------------------------------\n");
     $display("--------------------------------------------------\n");
     $display("\t\t SIMULATION %s \n",status);
     $display("\t\t SIMULATION %s \n",status);

powered by: WebSVN 2.1.0

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