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

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [verif/] [tb/] [tb_top.v] - Diff between revs 27 and 29

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

Rev 27 Rev 29
Line 127... Line 127...
wire [3:0]         spi_cs_n      ;
wire [3:0]         spi_cs_n      ;
 
 
wire               clkout        ;
wire               clkout        ;
wire               reset_out_n   ;
wire               reset_out_n   ;
 
 
 
parameter I2CS_ADDR    = 7'b0010_000; // I2C Slave Addr
//----------------------------------------
//----------------------------------------
 
 
digital_core  u_core (
digital_core  u_core (
 
 
             . aresetn             (reset_n            ),
             . aresetn             (reset_n            ),
Line 163... Line 164...
             .uart0_txd            (                   ),
             .uart0_txd            (                   ),
 
 
             .spi_sck              (spi_sck            ),
             .spi_sck              (spi_sck            ),
             .spi_so               (spi_so             ),
             .spi_so               (spi_so             ),
             .spi_si               (spi_si             ),
             .spi_si               (spi_si             ),
             .spi_cs_n             (spi_cs_n           )
             .spi_cs_n             (spi_cs_n           ),
 
 
 
        // i2cm clock line
 
             .i2cm_scl_i           (scl                ),
 
             .i2cm_scl_o           (i2cm_scl_o         ),
 
             .i2cm_scl_oen         (i2cm_scl_oen       ),
 
 
 
        // i2cm data line
 
             .i2cm_sda_i           (sda                ),
 
             .i2cm_sda_o           (i2cm_sda_o         ),
 
             .i2cm_sda_oen         (i2cm_sda_oen       )
 
 
 
 
 
 
        );
        );
 
 
 
                // create i2c lines
 
        delay m0_scl (i2cm_scl_oen ? 1'bz : i2cm_scl_o, scl),
 
              m0_sda (i2cm_sda_oen ? 1'bz : i2cm_sda_o, sda);
 
 
 
        pullup p1(scl); // pullup scl line
 
        pullup p2(sda); // pullup sda line
 
 
 
        // hookup i2c slave model
 
        i2c_slave_model #(I2CS_ADDR) tb_i2cs (
 
             .scl                  (scl                  ),
 
             .sda                  (sda                  )
 
        );
 
 
 
 
 uart_agent tb_uart (
 uart_agent tb_uart (
               . test_clk          (uart_clk_16x       ),
               . test_clk          (uart_clk_16x       ),
               . sin               (si                 ),
               . sin               (si                 ),
               . dsr_n             (                   ),
               . dsr_n             (                   ),
Line 262... Line 287...
 
 
   if ( $test$plusargs("uart_test_1") )
   if ( $test$plusargs("uart_test_1") )
       uart_test1();
       uart_test1();
   else if ( $test$plusargs("spi_test_1") )
   else if ( $test$plusargs("spi_test_1") )
       spi_test1();
       spi_test1();
 
   else if ( $test$plusargs("i2cm_test_1") )
 
       i2cm_test1();
   else begin
   else begin
     // 8051 Test Cases
     // 8051 Test Cases
     #80000000
     #80000000
     $display("time ",$time, "\n faulire: end of time\n \n");
     $display("time ",$time, "\n faulire: end of time\n \n");
   end
   end
Line 295... Line 322...
      $finish;
      $finish;
  end
  end
end
end
 
 
 
 
 
module delay (in, out);
 
  input  in;
 
  output out;
 
 
 
  assign out = in;
 
 
 
  specify
 
    (in => out) = (600,600);
 
  endspecify
 
endmodule
 
 
 
 
`include "uart_test1.v"
`include "uart_test1.v"
`include "spi_test1.v"
`include "spi_test1.v"
 
`include "i2cm_test1.v"
`include "tb_tasks.v"
`include "tb_tasks.v"
`include "spi_tasks.v"
`include "spi_tasks.v"
 
 
 
 
endmodule
endmodule

powered by: WebSVN 2.1.0

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