data/full_repos/permissive/427414354/test/DelayPUF_tb.v
1: b"%Error: data/full_repos/permissive/427414354/test/DelayPUF_tb.v:23: Cannot find file containing module: 'DelayPUF'\n    DelayPUF DUT (clk, reset, challenge, run, result);\n    ^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/427414354/test,data/full_repos/permissive/427414354/DelayPUF\n             data/full_repos/permissive/427414354/test,data/full_repos/permissive/427414354/DelayPUF.v\n             data/full_repos/permissive/427414354/test,data/full_repos/permissive/427414354/DelayPUF.sv\n             DelayPUF\n             DelayPUF.v\n             DelayPUF.sv\n             obj_dir/DelayPUF\n             obj_dir/DelayPUF.v\n             obj_dir/DelayPUF.sv\n%Error: Exiting due to 1 error(s)\n"
module DelayPUF_tb;
	

	localparam EXPECTED_SIGNATURE = 256'heffeffff1001effe000000004bb4ffff10010000effe1001ffffffffb44b;
   localparam HALF_PERIOD = 5;
	localparam PUF_LENGTH = 8;

    wire result;
    reg clk, run, reset;
    reg [PUF_LENGTH-1:0] challenge;
    reg [255:0] signature;
    reg stopSig;
    integer i;

    DelayPUF DUT (clk, reset, challenge, run, result);

	initial begin
		signature = 0;
		stopSig = 1'b0;
		reset = 1'b0;
	   run = 1'b0;

	   $display("Testing the full challenge range...");
		
		for (i = 0; i < 256; i = i + 1) begin
		    run = 1'b0;
		    challenge = i[7:0];
		    #100;
		    run = 1'b1;
		    #100;


		    signature = {result, signature[255: 1]};
		end

		$display("PUF signature: 0x%0h", signature);

		if (signature == EXPECTED_SIGNATURE) begin
			$display("Test passed");
		end else begin
			$display("Test failed");
		end

		stopSig = 1'b1;

	end


	always @(result)
	begin

	end


	always
	begin
	    clk = 1'b1; 
	    #HALF_PERIOD; 
	    clk = 1'b0;
	    #HALF_PERIOD;
	end
    
	always @(posedge clk)
	begin
		if (stopSig == 1'b1)
	    	$finish;
	end
    
endmodule
module DelayPUF_tb;

	

	localparam EXPECTED_SIGNATURE = 256'heffeffff1001effe000000004bb4ffff10010000effe1001ffffffffb44b;
   localparam HALF_PERIOD = 5;
	localparam PUF_LENGTH = 8;

    wire result;
    reg clk, run, reset;
    reg [PUF_LENGTH-1:0] challenge;
    reg [255:0] signature;
    reg stopSig;
    integer i;

    DelayPUF DUT (clk, reset, challenge, run, result);

	initial begin
		signature = 0;
		stopSig = 1'b0;
		reset = 1'b0;
	   run = 1'b0;

	   $display("Testing the full challenge range...");
		
		for (i = 0; i < 256; i = i + 1) begin
		    run = 1'b0;
		    challenge = i[7:0];
		    #100;
		    run = 1'b1;
		    #100;


		    signature = {result, signature[255: 1]};
		end

		$display("PUF signature: 0x%0h", signature);

		if (signature == EXPECTED_SIGNATURE) begin
			$display("Test passed");
		end else begin
			$display("Test failed");
		end

		stopSig = 1'b1;

	end


	always @(result)
	begin

	end


	always
	begin
	    clk = 1'b1; 
	    #HALF_PERIOD; 
	    clk = 1'b0;
	    #HALF_PERIOD;
	end
    
	always @(posedge clk)
	begin
		if (stopSig == 1'b1)
	    	$finish;
	end
    
endmodule