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

Subversion Repositories ssbcc

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

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

Line No. Rev Author Line
1 3 sinclairrf
/*******************************************************************************
2
 *
3
 * Copyright 2013, Sinclair R.F., Inc.
4
 *
5
 * Test bench for big_outport 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            s_min;
25
wire      [3:0] s_med;
26
wire      [7:0] s_max;
27
wire            s_done;
28
tb_wide_strobe uut(
29
  // synchronous reset and processor clock
30
  .i_rst        (s_rst),
31
  .i_clk        (s_clk),
32
  // narrow strobe bus
33
  .o_min        (s_min),
34
  // medium-width strobe bus
35
  .o_med        (s_med),
36
  // maximum-width strobe bus
37
  .o_max        (s_max),
38
  // termination signal
39
  .o_done       (s_done)
40
);
41
 
42
always @ (posedge s_clk) begin
43
  if ( s_min) $display("%12d : %d", $time, s_min);
44
  if (|s_med) $display("%12d : %h", $time, s_med);
45
  if (|s_max) $display("%12d : %h", $time, s_max);
46
end
47
 
48
always @ (posedge s_clk)
49
  if (s_done)
50
    $finish;
51
 
52
endmodule

powered by: WebSVN 2.1.0

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