data/full_repos/permissive/441359809/src/yosys/techlibs/nexus/parse_init.vh
1: b'%Warning-WIDTH: data/full_repos/permissive/441359809/src/yosys/techlibs/nexus/parse_init.vh:9: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s SUB generates 8 bits.\n    parse_init[(i * 4) +: 4] = (c - "0");\n                             ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/441359809/src/yosys/techlibs/nexus/parse_init.vh:11: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s ADD generates 32 or 8 bits.\n    parse_init[(i * 4) +: 4] = (c - "A") + 10;\n                             ^\n%Warning-WIDTH: data/full_repos/permissive/441359809/src/yosys/techlibs/nexus/parse_init.vh:13: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s ADD generates 32 or 8 bits.\n    parse_init[(i * 4) +: 4] = (c - "a") + 10;\n                             ^\n%Warning-WIDTH: data/full_repos/permissive/441359809/src/yosys/techlibs/nexus/parse_init.vh:26: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s SUB generates 8 bits.\n    parse_init_64[(i * 4) +: 4] = (c - "0");\n                                ^\n%Warning-WIDTH: data/full_repos/permissive/441359809/src/yosys/techlibs/nexus/parse_init.vh:28: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s ADD generates 32 or 8 bits.\n    parse_init_64[(i * 4) +: 4] = (c - "A") + 10;\n                                ^\n%Warning-WIDTH: data/full_repos/permissive/441359809/src/yosys/techlibs/nexus/parse_init.vh:30: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s ADD generates 32 or 8 bits.\n    parse_init_64[(i * 4) +: 4] = (c - "a") + 10;\n                                ^\n%Error: Exiting due to 6 warning(s)\n'
function [15:0] parse_init;
	input [((2+(16/4))*8)-1:0] init;
	reg [7:0] c;
	integer i;
	begin
		for (i = 0; i < (16/4); i = i + 1) begin
			c = init[(i * 8) +: 8];
			if (c >= "0" && c <= "9")
				parse_init[(i * 4) +: 4] = (c - "0");
			else if (c >= "A" && c <= "F")
				parse_init[(i * 4) +: 4] = (c - "A") + 10;
			else if (c >= "a" && c <= "f")
				parse_init[(i * 4) +: 4] = (c - "a") + 10;
		end
	end
endfunction
function [15:0] parse_init;

	input [((2+(16/4))*8)-1:0] init;
	reg [7:0] c;
	integer i;
	begin
		for (i = 0; i < (16/4); i = i + 1) begin
			c = init[(i * 8) +: 8];
			if (c >= "0" && c <= "9")
				parse_init[(i * 4) +: 4] = (c - "0");
			else if (c >= "A" && c <= "F")
				parse_init[(i * 4) +: 4] = (c - "A") + 10;
			else if (c >= "a" && c <= "f")
				parse_init[(i * 4) +: 4] = (c - "a") + 10;
		end
	end
endfunction