data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v
1: b'%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:295: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 11 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_red <= {(({1\'b0, primarypixel[20:14]}) + ({1\'b0, primarybuffer[20:14]})), 3\'b000} ; \n                      ^~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:296: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 11 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_green <= {(({1\'b0, primarypixel[13:7]}) + ({1\'b0, primarybuffer[13:7]})), 3\'b000} ; \n                        ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:297: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 11 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_blue <= {(({1\'b0, primarypixel[6:0]}) + ({1\'b0, primarybuffer[6:0]})), 3\'b000} ; \n                       ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:310: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 11 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_red <= {(({1\'b0, primarypixel[20:14]}) + ({1\'b0, secondarypixel[20:14]})), 3\'b000} ; \n                      ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:311: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 11 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_green <= {(({1\'b0, primarypixel[13:7]}) + ({1\'b0, secondarypixel[13:7]})), 3\'b000} ; \n                        ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:312: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 11 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_blue <= {(({1\'b0, primarypixel[6:0]}) + ({1\'b0, secondarypixel[6:0]})), 3\'b000} ; \n                       ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:322: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 12 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_red <= {(({2\'b00, primarypixel[20:14]}) \n                      ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:326: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 12 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_green <= {(({2\'b00, primarypixel[13:7]}) \n                        ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:330: Operator ASSIGNDLY expects 10 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 12 bits.\n                                                                                                                                             : ... In instance paj_framebuftop_hierarchy_no_mem.vidoutinst\n       tm3_vidout_blue <= {(({2\'b00, primarypixel[6:0]}) \n                       ^~\n%Warning-WIDTH: data/full_repos/permissive/49670587/vtr/ODIN_II/FULL_REGRESSION_TESTS/paj_framebuftop_hierarchy_no_mem_no_combinational.v:43: Input port connection \'fbdata\' expects 63 bits on the pin connection, but pin connection\'s VARREF \'fbdata\' generates 64 bits.\n                                                                                                                                            : ... In instance paj_framebuftop_hierarchy_no_mem\n    scanlinebuffer scanlinebuf (pixeldataA, pixeldataB, pixeldataC, nextpixelA, nextpixelB, nextpixelC, startframe, nextscanline, fbdata, fbnextscanlineint, fbdatavalid, globalreset, tm3_clk_v0); \n                                                                                                                                  ^~~~~~\n%Error: Exiting due to 10 warning(s)\n'
module vidout (pixeldataA, pixeldataB, pixeldataC, nextpixelA, nextpixelB, nextpixelC, startframe, nextscanline, globalreset, tm3_clk_v0, tm3_clk_v0_2, tm3_vidout_red, tm3_vidout_green, tm3_vidout_blue, tm3_vidout_clock, tm3_vidout_hsync, tm3_vidout_vsync, tm3_vidout_blank);

    input[20:0] pixeldataA; 
    input[20:0] pixeldataB; 
    input[20:0] pixeldataC; 
    output nextpixelA; 
    reg nextpixelA;
    output nextpixelB; 
    reg nextpixelB;
    output nextpixelC; 
    reg nextpixelC;
    output startframe; 

    reg startframe;
    output nextscanline; 
    reg nextscanline;
    input globalreset; 
    input tm3_clk_v0; 
    input tm3_clk_v0_2;
    output[9:0] tm3_vidout_red; 
    reg[9:0] tm3_vidout_red;
    output[9:0] tm3_vidout_green; 
    reg[9:0] tm3_vidout_green;
    output[9:0] tm3_vidout_blue; 
    reg[9:0] tm3_vidout_blue;
    output tm3_vidout_clock; 

    wire tm3_vidout_clock;
    output tm3_vidout_hsync; 
    reg tm3_vidout_hsync;
    output tm3_vidout_vsync; 
    reg tm3_vidout_vsync;
    output tm3_vidout_blank; 
    reg tm3_vidout_blank;

    reg[9:0] horiz; 
    reg[9:0] vert; 
    reg video_state; 
    reg nothsyncd; 

    reg[20:0] primarypixel; 
    reg[20:0] secondarypixel; 
    reg[20:0] primarybuffer; 
    reg[20:0] secondarybuffer; 
    reg primarynext; 
    reg secondarynext; 
    reg[1:0] pselect; 

	always @(posedge tm3_clk_v0)
	begin
		if ((horiz < 641 & vert < 480) & video_state == 1'b0)
		begin
			if ((vert[0]) == 1'b0)
			begin
				secondarynext <= 1'b0 ; 

				if ((horiz[0]) == 1'b0)
				begin
					primarynext <= 1'b1 ; 
				end 
			end
			else
			begin

				if ((horiz[0]) == 1'b0)
				begin
					primarynext <= 1'b1 ; 
					secondarynext <= 1'b1 ; 
				end 
			end 
		end 
	end 


	always @(posedge tm3_clk_v0)
	begin
		case (pselect)
			2'b00 :
			begin
				
				primarypixel <= pixeldataA ; 
				secondarypixel <= pixeldataB ; 

				nextpixelA <= primarynext ; 
				nextpixelB <= secondarynext ; 
				nextpixelC <= 1'b0 ; 
			end
			2'b01 :
			begin
				
				primarypixel <= pixeldataB ; 
				secondarypixel <= pixeldataC ; 
				
				nextpixelA <= 1'b0 ; 
				nextpixelB <= primarynext ; 
				nextpixelC <= secondarynext ; 
			end
			2'b10 :
			begin
				primarypixel <= pixeldataC ; 
				secondarypixel <= pixeldataA ; 

				nextpixelB <= 1'b0 ; 
				nextpixelC <= primarynext ; 
				nextpixelA <= secondarynext ; 
			end
			default :
			begin				
				primarypixel <= 1;
				secondarypixel <= 1;

				nextpixelA <= 1'b0 ; 
				nextpixelB <= 1'b0 ; 
				nextpixelC <= 1'b0 ; 
			end
		endcase 
	end 

	assign tm3_vidout_clock = ~(video_state) ;

	always @(posedge tm3_clk_v0)
	begin
		if (globalreset == 1'b1)
		begin
			nothsyncd <= 1'b0 ; 
			vert <= 1;
			horiz <= 1;
			startframe <= 1'b0 ; 
			pselect <= 2'b00 ; 
			video_state <= 1'b0 ; 

			tm3_vidout_blank <= 1'b0 ; 
			tm3_vidout_vsync <= 1'b0 ; 
			tm3_vidout_hsync <= 1'b0 ; 
			tm3_vidout_green <= 1;
			tm3_vidout_red <= 1;
			tm3_vidout_blue <= 1;
			primarybuffer <= 1;
			secondarybuffer <= 1;
			nextscanline <= 1'b0 ; 
		end
		else if (tm3_clk_v0_2 == 1'b1)
		begin

			video_state <= ~(video_state) ; 


			nothsyncd <= ~tm3_vidout_hsync ; 
			if (tm3_vidout_hsync == 1'b1 & nothsyncd == 1'b1)
			begin
				if ((vert < 478) & (vert[0]) == 1'b0)
				begin
					nextscanline <= 1'b1 ; 
					startframe <= 1'b0 ; 
				end 
				else if ((vert < 480) & (vert[0]) == 1'b1)
				begin
					nextscanline <= 1'b0 ; 
					startframe <= 1'b0 ; 
					case (pselect)
						2'b00 :
						begin
							pselect <= 2'b01 ; 
						end
						2'b01 :
						begin
							pselect <= 2'b10 ; 
						end
						2'b10 :
						begin
							pselect <= 2'b00 ; 
						end
						default :
						begin
							pselect <= 2'b0 ; 
						end
					endcase 
				end 
				else if (vert == 525)
				begin
					nextscanline <= 1'b1 ; 
					startframe <= 1'b1 ; 
					pselect <= 2'b00 ; 
				end 
			end 

			if (video_state == 1'b0)
			begin
				if (horiz == 800)
				begin
					horiz <= 10'b0000000000;
					if (vert == 525)
					begin
						vert <= 10'b0000000000;
					end
					else
					begin
						vert <= vert + 1;
					end 
				end
				else
				begin
					horiz <= horiz + 1; 
				end 

				if ((vert >= 491) & (vert <= 493))
				begin
					tm3_vidout_vsync <= 1;
				end
				else
				begin
					tm3_vidout_vsync <= 0;
				end 

				if ((horiz >= 664) & (horiz <= 760))
				begin
					tm3_vidout_hsync <= 1;
				end
				else
				begin
					tm3_vidout_hsync <= 1'b0 ; 
				end 

				if ((horiz < 640) & (vert < 480))
				begin
					tm3_vidout_blank <= 1'b1 ; 
				end
				else
				begin
					tm3_vidout_blank <= 1'b0 ; 
				end 

				if (horiz < 643 & vert < 480)
				begin
					if ((vert[0]) == 1'b0)
					begin

						if ((horiz[0]) == 1'b0)
						begin
							primarybuffer <= primarypixel ; 
							tm3_vidout_red <= {primarypixel[20:14], 3'b000} ; 
							tm3_vidout_green <= {primarypixel[13:7], 3'b000} ; 
							tm3_vidout_blue <= {primarypixel[6:0], 3'b000} ; 
						end
						else
						begin
							primarybuffer <= primarypixel ; 



							tm3_vidout_red <= {(({1'b0, primarypixel[20:14]}) + ({1'b0, primarybuffer[20:14]})), 3'b000} ; 
							tm3_vidout_green <= {(({1'b0, primarypixel[13:7]}) + ({1'b0, primarybuffer[13:7]})), 3'b000} ; 
							tm3_vidout_blue <= {(({1'b0, primarypixel[6:0]}) + ({1'b0, primarybuffer[6:0]})), 3'b000} ; 
						end 
					end
					else
					begin

						if ((horiz[0]) == 1'b0)
						begin
							primarybuffer <= primarypixel ; 
							secondarybuffer <= secondarypixel ; 



							tm3_vidout_red <= {(({1'b0, primarypixel[20:14]}) + ({1'b0, secondarypixel[20:14]})), 3'b000} ; 
							tm3_vidout_green <= {(({1'b0, primarypixel[13:7]}) + ({1'b0, secondarypixel[13:7]})), 3'b000} ; 
							tm3_vidout_blue <= {(({1'b0, primarypixel[6:0]}) + ({1'b0, secondarypixel[6:0]})), 3'b000} ; 
						end
						else
						begin






							tm3_vidout_red <= {(({2'b00, primarypixel[20:14]}) 
								+ ({2'b00, secondarypixel[20:14]}) 
								+ ({2'b00, primarybuffer[20:14]}) 
								+ ({2'b00, secondarybuffer[20:14]})), 3'b000} ; 
							tm3_vidout_green <= {(({2'b00, primarypixel[13:7]}) 
								+ ({2'b00, secondarypixel[13:7]}) 
								+ ({2'b00, primarybuffer[13:7]}) 
								+ ({2'b00, secondarybuffer[13:7]})), 3'b000} ; 
							tm3_vidout_blue <= {(({2'b00, primarypixel[6:0]}) 
								+ ({2'b00, secondarypixel[6:0]}) 
								+ ({2'b00, primarybuffer[6:0]}) 
								+ ({2'b00, secondarybuffer[6:0]})), 3'b000} ; 
						end 
					end 
				end 
				else
				begin
					tm3_vidout_green <= 1;
					tm3_vidout_red <= 1;
					tm3_vidout_blue <= 1;
				end
			end 
		end 
	end 
endmodule
module vidout (pixeldataA, pixeldataB, pixeldataC, nextpixelA, nextpixelB, nextpixelC, startframe, nextscanline, globalreset, tm3_clk_v0, tm3_clk_v0_2, tm3_vidout_red, tm3_vidout_green, tm3_vidout_blue, tm3_vidout_clock, tm3_vidout_hsync, tm3_vidout_vsync, tm3_vidout_blank);


    input[20:0] pixeldataA; 
    input[20:0] pixeldataB; 
    input[20:0] pixeldataC; 
    output nextpixelA; 
    reg nextpixelA;
    output nextpixelB; 
    reg nextpixelB;
    output nextpixelC; 
    reg nextpixelC;
    output startframe; 

    reg startframe;
    output nextscanline; 
    reg nextscanline;
    input globalreset; 
    input tm3_clk_v0; 
    input tm3_clk_v0_2;
    output[9:0] tm3_vidout_red; 
    reg[9:0] tm3_vidout_red;
    output[9:0] tm3_vidout_green; 
    reg[9:0] tm3_vidout_green;
    output[9:0] tm3_vidout_blue; 
    reg[9:0] tm3_vidout_blue;
    output tm3_vidout_clock; 

    wire tm3_vidout_clock;
    output tm3_vidout_hsync; 
    reg tm3_vidout_hsync;
    output tm3_vidout_vsync; 
    reg tm3_vidout_vsync;
    output tm3_vidout_blank; 
    reg tm3_vidout_blank;

    reg[9:0] horiz; 
    reg[9:0] vert; 
    reg video_state; 
    reg nothsyncd; 

    reg[20:0] primarypixel; 
    reg[20:0] secondarypixel; 
    reg[20:0] primarybuffer; 
    reg[20:0] secondarybuffer; 
    reg primarynext; 
    reg secondarynext; 
    reg[1:0] pselect; 

	always @(posedge tm3_clk_v0)
	begin
		if ((horiz < 641 & vert < 480) & video_state == 1'b0)
		begin
			if ((vert[0]) == 1'b0)
			begin
				secondarynext <= 1'b0 ; 

				if ((horiz[0]) == 1'b0)
				begin
					primarynext <= 1'b1 ; 
				end 
			end
			else
			begin

				if ((horiz[0]) == 1'b0)
				begin
					primarynext <= 1'b1 ; 
					secondarynext <= 1'b1 ; 
				end 
			end 
		end 
	end 


	always @(posedge tm3_clk_v0)
	begin
		case (pselect)
			2'b00 :
			begin
				
				primarypixel <= pixeldataA ; 
				secondarypixel <= pixeldataB ; 

				nextpixelA <= primarynext ; 
				nextpixelB <= secondarynext ; 
				nextpixelC <= 1'b0 ; 
			end
			2'b01 :
			begin
				
				primarypixel <= pixeldataB ; 
				secondarypixel <= pixeldataC ; 
				
				nextpixelA <= 1'b0 ; 
				nextpixelB <= primarynext ; 
				nextpixelC <= secondarynext ; 
			end
			2'b10 :
			begin
				primarypixel <= pixeldataC ; 
				secondarypixel <= pixeldataA ; 

				nextpixelB <= 1'b0 ; 
				nextpixelC <= primarynext ; 
				nextpixelA <= secondarynext ; 
			end
			default :
			begin				
				primarypixel <= 1;
				secondarypixel <= 1;

				nextpixelA <= 1'b0 ; 
				nextpixelB <= 1'b0 ; 
				nextpixelC <= 1'b0 ; 
			end
		endcase 
	end 

	assign tm3_vidout_clock = ~(video_state) ;

	always @(posedge tm3_clk_v0)
	begin
		if (globalreset == 1'b1)
		begin
			nothsyncd <= 1'b0 ; 
			vert <= 1;
			horiz <= 1;
			startframe <= 1'b0 ; 
			pselect <= 2'b00 ; 
			video_state <= 1'b0 ; 

			tm3_vidout_blank <= 1'b0 ; 
			tm3_vidout_vsync <= 1'b0 ; 
			tm3_vidout_hsync <= 1'b0 ; 
			tm3_vidout_green <= 1;
			tm3_vidout_red <= 1;
			tm3_vidout_blue <= 1;
			primarybuffer <= 1;
			secondarybuffer <= 1;
			nextscanline <= 1'b0 ; 
		end
		else if (tm3_clk_v0_2 == 1'b1)
		begin

			video_state <= ~(video_state) ; 


			nothsyncd <= ~tm3_vidout_hsync ; 
			if (tm3_vidout_hsync == 1'b1 & nothsyncd == 1'b1)
			begin
				if ((vert < 478) & (vert[0]) == 1'b0)
				begin
					nextscanline <= 1'b1 ; 
					startframe <= 1'b0 ; 
				end 
				else if ((vert < 480) & (vert[0]) == 1'b1)
				begin
					nextscanline <= 1'b0 ; 
					startframe <= 1'b0 ; 
					case (pselect)
						2'b00 :
						begin
							pselect <= 2'b01 ; 
						end
						2'b01 :
						begin
							pselect <= 2'b10 ; 
						end
						2'b10 :
						begin
							pselect <= 2'b00 ; 
						end
						default :
						begin
							pselect <= 2'b0 ; 
						end
					endcase 
				end 
				else if (vert == 525)
				begin
					nextscanline <= 1'b1 ; 
					startframe <= 1'b1 ; 
					pselect <= 2'b00 ; 
				end 
			end 

			if (video_state == 1'b0)
			begin
				if (horiz == 800)
				begin
					horiz <= 10'b0000000000;
					if (vert == 525)
					begin
						vert <= 10'b0000000000;
					end
					else
					begin
						vert <= vert + 1;
					end 
				end
				else
				begin
					horiz <= horiz + 1; 
				end 

				if ((vert >= 491) & (vert <= 493))
				begin
					tm3_vidout_vsync <= 1;
				end
				else
				begin
					tm3_vidout_vsync <= 0;
				end 

				if ((horiz >= 664) & (horiz <= 760))
				begin
					tm3_vidout_hsync <= 1;
				end
				else
				begin
					tm3_vidout_hsync <= 1'b0 ; 
				end 

				if ((horiz < 640) & (vert < 480))
				begin
					tm3_vidout_blank <= 1'b1 ; 
				end
				else
				begin
					tm3_vidout_blank <= 1'b0 ; 
				end 

				if (horiz < 643 & vert < 480)
				begin
					if ((vert[0]) == 1'b0)
					begin

						if ((horiz[0]) == 1'b0)
						begin
							primarybuffer <= primarypixel ; 
							tm3_vidout_red <= {primarypixel[20:14], 3'b000} ; 
							tm3_vidout_green <= {primarypixel[13:7], 3'b000} ; 
							tm3_vidout_blue <= {primarypixel[6:0], 3'b000} ; 
						end
						else
						begin
							primarybuffer <= primarypixel ; 



							tm3_vidout_red <= {(({1'b0, primarypixel[20:14]}) + ({1'b0, primarybuffer[20:14]})), 3'b000} ; 
							tm3_vidout_green <= {(({1'b0, primarypixel[13:7]}) + ({1'b0, primarybuffer[13:7]})), 3'b000} ; 
							tm3_vidout_blue <= {(({1'b0, primarypixel[6:0]}) + ({1'b0, primarybuffer[6:0]})), 3'b000} ; 
						end 
					end
					else
					begin

						if ((horiz[0]) == 1'b0)
						begin
							primarybuffer <= primarypixel ; 
							secondarybuffer <= secondarypixel ; 



							tm3_vidout_red <= {(({1'b0, primarypixel[20:14]}) + ({1'b0, secondarypixel[20:14]})), 3'b000} ; 
							tm3_vidout_green <= {(({1'b0, primarypixel[13:7]}) + ({1'b0, secondarypixel[13:7]})), 3'b000} ; 
							tm3_vidout_blue <= {(({1'b0, primarypixel[6:0]}) + ({1'b0, secondarypixel[6:0]})), 3'b000} ; 
						end
						else
						begin






							tm3_vidout_red <= {(({2'b00, primarypixel[20:14]}) 
								+ ({2'b00, secondarypixel[20:14]}) 
								+ ({2'b00, primarybuffer[20:14]}) 
								+ ({2'b00, secondarybuffer[20:14]})), 3'b000} ; 
							tm3_vidout_green <= {(({2'b00, primarypixel[13:7]}) 
								+ ({2'b00, secondarypixel[13:7]}) 
								+ ({2'b00, primarybuffer[13:7]}) 
								+ ({2'b00, secondarybuffer[13:7]})), 3'b000} ; 
							tm3_vidout_blue <= {(({2'b00, primarypixel[6:0]}) 
								+ ({2'b00, secondarypixel[6:0]}) 
								+ ({2'b00, primarybuffer[6:0]}) 
								+ ({2'b00, secondarybuffer[6:0]})), 3'b000} ; 
						end 
					end 
				end 
				else
				begin
					tm3_vidout_green <= 1;
					tm3_vidout_red <= 1;
					tm3_vidout_blue <= 1;
				end
			end 
		end 
	end 
endmodule