data/full_repos/permissive/217518118/rtl/ninjakun_video.v
1: b'%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:34: Cannot find include file: rtl/defs.v\n`include "rtl/defs.v" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/217518118/rtl,data/full_repos/permissive/217518118/rtl/defs.v\n             data/full_repos/permissive/217518118/rtl,data/full_repos/permissive/217518118/rtl/defs.v.v\n             data/full_repos/permissive/217518118/rtl,data/full_repos/permissive/217518118/rtl/defs.v.sv\n             rtl/defs.v\n             rtl/defs.v.v\n             rtl/defs.v.sv\n             obj_dir/rtl/defs.v\n             obj_dir/rtl/defs.v.v\n             obj_dir/rtl/defs.v.sv\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:64: Define or directive not defined: \'`HW_PKUNWAR\'\nwire FGOPQ = HWTYPE != `HW_PKUNWAR & (FGOUT[3:0]!=0);\n                       ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:65: Define or directive not defined: \'`HW_PKUNWAR\'\nwire FGPPQ = HWTYPE != `HW_PKUNWAR & FGOPQ & (~FGPRI);\n                       ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:83: Define or directive not defined: \'`HW_PKUNWAR\'\n VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),\n                                 ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:83: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\n VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),\n                                             ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:83: Define or directive not defined: \'`HW_RAIDERS5\'\n VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),\n                                                          ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:131: Define or directive not defined: \'`HW_RAIDERS5\'\nwire  [9:0] CHRNO = (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_NOVA2001) ? {2\'b00, FGVDT[7:0]} : {1\'b0,FGVDT[13],FGVDT[7:0]};\n                               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:131: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\nwire  [9:0] CHRNO = (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_NOVA2001) ? {2\'b00, FGVDT[7:0]} : {1\'b0,FGVDT[13],FGVDT[7:0]};\n                                            ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:131: Define or directive not defined: \'`HW_NOVA2001\'\nwire  [9:0] CHRNO = (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_NOVA2001) ? {2\'b00, FGVDT[7:0]} : {1\'b0,FGVDT[13],FGVDT[7:0]};\n                                                         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:138: Define or directive not defined: \'`HW_RAIDERS5\'\n  0: begin OUT <= CDT[7:4]  ; PAL   <= HWTYPE == `HW_RAIDERS5 ? {1\'b0, FGVDT[15:12]} : FGVDT[12:8]; end\n                                                 ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:138: syntax error, unexpected \'?\', expecting TYPE-IDENTIFIER\n  0: begin OUT <= CDT[7:4]  ; PAL   <= HWTYPE == `HW_RAIDERS5 ? {1\'b0, FGVDT[15:12]} : FGVDT[12:8]; end\n                                                              ^\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:149: Define or directive not defined: \'`HW_NOVA2001\'\nassign FGOUT = HWTYPE == `HW_NOVA2001 ? (OUT == 4\'h1 ? PAL : { PAL[4], OUT }) : { PAL[4], 1\'b0, PAL[3:0], OUT };\n                         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:149: syntax error, unexpected \'?\', expecting TYPE-IDENTIFIER\nassign FGOUT = HWTYPE == `HW_NOVA2001 ? (OUT == 4\'h1 ? PAL : { PAL[4], OUT }) : { PAL[4], 1\'b0, PAL[3:0], OUT };\n                                      ^\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:175: Define or directive not defined: \'`HW_NOVA2001\'\nwire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9\'d9 : 9\'d2)  ;\n                                         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:175: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\nwire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9\'d9 : 9\'d2)  ;\n                                                      ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:175: Define or directive not defined: \'`HW_PKUNWAR\'\nwire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9\'d9 : 9\'d2)  ;\n                                                                   ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:178: Define or directive not defined: \'`HW_RAIDERS5\'\nwire  [10:0] CHRNO = HWTYPE == `HW_RAIDERS5 ? {2\'b10, BGVDT[8:0]} : \n                               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:178: syntax error, unexpected \'?\', expecting TYPE-IDENTIFIER\nwire  [10:0] CHRNO = HWTYPE == `HW_RAIDERS5 ? {2\'b10, BGVDT[8:0]} : \n                                            ^\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:179: Define or directive not defined: \'`HW_NOVA2001\'\n                     HWTYPE == `HW_NOVA2001 ? {3\'b110, BGVDT[7:0]}:\n                               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:180: Define or directive not defined: \'`HW_PKUNWAR\'\n      HWTYPE == `HW_PKUNWAR  ? BGVDT[10:0]:\n                ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:189: Define or directive not defined: \'`HW_RAIDERS5\'\n        PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];\n                            ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:189: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\n        PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];\n                                         ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:189: Define or directive not defined: \'`HW_PKUNWAR\'\n        PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];\n                                                      ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:190: Define or directive not defined: \'`HW_PKUNWAR\'\n        BGPRI <= HWTYPE == `HW_PKUNWAR && BGVDT[11];\n                           ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:190: syntax error, unexpected &&, expecting TYPE-IDENTIFIER\n        BGPRI <= HWTYPE == `HW_PKUNWAR && BGVDT[11];\n                                       ^~\n%Error: Exiting due to 25 error(s)\n'
module NINJAKUN_BG
(
	input         MCLK,
	input   [1:0] HWTYPE,

	input   [8:0] PH,
	input   [8:0] PV,

	input   [7:0] BGSCX,
	input   [7:0] BGSCY,

	output reg [9:0] BGVAD,
	input  [15:0] BGVDT,

	output reg [13:0] BGCAD,
	input  [31:0] BGCDT,

	output  [8:0] BGOUT,
	output reg    BGPRI
);
wire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9'd9 : 9'd2);
wire  [8:0] POSV  = PV+BGSCY+9'd32;

wire  [10:0] CHRNO = HWTYPE == `HW_RAIDERS5 ? {2'b10, BGVDT[8:0]} : 
                     HWTYPE == `HW_NOVA2001 ? {3'b110, BGVDT[7:0]}:
					 HWTYPE == `HW_PKUNWAR  ? BGVDT[10:0]:
                     {1'b1,BGVDT[15:14],BGVDT[7:0]};
reg  [31:0] CDT;

reg   [3:0] PAL;
reg   [3:0] OUT;
always @( posedge MCLK ) begin
	case(POSH[2:0])
	 0: begin OUT <= CDT[7:4]  ;
		      PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];
		      BGPRI <= HWTYPE == `HW_PKUNWAR && BGVDT[11];
		end
	 1: begin OUT <= CDT[3:0]  ; BGVAD <= {POSV[7:3],POSH[7:3]}; end
	 2: begin OUT <= CDT[15:12]; end
	 3: begin OUT <= CDT[11:8] ; end
	 4: begin OUT <= CDT[23:20]; BGCAD <= {CHRNO,POSV[2:0]}; end
	 5: begin OUT <= CDT[19:16]; end
	 6: begin OUT <= CDT[31:28]; end
	 7: begin OUT <= CDT[27:24]; CDT   <= BGCDT; end
	endcase
end

assign BGOUT = HWTYPE[1] ? {1'b1, (OUT == 4'h1 ? PAL : OUT)} : { 1'b1, PAL, OUT };

endmodule
module NINJAKUN_BG
(
	input         MCLK,
	input   [1:0] HWTYPE,

	input   [8:0] PH,
	input   [8:0] PV,

	input   [7:0] BGSCX,
	input   [7:0] BGSCY,

	output reg [9:0] BGVAD,
	input  [15:0] BGVDT,

	output reg [13:0] BGCAD,
	input  [31:0] BGCDT,

	output  [8:0] BGOUT,
	output reg    BGPRI
);

wire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9'd9 : 9'd2);
wire  [8:0] POSV  = PV+BGSCY+9'd32;

wire  [10:0] CHRNO = HWTYPE == `HW_RAIDERS5 ? {2'b10, BGVDT[8:0]} : 
                     HWTYPE == `HW_NOVA2001 ? {3'b110, BGVDT[7:0]}:
					 HWTYPE == `HW_PKUNWAR  ? BGVDT[10:0]:
                     {1'b1,BGVDT[15:14],BGVDT[7:0]};
reg  [31:0] CDT;

reg   [3:0] PAL;
reg   [3:0] OUT;
always @( posedge MCLK ) begin
	case(POSH[2:0])
	 0: begin OUT <= CDT[7:4]  ;
		      PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];
		      BGPRI <= HWTYPE == `HW_PKUNWAR && BGVDT[11];
		end
	 1: begin OUT <= CDT[3:0]  ; BGVAD <= {POSV[7:3],POSH[7:3]}; end
	 2: begin OUT <= CDT[15:12]; end
	 3: begin OUT <= CDT[11:8] ; end
	 4: begin OUT <= CDT[23:20]; BGCAD <= {CHRNO,POSV[2:0]}; end
	 5: begin OUT <= CDT[19:16]; end
	 6: begin OUT <= CDT[31:28]; end
	 7: begin OUT <= CDT[27:24]; CDT   <= BGCDT; end
	endcase
end

assign BGOUT = HWTYPE[1] ? {1'b1, (OUT == 4'h1 ? PAL : OUT)} : { 1'b1, PAL, OUT };

endmodule