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

Subversion Repositories uart2bus_testbench

[/] [uart2bus_testbench/] [trunk/] [tb/] [uart_top.sv] - Diff between revs 2 and 3

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

Rev 2 Rev 3
Line 1... Line 1...
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
//
//
//                             UART2BUS VERIFICATION
//                             UART2BUS VERIFICATION
//
//
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// CREATOR    : HANY SALAH
// CREATOR    : HANY SALAH
// PROJECT    : UART2BUS UVM TEST BENCH
// PROJECT    : UART2BUS UVM TEST BENCH
// UNIT       : TOP MODULE
// UNIT       : TOP MODULE
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
// TITLE      : UART Top
// TITLE      : UART TOP
// DESCRIPTION: This
// DESCRIPTION: THIS TOP MODULE THAT INHERITS THE ALL TESTBENCH COMPONENT AND CONNECT THEM TO DUT.
//-----------------------------------------------------------------------------
//              ALSO INCLUDES THE CLOCK GENERATION MECHANISM.
 
//-------------------------------------------------------------------------------------------------
// LOG DETAILS
// LOG DETAILS
//-------------
//-------------
// VERSION      NAME        DATE        DESCRIPTION
// VERSION      NAME        DATE        DESCRIPTION
//    1       HANY SALAH    11012016    FILE CREATION
//    1       HANY SALAH    11012016    FILE CREATION
//-----------------------------------------------------------------------------
//    2       HANY SALAH    18022016    IMPROVE BLOCK DESCRIPTION & ADD COMMENTS
// 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
// ALL COPYRIGHTS ARE RESERVED FOR THE PRODUCER ONLY .THIS FILE IS PRODUCED FOR OPENCORES MEMBERS
// CREATOR'S PERMISSION
// ONLY AND IT IS PROHIBTED TO USE THIS MATERIAL WITHOUT THE CREATOR'S PERMISSION
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
  `include "defin_lib.svh"
  `include "defin_lib.svh"
  `include "uart2bus_top.v"
  `include "uart2bus_top.v"
 
 
module uart_top_tb;
module uart_top_tb;
 
 
  import uvm_pkg::*;
  import uvm_pkg::*;
  import uart_pkg::*;
  import uart_pkg::*;
 
 
  `include "uvm_macros.svh"
  `include "uvm_macros.svh"
 
 
 
  // Global System clock
  logic clk_glob;
  logic clk_glob;
 
 
 
  // UART clock (1/Baud Rate)
  logic clk_uart;
  logic clk_uart;
 
 
 
  // Glocal Asynchronous reset
  logic reset;
  logic reset;
 
 
  assign rf_inf.int_req = arb_inf.int_req;
  assign rf_inf.int_req = arb_inf.int_req;
  assign rf_inf.int_gnt = arb_inf.int_gnt;
  assign rf_inf.int_gnt = arb_inf.int_gnt;
 
 
 
  // Initiate UART BFM
  uart_interface  uart_inf (.reset(reset),
  uart_interface  uart_inf (.reset(reset),
                            .clock(clk_uart));
                            .clock(clk_uart));
 
 
 
  // Initiate Register File BFM
  rf_interface    rf_inf (.reset(reset),
  rf_interface    rf_inf (.reset(reset),
                          .clock(clk_glob));
                          .clock(clk_glob));
 
 
 
  // Initiate Arbiter BFM
  uart_arbiter    arb_inf (.reset (reset),
  uart_arbiter    arb_inf (.reset (reset),
                           .clock(clk_glob));
                           .clock(clk_glob));
 
 
 
  // Initiate Design Under Test DUT
  uart2bus_top      dut(  .clock(clk_glob),
  uart2bus_top      dut(  .clock(clk_glob),
                          .reset(reset),
                          .reset(reset),
                          //.ser_in(serial_out),
 
                          .ser_in(uart_inf.ser_out),
                          .ser_in(uart_inf.ser_out),
                          .ser_out(uart_inf.ser_in),
                          .ser_out(uart_inf.ser_in),
                          .int_address(rf_inf.int_address),
                          .int_address(rf_inf.int_address),
                          .int_wr_data(rf_inf.int_wr_data),
                          .int_wr_data(rf_inf.int_wr_data),
                          .int_write(rf_inf.int_write),
                          .int_write(rf_inf.int_write),
Line 70... Line 77...
    clk_uart = 1'b0;
    clk_uart = 1'b0;
    #100;
    #100;
    reset = 1'b0;
    reset = 1'b0;
    end
    end
 
 
 
  // Clock Signals Generator
  initial
  initial
    begin
    begin
    fork
    fork
      forever
      forever
        begin
        begin
Line 83... Line 91...
      forever
      forever
        begin
        begin
        #(`buad_clk_period/2) clk_uart = ~clk_uart;
        #(`buad_clk_period/2) clk_uart = ~clk_uart;
        #((`buad_clk_period/2)+1) clk_uart = ~clk_uart;
        #((`buad_clk_period/2)+1) clk_uart = ~clk_uart;
        end
        end
        begin
 
        #(500000000);
 
        $error("Exceed the maximum limited time for simulation ..");
 
        $finish;
 
        end
 
    join
    join
    end
    end
 
 
 
 
  initial
  initial
Line 100... Line 103...
 
 
    uvm_config_db#(virtual rf_interface)::set(uvm_root::get(), "*", "rf_inf",rf_inf);
    uvm_config_db#(virtual rf_interface)::set(uvm_root::get(), "*", "rf_inf",rf_inf);
 
 
    uvm_config_db#(virtual uart_arbiter)::set(uvm_root::get(),"*","arb_inf",arb_inf);
    uvm_config_db#(virtual uart_arbiter)::set(uvm_root::get(),"*","arb_inf",arb_inf);
 
 
    run_test("write_text_mode");
    //run_test("write_text_mode");
    //run_test("read_text_mode");
    //run_test("read_text_mode");
    //run_test("nop_command_mode");
    //run_test("nop_command_mode");
    //run_test("read_command_mode");
    //run_test("read_command_mode");
    //run_test("write_command_mode");
    //run_test("write_command_mode");
 
    run_test("text_mode_test");
    end
    end
 
 
 
 
endmodule:uart_top_tb
endmodule:uart_top_tb
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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