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

Subversion Repositories ssbcc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 sinclairrf
/*******************************************************************************
2
 *
3
 * Copyright 2015, Sinclair R.F., Inc.
4
 *
5
 * Test bench for the servo_motor peripheral.
6
 *
7
 ******************************************************************************/
8
 
9
`timescale 1ns/1ps
10
 
11
module tb;
12
 
13
// 8 MHz clock
14
reg s_clk = 1'b1;
15
always @ (s_clk)
16
  s_clk <= #62.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_triple_0;
25
wire    s_triple_1;
26
wire    s_triple_2;
27
wire    s_done;
28
tb_servo_motor uut(
29
  // synchronous reset and processor clock
30
  .i_rst        (s_rst),
31
  .i_clk        (s_clk),
32
  // 3 linked servo motor
33
  .o_triple_0   (s_triple_0),
34
  .o_triple_1   (s_triple_1),
35
  .o_triple_2   (s_triple_2),
36
  // program termination
37
  .o_done       (s_done)
38
);
39
 
40
always @ (s_triple_0)
41
  $display("%12d : s_triple_0 %h", $time, s_triple_0);
42
always @ (s_triple_1)
43
  $display("%12d : s_triple_1 %h", $time, s_triple_1);
44
always @ (s_triple_2)
45
  $display("%12d : s_triple_2 %h", $time, s_triple_2);
46
 
47
always @ (posedge s_clk)
48
  if (s_done)
49
    $finish;
50
 
51
//initial begin
52
//  $dumpfile("tb.vcd");
53
//  $dumpvars();
54
//end
55
 
56
endmodule

powered by: WebSVN 2.1.0

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