data/full_repos/permissive/439731184/one_time_pad/otp_tb.v
1: b'%Error: data/full_repos/permissive/439731184/one_time_pad/otp_tb.v:1: Cannot find include file: otp.v\n`include "otp.v" \n         ^~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/439731184/one_time_pad,data/full_repos/permissive/439731184/otp.v\n             data/full_repos/permissive/439731184/one_time_pad,data/full_repos/permissive/439731184/otp.v.v\n             data/full_repos/permissive/439731184/one_time_pad,data/full_repos/permissive/439731184/otp.v.sv\n             otp.v\n             otp.v.v\n             otp.v.sv\n             obj_dir/otp.v\n             obj_dir/otp.v.v\n             obj_dir/otp.v.sv\n%Error: data/full_repos/permissive/439731184/one_time_pad/otp_tb.v:16: Unsupported or unknown PLI call: $seed_rng\n    $seed_rng;  \n    ^~~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/439731184/one_time_pad/otp_tb.v:18: Unsupported: Ignoring delay on this delayed statement.\n    #N_TESTS $display("%0d TESTS PASSED (width: %0d)\\n", N_TESTS, WIDTH);\n    ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/439731184/one_time_pad/otp_tb.v:23: Unsupported: Ignoring delay on this delayed statement.\nalways #1 clk = !clk;\n       ^\n%Error: data/full_repos/permissive/439731184/one_time_pad/otp_tb.v:27: Unsupported or unknown PLI call: $random_from_c\n    $random_from_c(message);\n    ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/439731184/one_time_pad/otp_tb.v:28: Unsupported or unknown PLI call: $random_from_c\n    $random_from_c(pad);\n    ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/439731184/one_time_pad/otp_tb.v:33: Unsupported or unknown PLI call: $otp_c\n    $otp_c(message, pad, cipher_from_c);\n    ^~~~~~\n%Error: Exiting due to 5 error(s), 2 warning(s)\n'
module otp_tb();

parameter WIDTH = 16;
parameter N_TESTS = 10000;

reg [WIDTH-1:0] message=0, pad=0;
wire [WIDTH-1:0] cipher;
reg [WIDTH-1:0] cipher_from_c=0;
reg clk = 0;

one_time_pad #(WIDTH) otp_i (message, pad, cipher);

initial begin
    $seed_rng;
    $display("\nmessage\tpad\tcipher\tcipher (expected)");
    #N_TESTS $display("%0d TESTS PASSED (width: %0d)\n", N_TESTS, WIDTH);
    $finish();
end


always #1 clk = !clk;


always @(posedge clk) begin
    $random_from_c(message);
    $random_from_c(pad);
end


always @(negedge clk) begin
    $otp_c(message, pad, cipher_from_c);
    $display("%h\t%h\t%h\t%h", message, pad, cipher, cipher_from_c);
    if (cipher != cipher_from_c) begin
        $display("TEST FAILED");
        $finish();
    end
end

endmodule
module otp_tb();


parameter WIDTH = 16;
parameter N_TESTS = 10000;

reg [WIDTH-1:0] message=0, pad=0;
wire [WIDTH-1:0] cipher;
reg [WIDTH-1:0] cipher_from_c=0;
reg clk = 0;

one_time_pad #(WIDTH) otp_i (message, pad, cipher);

initial begin
    $seed_rng;
    $display("\nmessage\tpad\tcipher\tcipher (expected)");
    #N_TESTS $display("%0d TESTS PASSED (width: %0d)\n", N_TESTS, WIDTH);
    $finish();
end


always #1 clk = !clk;


always @(posedge clk) begin
    $random_from_c(message);
    $random_from_c(pad);
end


always @(negedge clk) begin
    $otp_c(message, pad, cipher_from_c);
    $display("%h\t%h\t%h\t%h", message, pad, cipher, cipher_from_c);
    if (cipher != cipher_from_c) begin
        $display("TEST FAILED");
        $finish();
    end
end

endmodule