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

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [peripherals/] [tb/] [PWM_8bit/] [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 2012, Sinclair R.F., Inc.
4
 *
5
 * Test bench for the PWM_8bit 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_pwm_sr;
25
wire            s_pwm_sn;
26
wire            s_pwm_si;
27
wire      [2:0] s_pwm_multi;
28
wire            s_done;
29
tb_PWM_8bit #(
30
  .G_CLK_FREQ_HZ        (100_000_000)
31
)uut(
32
  // synchronous reset and processor clock
33
  .i_rst        (s_rst),
34
  .i_clk        (s_clk),
35
  .o_pwm_sr     (s_pwm_sr),
36
  .o_pwm_sn     (s_pwm_sn),
37
  .o_pwm_si     (s_pwm_si),
38
  .o_pwm_multi  (s_pwm_multi),
39
  .o_done       (s_done)
40
);
41
 
42
always @ (s_pwm_sr, s_pwm_sn, s_pwm_si, s_pwm_multi)
43
  $display("%12d : %b %b %b %3b", $time, s_pwm_sr, s_pwm_sn, s_pwm_si, s_pwm_multi);
44
 
45
always @ (posedge s_clk)
46
  if (s_done)
47
    $finish;
48
 
49
endmodule

powered by: WebSVN 2.1.0

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