data/full_repos/permissive/407433468/PRJ0_FINAL/rtl/SC_LEVELCOUNTER.v
data/verilator_xmls/c09112d2-4da6-4a3c-95c1-e99736bbb2ad.xml
module SC_LEVELCOUNTER(

	SC_LEVELCOUNTER_data_OutBUS,

	SC_LEVELCOUNTER_CLOCK_50,
	SC_LEVELCOUNTER_RESET_InHigh,
	SC_LEVELCOUNTER_upLEVEL
);



localparam LEVELCOUNTER_DATAWIDTH = 2;



output		[LEVELCOUNTER_DATAWIDTH-1:0]	SC_LEVELCOUNTER_data_OutBUS;
input		SC_LEVELCOUNTER_CLOCK_50;
input		SC_LEVELCOUNTER_RESET_InHigh;
input		SC_LEVELCOUNTER_upLEVEL;




reg [LEVELCOUNTER_DATAWIDTH-1:0] LEVELCOUNTER_Register;
reg [LEVELCOUNTER_DATAWIDTH-1:0] LEVELCOUNTER_Signal;




always @(*)
begin
	if (SC_LEVELCOUNTER_upLEVEL == 1'b1)
		LEVELCOUNTER_Signal = LEVELCOUNTER_Register + 1'b1;
	else
		LEVELCOUNTER_Signal = LEVELCOUNTER_Register;
	end	

always @(posedge SC_LEVELCOUNTER_CLOCK_50, posedge SC_LEVELCOUNTER_RESET_InHigh)
begin
	if (SC_LEVELCOUNTER_RESET_InHigh  == 1'b1)
		LEVELCOUNTER_Register <= 0;
	else
		LEVELCOUNTER_Register <= LEVELCOUNTER_Signal;
end




assign SC_LEVELCOUNTER_data_OutBUS = LEVELCOUNTER_Register;

endmodule
module SC_LEVELCOUNTER(

	SC_LEVELCOUNTER_data_OutBUS,

	SC_LEVELCOUNTER_CLOCK_50,
	SC_LEVELCOUNTER_RESET_InHigh,
	SC_LEVELCOUNTER_upLEVEL
);




localparam LEVELCOUNTER_DATAWIDTH = 2;



output		[LEVELCOUNTER_DATAWIDTH-1:0]	SC_LEVELCOUNTER_data_OutBUS;
input		SC_LEVELCOUNTER_CLOCK_50;
input		SC_LEVELCOUNTER_RESET_InHigh;
input		SC_LEVELCOUNTER_upLEVEL;




reg [LEVELCOUNTER_DATAWIDTH-1:0] LEVELCOUNTER_Register;
reg [LEVELCOUNTER_DATAWIDTH-1:0] LEVELCOUNTER_Signal;




always @(*)
begin
	if (SC_LEVELCOUNTER_upLEVEL == 1'b1)
		LEVELCOUNTER_Signal = LEVELCOUNTER_Register + 1'b1;
	else
		LEVELCOUNTER_Signal = LEVELCOUNTER_Register;
	end	

always @(posedge SC_LEVELCOUNTER_CLOCK_50, posedge SC_LEVELCOUNTER_RESET_InHigh)
begin
	if (SC_LEVELCOUNTER_RESET_InHigh  == 1'b1)
		LEVELCOUNTER_Register <= 0;
	else
		LEVELCOUNTER_Register <= LEVELCOUNTER_Signal;
end




assign SC_LEVELCOUNTER_data_OutBUS = LEVELCOUNTER_Register;

endmodule