data/full_repos/permissive/113654920/hdl/dna_p1.v
1: b"%Error: data/full_repos/permissive/113654920/hdl/dna_p1.v:36: Cannot find file containing module: 'DNA_PORT'\nDNA_PORT #(\n^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/113654920/hdl,data/full_repos/permissive/113654920/DNA_PORT\n             data/full_repos/permissive/113654920/hdl,data/full_repos/permissive/113654920/DNA_PORT.v\n             data/full_repos/permissive/113654920/hdl,data/full_repos/permissive/113654920/DNA_PORT.sv\n             DNA_PORT\n             DNA_PORT.v\n             DNA_PORT.sv\n             obj_dir/DNA_PORT\n             obj_dir/DNA_PORT.v\n             obj_dir/DNA_PORT.sv\n%Error: Exiting due to 1 error(s)\n"
module dna_p1(
    input ATV,
    input CLK4,
    output [63:0] DNA_64,
    output reg DNA_Valid
);

reg 		dna_read,dna_shift,dna_clk;
wire 		dna_out;
reg	[5:0]	dna_counter;
reg	[3:0]	dna_ST;
reg	[5:0]	Adder1;
reg	Parity;
reg	[56:0] DNA_R;

DNA_PORT	#(




		.SIM_DNA_VALUE(57'b101010110001111111010110000011000101010111101011110000000)















		) dna_code(
		.DIN(1'b0),
		.READ(dna_read),
		.SHIFT(dna_shift),
		.DOUT(dna_out),
		.CLK(dna_clk)		
		);







parameter DnIdle	= 4'b0000;
parameter Dn01		= 4'b0001;
parameter Dn02		= 4'b0011;
parameter Dn03		= 4'b0010;
parameter Dn04		= 4'b0110;
parameter Dn10		= 4'b0111;
parameter Dn11		= 4'b0101;
parameter Dn12		= 4'b0100;
parameter Dn13		= 4'b1100;
parameter Dn20		= 4'b1101;
parameter Dn99		= 4'b1111;


assign	DNA_64[63:7] = DNA_R[56:0];
assign	DNA_64[6:1]	 = Adder1[5:0];
assign	DNA_64[0]	 = Parity;

always @(posedge CLK4) begin
if (ATV == 1'b0) begin
	dna_read		<= 0;
	dna_shift	<= 0;
	dna_clk		<= 0;
	dna_counter	<= 6'b00_0000;
	Adder1		<= 6'b00_0000;
	Parity		<= 1'b0;
	DNA_Valid	<= 1'b0;
	dna_ST		<= DnIdle;
end else begin

	case (dna_ST)
	DnIdle: begin
		dna_read		<= 0;
		dna_shift	<= 0;
		dna_clk		<= 0;
		dna_counter	<= 6'b00_0000;
		Adder1		<= 6'b00_0000;
		Parity		<= 1'b0;
		DNA_Valid	<= 1'b0;
		dna_ST		<= Dn01;
	end
	Dn01	: begin
		dna_read		<= 1;
		dna_ST		<= Dn02;
	end
	Dn02	: begin
		dna_clk		<= 1;
		dna_ST		<= Dn03;
	end
	Dn03	: begin
		dna_clk		<= 0;
		dna_ST		<= Dn04;
	end
	Dn04	: begin
		dna_read		<= 0;
		dna_shift	<= 1;
		dna_ST		<= Dn10;
	end

	Dn10	: begin
		DNA_R[55:0]	<= DNA_R[56:1];
		DNA_R[56]	<= dna_out;
		if (dna_out == 1'b1) begin
			Adder1	<= Adder1 + 1;
			Parity	<= ~Parity;
		end
		dna_ST		<= Dn11;
	end
	Dn11	: begin
		dna_counter	<= dna_counter + 1;
		dna_ST		<= Dn12;
	end
	Dn12	: begin
		dna_clk		<= 1'b1;
		dna_ST		<= Dn13;
	end
	Dn13	: begin
		dna_clk		<= 1'b0;
		if (dna_counter == 6'b11_1001) begin
			dna_ST	<= Dn20;
		end else begin
			dna_ST	<= Dn10;
		end
	end

	Dn20	: begin
		Parity		<= Parity ^ Adder1[5] ^ Adder1[4] ^ Adder1[3] ^ Adder1[2] ^ Adder1[1] ^ Adder1[0];
		dna_ST		<= Dn99;
	end

	Dn99	: begin
		DNA_Valid	<= 1'b1;
		dna_ST		<= Dn99;
	end

	default: begin
		dna_ST 		<= DnIdle;
	end
	endcase
end
end
	
endmodule
module dna_p1(
    input ATV,
    input CLK4,
    output [63:0] DNA_64,
    output reg DNA_Valid
);


reg 		dna_read,dna_shift,dna_clk;
wire 		dna_out;
reg	[5:0]	dna_counter;
reg	[3:0]	dna_ST;
reg	[5:0]	Adder1;
reg	Parity;
reg	[56:0] DNA_R;

DNA_PORT	#(




		.SIM_DNA_VALUE(57'b101010110001111111010110000011000101010111101011110000000)















		) dna_code(
		.DIN(1'b0),
		.READ(dna_read),
		.SHIFT(dna_shift),
		.DOUT(dna_out),
		.CLK(dna_clk)		
		);







parameter DnIdle	= 4'b0000;
parameter Dn01		= 4'b0001;
parameter Dn02		= 4'b0011;
parameter Dn03		= 4'b0010;
parameter Dn04		= 4'b0110;
parameter Dn10		= 4'b0111;
parameter Dn11		= 4'b0101;
parameter Dn12		= 4'b0100;
parameter Dn13		= 4'b1100;
parameter Dn20		= 4'b1101;
parameter Dn99		= 4'b1111;


assign	DNA_64[63:7] = DNA_R[56:0];
assign	DNA_64[6:1]	 = Adder1[5:0];
assign	DNA_64[0]	 = Parity;

always @(posedge CLK4) begin
if (ATV == 1'b0) begin
	dna_read		<= 0;
	dna_shift	<= 0;
	dna_clk		<= 0;
	dna_counter	<= 6'b00_0000;
	Adder1		<= 6'b00_0000;
	Parity		<= 1'b0;
	DNA_Valid	<= 1'b0;
	dna_ST		<= DnIdle;
end else begin

	case (dna_ST)
	DnIdle: begin
		dna_read		<= 0;
		dna_shift	<= 0;
		dna_clk		<= 0;
		dna_counter	<= 6'b00_0000;
		Adder1		<= 6'b00_0000;
		Parity		<= 1'b0;
		DNA_Valid	<= 1'b0;
		dna_ST		<= Dn01;
	end
	Dn01	: begin
		dna_read		<= 1;
		dna_ST		<= Dn02;
	end
	Dn02	: begin
		dna_clk		<= 1;
		dna_ST		<= Dn03;
	end
	Dn03	: begin
		dna_clk		<= 0;
		dna_ST		<= Dn04;
	end
	Dn04	: begin
		dna_read		<= 0;
		dna_shift	<= 1;
		dna_ST		<= Dn10;
	end

	Dn10	: begin
		DNA_R[55:0]	<= DNA_R[56:1];
		DNA_R[56]	<= dna_out;
		if (dna_out == 1'b1) begin
			Adder1	<= Adder1 + 1;
			Parity	<= ~Parity;
		end
		dna_ST		<= Dn11;
	end
	Dn11	: begin
		dna_counter	<= dna_counter + 1;
		dna_ST		<= Dn12;
	end
	Dn12	: begin
		dna_clk		<= 1'b1;
		dna_ST		<= Dn13;
	end
	Dn13	: begin
		dna_clk		<= 1'b0;
		if (dna_counter == 6'b11_1001) begin
			dna_ST	<= Dn20;
		end else begin
			dna_ST	<= Dn10;
		end
	end

	Dn20	: begin
		Parity		<= Parity ^ Adder1[5] ^ Adder1[4] ^ Adder1[3] ^ Adder1[2] ^ Adder1[1] ^ Adder1[0];
		dna_ST		<= Dn99;
	end

	Dn99	: begin
		DNA_Valid	<= 1'b1;
		dna_ST		<= Dn99;
	end

	default: begin
		dna_ST 		<= DnIdle;
	end
	endcase
end
end
	
endmodule