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

Subversion Repositories pairing

[/] [pairing/] [trunk/] [testbench/] [test_duursma_lee_algo.v] - Blame information for rev 22

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 homer.xing
`timescale 1ns / 1ns
2 7 homer.xing
`include "../rtl/inc.v"
3 4 homer.xing
 
4
module test_duursma_lee_algo;
5
 
6 22 homer.xing
    // Inputs
7
    reg clk;
8
    reg reset;
9
    reg [`WIDTH:0] xp,yp,xr,yr;
10 4 homer.xing
 
11 22 homer.xing
    // Outputs
12
    wire done;
13 4 homer.xing
    wire [`W6:0] out;
14
    wire [`WIDTH:0] o0,o1,o2,o3,o4,o5;
15
 
16 22 homer.xing
    // Instantiate the Unit Under Test (UUT)
17
    duursma_lee_algo uut (
18
        .clk(clk),
19
        .reset(reset),
20
        .xp(xp),
21
        .yp(yp),
22
        .xr(xr),
23
        .yr(yr),
24
        .done(done),
25
        .out(out)
26
    );
27 4 homer.xing
 
28
    assign {o5,o4,o3,o2,o1,o0} = out;
29
 
30 22 homer.xing
    initial begin
31
        // Initialize Inputs
32
        clk = 0;
33
        reset = 0;
34
        xp = 0;
35
        yp = 0;
36
        xr = 0;
37
        yr = 0;
38 4 homer.xing
 
39 22 homer.xing
        // Wait 100 ns for global reset to finish
40
        #100;
41 4 homer.xing
 
42 22 homer.xing
        // Add stimulus here
43 4 homer.xing
        xp = 194'haa5a8129a02a0544a4409a500045458901280969815aa820;
44
        yp = 194'h1414a205a21a4428968985650895464402249258428049204;
45
        xr = 194'h614011499522506668a01a20988812468a5aa8641aa24595;
46
        yr = 194'haa01145590659058124a0261410682860225909182a92189;
47
        @ (negedge clk); reset = 1;
48
        @ (negedge clk); reset = 0;
49
        @ (posedge done);
50 8 homer.xing
        #100;
51 4 homer.xing
        if (out !== {{194'h289898988a561125505a60640642444905248262004845aa6,194'ha6a208a8402504225588a080a124292404061158a96a6a44},{194'h2266261625a9894a45640906a242a99295816525895a98a25,194'h21868921614220506a96a9285119405a15550801829589214},{194'h26a4200680102269189946046919aa804602128246999685a,194'h1a558028a5a964224120a9212a9089a0966a0918a41612219}})
52
          begin
53
            $display("E");
54
            $display("o0=%h",o0);
55
            $display("o1=%h",o1);
56
            $display("o2=%h",o2);
57
            $display("o3=%h",o3);
58
            $display("o4=%h",o4);
59
            $display("o5=%h",o5);
60
          end
61
        #100;
62
        $finish;
63 22 homer.xing
    end
64 4 homer.xing
 
65
    always #5 clk = ~clk;
66
endmodule
67
 

powered by: WebSVN 2.1.0

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