data/full_repos/permissive/425063349/Hash.v
1: b'%Error: data/full_repos/permissive/425063349/Hash.v:18: Cannot find file containing module: \'word1\'\n word1 w1(charA, i);\n ^~~~~\n        ... Looked in:\n             data/full_repos/permissive/425063349,data/full_repos/permissive/425063349/word1\n             data/full_repos/permissive/425063349,data/full_repos/permissive/425063349/word1.v\n             data/full_repos/permissive/425063349,data/full_repos/permissive/425063349/word1.sv\n             word1\n             word1.v\n             word1.sv\n             obj_dir/word1\n             obj_dir/word1.v\n             obj_dir/word1.sv\n%Error: data/full_repos/permissive/425063349/Hash.v:19: Cannot find file containing module: \'word2\'\n word2 w2(charB, i);\n ^~~~~\n%Error: data/full_repos/permissive/425063349/Hash.v:20: Cannot find file containing module: \'word3\'\n word3 w3(charC, i);\n ^~~~~\n%Error: data/full_repos/permissive/425063349/Hash.v:22: Cannot find file containing module: \'Counter\'\n Counter hashCounter(hashComplete, i, N, up, Reset, Clock);\n ^~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/425063349/Hash.v:41: Operator ADD expects 64 bits on the RHS, but RHS\'s VARREF \'charA\' generates 8 bits.\n                                                              : ... In instance Hash\n        Z <= (Zshift + Z + charA);  \n                         ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/425063349/Hash.v:46: Operator ADD expects 64 bits on the RHS, but RHS\'s VARREF \'charB\' generates 8 bits.\n                                                              : ... In instance Hash\n        Z <= (Zshift + Z + charB);  \n                         ^\n%Warning-WIDTH: data/full_repos/permissive/425063349/Hash.v:51: Operator ADD expects 64 bits on the RHS, but RHS\'s VARREF \'charC\' generates 8 bits.\n                                                              : ... In instance Hash\n        Z <= (Zshift + Z + charC);  \n                         ^\n%Error: Exiting due to 4 error(s), 3 warning(s)\n'
module Hash(output reg [63:0] Z, output hashDone, input [2:0] Wfound, input Reset, Clock);
	reg [2:0] WfoundStorage;
	wire [3:0] wlen1, wlen2, wlen3;
	assign wlen1 = 4'd5; 
	assign wlen2 = 4'd6;
	assign wlen3 = 4'd6;
	
	reg [3:0] N;
	wire [3:0] i;
	wire hashComplete;
	assign hashDone = hashComplete;
	wire up;
	assign up = ~Reset;
	wire [7:0] charA, charB, charC; 
	
	word1 w1(charA, i);
	word2 w2(charB, i);
	word3 w3(charC, i);
	
	Counter hashCounter(hashComplete, i, N, up, Reset, Clock);
	


	reg [63:0] Zshift;
	always @ (negedge Clock)
		Zshift = Z << 5;
	
	always @ (posedge Clock or posedge Reset) begin
		if (Reset) begin
			Z <= 64'd5381;
			N <= 4'b0001;
			WfoundStorage <= Wfound;
		end
		else begin
			case (WfoundStorage)
				3'b100: begin
							N <= wlen1;
							if (~hashComplete)
								Z <= (Zshift + Z + charA);  
						end
				3'b010: begin
							N <= wlen2;
							if (~hashComplete)
								Z <= (Zshift + Z + charB);  
						end
				3'b001: begin
							N <= wlen3;
							if (~hashComplete)
								Z <= (Zshift + Z + charC);  
						end
				default: N <= 4'b0001; 	
			endcase
		end
	end
endmodule
module Hash(output reg [63:0] Z, output hashDone, input [2:0] Wfound, input Reset, Clock);

	reg [2:0] WfoundStorage;
	wire [3:0] wlen1, wlen2, wlen3;
	assign wlen1 = 4'd5; 
	assign wlen2 = 4'd6;
	assign wlen3 = 4'd6;
	
	reg [3:0] N;
	wire [3:0] i;
	wire hashComplete;
	assign hashDone = hashComplete;
	wire up;
	assign up = ~Reset;
	wire [7:0] charA, charB, charC; 
	
	word1 w1(charA, i);
	word2 w2(charB, i);
	word3 w3(charC, i);
	
	Counter hashCounter(hashComplete, i, N, up, Reset, Clock);
	


	reg [63:0] Zshift;
	always @ (negedge Clock)
		Zshift = Z << 5;
	
	always @ (posedge Clock or posedge Reset) begin
		if (Reset) begin
			Z <= 64'd5381;
			N <= 4'b0001;
			WfoundStorage <= Wfound;
		end
		else begin
			case (WfoundStorage)
				3'b100: begin
							N <= wlen1;
							if (~hashComplete)
								Z <= (Zshift + Z + charA);  
						end
				3'b010: begin
							N <= wlen2;
							if (~hashComplete)
								Z <= (Zshift + Z + charB);  
						end
				3'b001: begin
							N <= wlen3;
							if (~hashComplete)
								Z <= (Zshift + Z + charC);  
						end
				default: N <= 4'b0001; 	
			endcase
		end
	end
endmodule