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

Subversion Repositories ssbcc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 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
// 10 MHz clock
14
reg s_clk = 1'b1;
15
always @ (s_clk)
16
  s_clk <= #50 ~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
reg s_interrupt = 1'b0;
25
initial begin
26
  @ (negedge s_rst);
27
  repeat(`INT_DELAY) @ (posedge s_clk);
28
  s_interrupt = 1'b1;
29
  @ (posedge s_clk);
30
  s_interrupt = 1'b0;
31
end
32
 
33
tb_interrupt uut(
34
  // synchronous reset and processor clock
35
  .i_rst        (s_rst),
36
  .i_clk        (s_clk),
37
  // external interrupt
38
  .i_interrupt  (s_interrupt)
39
);
40
 
41
initial begin
42
//  $dumpfile("tb.vcd");
43
//  $dumpvars();
44
  repeat(50) @ (posedge s_clk);
45
  @ (negedge s_clk);
46
  $finish;
47
end
48
 
49
endmodule

powered by: WebSVN 2.1.0

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