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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fpga/] [mc/] [boards/] [xsa-xst-3/] [doc/] [dac/] [dac_test.v] - Blame information for rev 314

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

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

powered by: WebSVN 2.1.0

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