data/full_repos/permissive/169220768/code/regfile.v
'utf-8' codec can't decode byte 0xb6 in position 539: invalid start byte
data/verilator_xmls/8f3d50ce-ec95-49fc-bbda-b6a2641a51d7.xml
module regfile(
	input	clk,
	input rst_n,
	input [4:0] rAddr1,
	output [31:0] rDout1,
	input [4:0] rAddr2,
	output [31:0] rDout2,
	input [4:0] wAddr,
	input [31:0] wDin,
	input wEna
	
);
	reg [31:0] data [0:31];
	integer i;
	assign rDout1=data[rAddr1];
	assign rDout2=data[rAddr2];
	always@(posedge clk or negedge rst_n)
		if(~rst_n)
		begin


			for(i=0; i<32; i=i+1) data[i]<=0;
		end
		else
		begin
			if(wEna)
				data[wAddr]<=wDin;
		end
endmodule
module regfile(
	input	clk,
	input rst_n,
	input [4:0] rAddr1,
	output [31:0] rDout1,
	input [4:0] rAddr2,
	output [31:0] rDout2,
	input [4:0] wAddr,
	input [31:0] wDin,
	input wEna
	
);

	reg [31:0] data [0:31];
	integer i;
	assign rDout1=data[rAddr1];
	assign rDout2=data[rAddr2];
	always@(posedge clk or negedge rst_n)
		if(~rst_n)
		begin


			for(i=0; i<32; i=i+1) data[i]<=0;
		end
		else
		begin
			if(wEna)
				data[wAddr]<=wDin;
		end
endmodule