URL
https://opencores.org/ocsvn/apb2spi/apb2spi/trunk
Subversion Repositories apb2spi
Compare Revisions
- This comparison shows the changes necessary to convert path
/apb2spi/trunk
- from Rev 5 to Rev 6
- ↔ Reverse comparison
Rev 5 → Rev 6
/tb/tb_top.sv
0,0 → 1,103
////////////////////////////////////////////////////////////////////// |
//// //// |
//// APB- SPI 0.1 IP Core VIP //// |
//// //// |
//// This file is part of the APB- SPI 0.1 IP Core project //// |
//// http://www.opencores.org/cores/APB- SPI 0.1 VIP for IP Core //// |
//// //// |
//// Description //// |
//// Implementation of APB-SPI bridge IP core testing using //// |
//// UVM based VIP core's TB_top document. This top level block //// |
//// includes interfaces of APB slave and SPI master and will be //// |
//// driven using UVM based agents //// |
//// //// |
//// To Do: //// |
//// Addition of exact signals of the Top level DUT. //// |
//// Due to different configurations that may be possible, the //// |
//// interfaces and hence the UVM driver signals might vary //// |
//// //// |
//// Author(s): //// |
//// - Srikumar Kadagambadi, email@opencores.org //// |
//// //// |
////////////////////////////////////////////////////////////////////// |
//// //// |
//// Copyright (C) 2009 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 //// |
//// //// |
////////////////////////////////////////////////////////////////////// |
`timescale 1ns/1ps |
`include "uvm_macros.svh" |
`include "defines.v" |
`include "prj_pkg.sv" |
|
module tb_top; |
|
import uvm_pkg::*; |
import prj_pkg::*; |
|
apb_if apb_if1(); |
spi_if spi_if1(); |
|
APB_SPI_top A1( |
.PCLK (apb_if1.PCLK), |
.PRESETn(apb_if1.PRESETn), |
.PADDR (apb_if1.PADDR), |
.PWRITE (apb_if1.PWRITE), |
.PSEL (apb_if1.PSEL), |
.PENABLE(apb_if1.PENABLE), |
.PWDATA (apb_if1.PWDATA), |
.PRDATA (apb_if1.PRDATA), |
.PREADY (apb_if1.PREADY), |
.TrFr (apb_if1.TrFr), |
.SCLK (spi_if1.SCLK), |
.MISO (spi_if1.MISO), |
.MOSI (spi_if1.MOSI), |
.SS (spi_if1.SS) |
); |
|
initial |
begin |
uvm_config_db#(virtual apb_if)::set(null,"*","apb_vif",apb_if1); |
uvm_config_db#(virtual spi_if)::set(null,"*","spi_vif",spi_if1); |
//run_test(); |
run_test("apb_spi_basic_rw_test"); |
end |
|
initial |
begin |
$dumpfile("rcc.vcd"); |
$dumpvars(0,tb_top); |
end |
|
initial |
begin |
apb_if1.PCLK = 1'b0; |
apb_if1.PRESETn = 1'b0; |
#20 apb_if1.PRESETn = 1'b1; |
#100 $finish; |
end |
|
initial |
forever apb_if1.PCLK = #5 ~apb_if1.PCLK; |
|
endmodule |