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

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [peripherals/] [tb/] [adder_16bit/] [tb.v] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sinclairrf
/*******************************************************************************
2
 *
3
 * Copyright 2012, Sinclair R.F., Inc.
4
 *
5
 * Test bench for the adder_16bit peripheral.
6
 *
7
 ******************************************************************************/
8
 
9
`timescale 1ns/1ps
10
 
11
module tb;
12
 
13
// 100 MHz clock
14
reg s_clk = 1'b1;
15
always @ (s_clk)
16
  s_clk <= #5 ~s_clk;
17
 
18
reg s_rst = 1'b1;
19
initial begin
20
  repeat (5) @ (posedge s_clk);
21
  s_rst = 1'b0;
22
end
23
 
24
wire [7:0] s_v_out;
25
wire       s_v_wr;
26
wire       s_done;
27
tb_adder_16bit uut(
28
  // synchronous reset and processor clock
29
  .i_rst        (s_rst),
30
  .i_clk        (s_clk),
31
  .o_v_out      (s_v_out),
32
  .o_v_wr       (s_v_wr),
33
  .o_done       (s_done)
34
);
35
 
36
always @ (posedge s_clk)
37
  if (s_v_wr)
38
    $display("%12d : %h", $time, s_v_out);
39
 
40
always @ (posedge s_clk)
41
  if (s_done)
42
    $finish;
43
 
44
endmodule

powered by: WebSVN 2.1.0

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