data/full_repos/permissive/428957694/sources_1/new/lfsr.v
1: b"%Error: data/full_repos/permissive/428957694/sources_1/new/lfsr.v:13: Duplicate declaration of signal: 'led'\n                                                                    : ... note: ANSI ports must have type declared with the I/O (IEEE 1800-2017 23.2.2.2)\n reg [DATAWITH - 1 : 0] led = 1'b1 << DATAWITH - 1; \n                        ^~~\n        data/full_repos/permissive/428957694/sources_1/new/lfsr.v:9: ... Location of original declaration\n    output [DATAWITH-1 : 0] led  \n                            ^~~\n%Error: Exiting due to 1 error(s)\n"
module lfsr
    #(
        parameter DATAWITH = 10
    )
    
    (
    input clk, load, en,
    input [DATAWITH-1 : 0] polynomial,
    output [DATAWITH-1 : 0] led
    );
	

	reg [DATAWITH - 1 : 0] led = 1'b1 << DATAWITH - 1;	
	
	reg tempXor = 1'b0;
	reg load_prev = 1'b0;
	reg [DATAWITH - 1 : 0] poly;		
	reg [15:0] i = 16'b0;


	always@ (posedge clk) begin

		load_prev <= load;
		
		if (load == 1'b1 && load_prev == 1'b0)
			poly <= polynomial;
 		
		if (en) begin


				led[DATAWITH - 1 : 1] <= led[DATAWITH - 2 : 0];
				
				for (i = 0; i <= DATAWITH-1; i = i + 1) 
				begin: Loadpolynomial
					tempXor = (poly[i] & led[i]) ^ tempXor;
				end
				
				led[0] <= tempXor;




		end	
		
	end
	
    
endmodule
module lfsr
    #(
        parameter DATAWITH = 10
    )
    
    (
    input clk, load, en,
    input [DATAWITH-1 : 0] polynomial,
    output [DATAWITH-1 : 0] led
    );

	

	reg [DATAWITH - 1 : 0] led = 1'b1 << DATAWITH - 1;	
	
	reg tempXor = 1'b0;
	reg load_prev = 1'b0;
	reg [DATAWITH - 1 : 0] poly;		
	reg [15:0] i = 16'b0;


	always@ (posedge clk) begin

		load_prev <= load;
		
		if (load == 1'b1 && load_prev == 1'b0)
			poly <= polynomial;
 		
		if (en) begin


				led[DATAWITH - 1 : 1] <= led[DATAWITH - 2 : 0];
				
				for (i = 0; i <= DATAWITH-1; i = i + 1) 
				begin: Loadpolynomial
					tempXor = (poly[i] & led[i]) ^ tempXor;
				end
				
				led[0] <= tempXor;




		end	
		
	end
	
    
endmodule