aboutsummaryrefslogtreecommitdiffstats
path: root/tests/verilog/bug656.v
blob: 068d045fdca9b7eb6af3ed6f8d17da6898627513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module top #(
	parameter WIDTH = 6
) (
	input [WIDTH-1:0] a_i,
	input [WIDTH-1:0] b_i,
	output [WIDTH-1:0] z_o
);
	genvar g;
	generate
		for (g = 0; g < WIDTH; g = g + 1) begin
			if (g > 2) begin
				wire tmp;
				assign tmp = a_i[g] || b_i[g];
				assign z_o[g] = tmp;
			end
			else begin
				assign z_o[g] = a_i[g] && b_i[g];
			end
		end
	endgenerate
endmodule
be -- covered by the GNU General Public License. This exception does not -- however invalidate any other reasons why the executable file might be -- covered by the GNU Public License. with Interfaces.C; use Interfaces.C; with System; use System; package body Windows_Default_Path is subtype DWORD is Interfaces.C.Unsigned_Long; subtype HINSTANCE is Address; function GetModuleFileName (Inst : HINSTANCE; Buf : Address; Size : DWORD) return DWORD; pragma Import (Stdcall, GetModuleFileName, "GetModuleFileNameA"); function Get_Windows_Exec_Path return String is File : String (1 .. 256); Size : DWORD; P : Natural; begin -- Get exe file path. Size := GetModuleFileName (Null_Address, File'Address, File'Length); if Size = 0 or Size = File'Length then return "{cannot find install path}\lib"; end if; -- Remove Program file. P := Natural (Size); while P > 0 loop exit when File (P) = '\'; exit when File (P) = ':' and P = 2; P := P - 1; end loop; if File (P) = '\' and P > 1 then -- Remove directory P := P - 1; while P > 0 loop exit when File (P) = '\'; exit when File (P) = ':' and P = 2; P := P - 1; end loop; end if; return File (1 .. P); end Get_Windows_Exec_Path; end Windows_Default_Path;