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

Subversion Repositories tiny_tate_bilinear_pairing

[/] [tiny_tate_bilinear_pairing/] [trunk/] [group_size_is_911_bits/] [testbench/] [test_const.v] - Blame information for rev 11

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

Line No. Rev Author Line
1 11 homer.hsin
`timescale 1ns / 1ps
2
`define P 20 // clock period
3
 
4
module test_const;
5
 
6
        // Inputs
7
    reg clk;
8
        reg [5:0] addr;
9
 
10
        // Outputs
11
        wire [1187:0] out;
12
        wire effective;
13
    reg [1187:0] w_out;
14
    reg w_effective;
15
 
16
        // Instantiate the Unit Under Test (UUT)
17
        const_ uut (
18
        .clk(clk),
19
                .addr(addr),
20
                .out(out),
21
                .effective(effective)
22
        );
23
 
24
        initial begin
25
                // Initialize Inputs
26
                addr = 0; clk = 0;
27
 
28
                // Wait 100 ns for global reset to finish
29
                #100;
30
 
31
                // Add stimulus here
32
        @ (negedge clk);
33
        addr = 1; w_out = 0; w_effective = 1;
34
        #(`P); check;
35
        addr = 2; w_out = 1;
36
        #(`P); check;
37
        addr = 4; w_out = {6'b000101, 1182'd0};
38
        #(`P); check;
39
        addr = 8; w_out = {6'b001001, 1182'd0};
40
        #(`P); check;
41
        addr = 16; w_out = {6'b010101, 1182'd0};
42
        #(`P); check;
43
        addr = 0; w_out = 0; w_effective = 0;
44
        #(`P); check;
45
        $display("Good");
46
        $finish;
47
        end
48
 
49
    initial #100 forever #(`P/2) clk = ~clk;
50
 
51
    task check;
52
      begin
53
        if (out !== w_out || effective !== w_effective)
54
            $display("E %d %h %h", addr, out, w_out);
55
      end
56
    endtask
57
endmodule

powered by: WebSVN 2.1.0

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