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

Subversion Repositories ssbcc

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

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

Line No. Rev Author Line
1 2 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     [25:0] s_vb;
25
wire            s_wr_26bit;
26
wire            s_wr_18bit;
27
wire      [8:0] s_min;
28
wire            s_wr_9bit;
29
wire            s_done;
30
tb_big_outport uut(
31
  // synchronous reset and processor clock
32
  .i_rst        (s_rst),
33
  .i_clk        (s_clk),
34
  // very big outport signal
35
  .o_vb         (s_vb),
36
  .o_wr_26bit   (s_wr_26bit),
37
  .o_wr_18bit   (s_wr_18bit),
38
  // minimal composite signal
39
  .o_min        (s_min),
40
  .o_wr_9bit    (s_wr_9bit),
41
  // termination signal
42
  .o_done       (s_done)
43
);
44
 
45
always @ (posedge s_clk) begin
46
  if (s_wr_26bit)
47
    $display("26-bit:  0x%08H", s_vb[0+:26]);
48
  if (s_wr_18bit)
49
    $display("18-bit:  0x%06H", s_vb[0+:18]);
50
  if (s_wr_9bit)
51
    $display(" 9-bit:  0x%03H", s_min);
52
end
53
 
54
always @ (posedge s_clk)
55
  if (s_done)
56
    $finish;
57
 
58
endmodule

powered by: WebSVN 2.1.0

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