data/full_repos/permissive/468929885/verilog/rtl/el_adder.v
1: b"%Error: data/full_repos/permissive/468929885/verilog/rtl/el_adder.v:69: Cannot find file containing module: 'el_fa_fl'\n  el_fa_fl full_adder\n  ^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/468929885/verilog/rtl,data/full_repos/permissive/468929885/el_fa_fl\n             data/full_repos/permissive/468929885/verilog/rtl,data/full_repos/permissive/468929885/el_fa_fl.v\n             data/full_repos/permissive/468929885/verilog/rtl,data/full_repos/permissive/468929885/el_fa_fl.sv\n             el_fa_fl\n             el_fa_fl.v\n             el_fa_fl.sv\n             obj_dir/el_fa_fl\n             obj_dir/el_fa_fl.v\n             obj_dir/el_fa_fl.sv\n%Error: Exiting due to 1 error(s)\n"
module el_adder#(
	parameter						WIDTH = 32,
	
	parameter						RAIL_NUM = 2,
	parameter						IN_NUM = 3,
	parameter						OUT_NUM = 2
)
(

	input							rst,

	output	[WIDTH-1 : 0]			ack_a_o,
	input	[RAIL_NUM*WIDTH-1 : 0]	in_a,

	output	[WIDTH-1 : 0]			ack_b_o,
	input	[RAIL_NUM*WIDTH-1 : 0]	in_b,

	output							ack_c_o,
	input	[RAIL_NUM-1 : 0]		in_c,

	input	[WIDTH-1 : 0]			ack_s_i,
	output	[RAIL_NUM*WIDTH-1 : 0]	out_s,

	input							ack_c_i,
	output	[RAIL_NUM-1 : 0]		out_c

);

genvar pk_idx;
genvar unpk_idx;

`define PACK_ARRAY(PK_WIDTH,PK_LEN,PK_SRC,PK_DEST) generate for (pk_idx=0; pk_idx<(PK_LEN); pk_idx=pk_idx+1) begin assign PK_DEST[((PK_WIDTH)*pk_idx+((PK_WIDTH)-1)):((PK_WIDTH)*pk_idx)] = PK_SRC[pk_idx][((PK_WIDTH)-1):0]; end endgenerate

`define UNPACK_ARRAY(PK_WIDTH,PK_LEN,PK_DEST,PK_SRC) generate for (unpk_idx=0; unpk_idx<(PK_LEN); unpk_idx=unpk_idx+1) begin assign PK_DEST[unpk_idx][((PK_WIDTH)-1):0] = PK_SRC[((PK_WIDTH)*unpk_idx+(PK_WIDTH-1)):((PK_WIDTH)*unpk_idx)]; end endgenerate


genvar fa_idx;


wire [RAIL_NUM-1 : 0] carry_chain[WIDTH : 0];
wire carry_chain_ack[WIDTH : 0];

assign carry_chain[0] = in_c;
assign out_c = carry_chain[WIDTH];

assign ack_c_o = carry_chain_ack[0];
assign carry_chain_ack[WIDTH] = ack_c_i;


wire [RAIL_NUM-1 : 0] in_a_up [WIDTH-1 : 0];
`UNPACK_ARRAY(RAIL_NUM,WIDTH,in_a_up,in_a)
wire [RAIL_NUM-1 : 0] in_b_up [WIDTH-1 : 0];
`UNPACK_ARRAY(RAIL_NUM,WIDTH,in_b_up,in_b)



wire [RAIL_NUM-1 : 0] out_s_up [WIDTH-1 : 0];

`PACK_ARRAY(RAIL_NUM,WIDTH,out_s_up,out_s)



generate
	for (fa_idx = 0; fa_idx < WIDTH; fa_idx = fa_idx + 1)
	begin 
		el_fa_fl full_adder
		(

			.rst(rst),

			.ack_a_o(ack_a_o[fa_idx]),
			.in_a(in_a_up[fa_idx]),

			.ack_b_o(ack_b_o[fa_idx]),
			.in_b(in_b_up[fa_idx]),

			.ack_c_o(carry_chain_ack[fa_idx]),
			.in_c(carry_chain[fa_idx]),

			.ack_s_i(ack_s_i[fa_idx]),
			.out_s(out_s_up[fa_idx]),

			.ack_c_i(carry_chain_ack[fa_idx + 1]),
			.out_c(carry_chain[fa_idx + 1])

		);
	end
endgenerate 


endmodule
module el_adder#(
	parameter						WIDTH = 32,
	
	parameter						RAIL_NUM = 2,
	parameter						IN_NUM = 3,
	parameter						OUT_NUM = 2
)
(

	input							rst,

	output	[WIDTH-1 : 0]			ack_a_o,
	input	[RAIL_NUM*WIDTH-1 : 0]	in_a,

	output	[WIDTH-1 : 0]			ack_b_o,
	input	[RAIL_NUM*WIDTH-1 : 0]	in_b,

	output							ack_c_o,
	input	[RAIL_NUM-1 : 0]		in_c,

	input	[WIDTH-1 : 0]			ack_s_i,
	output	[RAIL_NUM*WIDTH-1 : 0]	out_s,

	input							ack_c_i,
	output	[RAIL_NUM-1 : 0]		out_c

);


genvar pk_idx;
genvar unpk_idx;

`define PACK_ARRAY(PK_WIDTH,PK_LEN,PK_SRC,PK_DEST) generate for (pk_idx=0; pk_idx<(PK_LEN); pk_idx=pk_idx+1) begin assign PK_DEST[((PK_WIDTH)*pk_idx+((PK_WIDTH)-1)):((PK_WIDTH)*pk_idx)] = PK_SRC[pk_idx][((PK_WIDTH)-1):0]; end endgenerate

`define UNPACK_ARRAY(PK_WIDTH,PK_LEN,PK_DEST,PK_SRC) generate for (unpk_idx=0; unpk_idx<(PK_LEN); unpk_idx=unpk_idx+1) begin assign PK_DEST[unpk_idx][((PK_WIDTH)-1):0] = PK_SRC[((PK_WIDTH)*unpk_idx+(PK_WIDTH-1)):((PK_WIDTH)*unpk_idx)]; end endgenerate


genvar fa_idx;


wire [RAIL_NUM-1 : 0] carry_chain[WIDTH : 0];
wire carry_chain_ack[WIDTH : 0];

assign carry_chain[0] = in_c;
assign out_c = carry_chain[WIDTH];

assign ack_c_o = carry_chain_ack[0];
assign carry_chain_ack[WIDTH] = ack_c_i;


wire [RAIL_NUM-1 : 0] in_a_up [WIDTH-1 : 0];
`UNPACK_ARRAY(RAIL_NUM,WIDTH,in_a_up,in_a)
wire [RAIL_NUM-1 : 0] in_b_up [WIDTH-1 : 0];
`UNPACK_ARRAY(RAIL_NUM,WIDTH,in_b_up,in_b)



wire [RAIL_NUM-1 : 0] out_s_up [WIDTH-1 : 0];

`PACK_ARRAY(RAIL_NUM,WIDTH,out_s_up,out_s)



generate
	for (fa_idx = 0; fa_idx < WIDTH; fa_idx = fa_idx + 1)
	begin 
		el_fa_fl full_adder
		(

			.rst(rst),

			.ack_a_o(ack_a_o[fa_idx]),
			.in_a(in_a_up[fa_idx]),

			.ack_b_o(ack_b_o[fa_idx]),
			.in_b(in_b_up[fa_idx]),

			.ack_c_o(carry_chain_ack[fa_idx]),
			.in_c(carry_chain[fa_idx]),

			.ack_s_i(ack_s_i[fa_idx]),
			.out_s(out_s_up[fa_idx]),

			.ack_c_i(carry_chain_ack[fa_idx + 1]),
			.out_c(carry_chain[fa_idx + 1])

		);
	end
endgenerate 


endmodule