data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/rsa/test/modexp_1_N_test.v
1: b'%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/rsa/test/modexp_1_N_test.v:116: syntax error, unexpected \'@\'\n  @(negedge clk);\n  ^\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/rsa/test/modexp_1_N_test.v:120: syntax error, unexpected \'@\'\n   @(negedge clk);\n   ^\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/rsa/test/modexp_1_N_test.v:126: syntax error, unexpected \'@\'\n  @(negedge clk);\n  ^\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/rsa/test/modexp_1_N_test.v:134: syntax error, unexpected \'@\'\n   @(negedge clk);\n   ^\n%Error: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/rsa/test/modexp_1_N_test.v:140: syntax error, unexpected \'@\'\n     @(negedge clk);\n     ^\n%Warning-STMTDLY: data/full_repos/permissive/486954482/TinyGarble/circuit_synthesis/rsa/test/modexp_1_N_test.v:145: Unsupported: Ignoring delay on this delayed statement.\n  always  #5  clk=~clk; \n          ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: Exiting due to 5 error(s), 1 warning(s)\n'
function [N-1:0] modexp_f;
		input [N-1:0] m;
		input [N-1:0] e;
		input [N-1:0] n;
		reg  [2*N-1:0] mm;
		integer i, start;
		begin
			$display("modexp_f: m =%d e =%d n=%d", m, e, n);
			start = -1;
			for(i=N-1;i>=0;i=i-1)
			begin
				if(e[i] && start == -1)
				begin
					start = i;
				end
			end
			
			modexp_f = m;
			$display("%d", modexp_f);
			for(i=start-1;i>=0;i=i-1)
			begin
				mm = modexp_f;
				mm = mm*mm;
				modexp_f = mm%n;
				$display("%d", modexp_f);
				if(e[i])
				begin
					mm = modexp_f;
					mm = mm * m;
					modexp_f = mm%n;
					$display("* %d", modexp_f);
				end
			end
		end
	endfunction
function [N-1:0] modexp_f;

		input [N-1:0] m;
		input [N-1:0] e;
		input [N-1:0] n;
		reg  [2*N-1:0] mm;
		integer i, start;
		begin
			$display("modexp_f: m =%d e =%d n=%d", m, e, n);
			start = -1;
			for(i=N-1;i>=0;i=i-1)
			begin
				if(e[i] && start == -1)
				begin
					start = i;
				end
			end
			
			modexp_f = m;
			$display("%d", modexp_f);
			for(i=start-1;i>=0;i=i-1)
			begin
				mm = modexp_f;
				mm = mm*mm;
				modexp_f = mm%n;
				$display("%d", modexp_f);
				if(e[i])
				begin
					mm = modexp_f;
					mm = mm * m;
					modexp_f = mm%n;
					$display("* %d", modexp_f);
				end
			end
		end
	endfunction