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

Subversion Repositories pairing

[/] [pairing/] [trunk/] [testbench/] [test_tate_pairing.v] - Blame information for rev 10

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

Line No. Rev Author Line
1 8 homer.xing
`timescale 1ns / 1ps
2
`include "../rtl/inc.v"
3
 
4
module test_tate_pairing;
5
 
6
        // Inputs
7
        reg clk;
8
        reg reset;
9
        reg [`WIDTH:0] x1, y1, x2, y2;
10 10 homer.xing
        reg [7:0] sel;
11 8 homer.xing
    reg [149:0] o0,o1,o2,o3,o4,o5,o6,o7;
12
    reg [`W6:0] wish;
13
 
14
        // Outputs
15
        wire done;
16
        wire [149:0] out;
17
 
18
        // Instantiate the Unit Under Test (UUT)
19
        tate_pairing uut (
20
                .clk(clk),
21
                .reset(reset),
22
                .x1(x1),
23
                .y1(y1),
24
                .x2(x2),
25
                .y2(y2),
26
                .done(done),
27
                .sel(sel),
28
                .out(out)
29
        );
30
 
31
        initial begin
32
                // Initialize Inputs
33
                clk = 0;
34
                reset = 0;
35
                x1 = 0;
36
                y1 = 0;
37
                x2 = 0;
38
                y2 = 0;
39
                sel = 0;
40
        o0 = 0;
41
        o1 = 0;
42
        o2 = 0;
43
        o3 = 0;
44
        o4 = 0;
45
        o5 = 0;
46
        o6 = 0;
47
        o7 = 0;
48
 
49
                // Wait 100 ns for global reset to finish
50
                #100;
51
 
52
                // Add stimulus here
53
        x1 = 194'h6a18950064046a122a14118668466a262a91509688159890;
54
        y1 = 194'h69112569422aa0a25224aa010888066061124a8685566825;
55
        x2 = 194'h155945aa8924654812564110544995a28845901211454814;
56
        y2 = 194'h8481099460280628960a82559920000a99a2106955289a40;
57
        wish = {{194'h148a60225a14a81189aa09a22848104418aa6505801246205,194'h520094820010a12551069915258a58848501052005a85609},{194'ha484046591204499252009806480198a2549624a5181695,194'h21905848428558a806805a4518844049651812a88955a8868},{194'h5565059245921805891121a95a6949564201a2a068910558,194'ha6298884510610298462582969269a122260a05a8241055a}};
58
        @ (negedge clk); reset = 1;
59
        @ (negedge clk); reset = 0;
60
        @ (posedge done); @ (negedge clk);
61 10 homer.xing
        sel = 8'b0000_0001; #20; o0=out;
62
        sel = 8'b0000_0010; #20; o1=out;
63
        sel = 8'b0000_0100; #20; o2=out;
64
        sel = 8'b0000_1000; #20; o3=out;
65
        sel = 8'b0001_0000; #20; o4=out;
66
        sel = 8'b0010_0000; #20; o5=out;
67
        sel = 8'b0100_0000; #20; o6=out;
68
        sel = 8'b1000_0000; #20; o7=out;
69
        if ({o7[113:0],o6,o5,o4,o3,o2,o1,o0} !== wish) begin $display("E"); end
70 8 homer.xing
        $finish;
71
        end
72
 
73
    always #5 clk = ~clk;
74
endmodule
75
 

powered by: WebSVN 2.1.0

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