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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fpga/] [mc/] [boards/] [s3e-500/] [doc/] [dac/] [dac_test.v] - Blame information for rev 288

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

Line No. Rev Author Line
1 233 hellwig
//
2
// dac_test.v -- test bench for DAC control circuit
3
//
4
 
5
`include "dac.v"
6
 
7
`timescale 1ns/1ns
8
 
9
module dac_test;
10
 
11
  reg clk;                        // system clock (50 MHz)
12
  reg reset_in;                   // reset, input
13
  reg reset_s1;                   // reset, first synchronizer
14
  reg reset;                      // reset, second synchronizer
15
  reg [15:0] sample_l;
16
  reg [15:0] sample_r;
17
  wire next;
18
  wire sck;
19
  wire sdi;
20
  wire ld;
21
 
22
  // instantiate the controller
23
  dac dac_1(clk, reset,
24
            sample_l, sample_r, next,
25
            sck, sdi, ld);
26
 
27
  // simulation control
28
  initial begin
29
    #0     $dumpfile("dump.vcd");
30
           $dumpvars(0, dac_test);
31
           sample_l = 16'h0FF0;
32
           sample_r = 16'hAA55;
33
           clk = 1;
34
           reset_in = 1;
35
    #145   reset_in = 0;
36
    #90000 $finish;
37
  end
38
 
39
  // clock generator
40
  always begin
41
    #10 clk = ~clk;               // 20 nsec cycle time
42
  end
43
 
44
  // reset synchronizer
45
  always @(posedge clk) begin
46
    reset_s1 <= reset_in;
47
    reset <= reset_s1;
48
  end
49
 
50
endmodule

powered by: WebSVN 2.1.0

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