data/full_repos/permissive/215874117/src/ninjakun_shareio.v
1: b'%Warning-MULTITOP: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:86: Multiple top level modules\n                                                                                 : ... Suggest see manual; fix the duplicates, or use --top-module to select top.\n                   ... Use "/* verilator lint_off MULTITOP */" and lint_on around source to disable this message.\n                                                                                 : ... Top module \'NINJAKUN_IO_VIDEO\'\nmodule NINJAKUN_IO_VIDEO\n       ^~~~~~~~~~~~~~~~~\n                                                                                 : ... Top module \'NINJAKUN_CPUMUX\'\nmodule NINJAKUN_CPUMUX\n       ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:197: Cannot find file containing module: \'YM2149\'\nYM2149 psg0(\n^~~~~~\n        ... Looked in:\n             data/full_repos/permissive/215874117/src,data/full_repos/permissive/215874117/YM2149\n             data/full_repos/permissive/215874117/src,data/full_repos/permissive/215874117/YM2149.v\n             data/full_repos/permissive/215874117/src,data/full_repos/permissive/215874117/YM2149.sv\n             YM2149\n             YM2149.v\n             YM2149.sv\n             obj_dir/YM2149\n             obj_dir/YM2149.v\n             obj_dir/YM2149.sv\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:205: Cannot find file containing module: \'YM2149\'\nYM2149 psg1(\n^~~~~~\n%Warning-WIDTH: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:214: Operator ADD expects 12 bits on the LHS, but LHS\'s VARREF \'SA0\' generates 8 bits.\n                                                                               : ... In instance NINJAKUN_IO_VIDEO.psg\nwire [11:0] SND = SA0+SB0+SC0+SA1+SB1+SC1;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:214: Operator ADD expects 12 bits on the RHS, but RHS\'s VARREF \'SB0\' generates 8 bits.\n                                                                               : ... In instance NINJAKUN_IO_VIDEO.psg\nwire [11:0] SND = SA0+SB0+SC0+SA1+SB1+SC1;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:214: Operator ADD expects 12 bits on the RHS, but RHS\'s VARREF \'SC0\' generates 8 bits.\n                                                                               : ... In instance NINJAKUN_IO_VIDEO.psg\nwire [11:0] SND = SA0+SB0+SC0+SA1+SB1+SC1;\n                         ^\n%Warning-WIDTH: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:214: Operator ADD expects 12 bits on the RHS, but RHS\'s VARREF \'SA1\' generates 8 bits.\n                                                                               : ... In instance NINJAKUN_IO_VIDEO.psg\nwire [11:0] SND = SA0+SB0+SC0+SA1+SB1+SC1;\n                             ^\n%Warning-WIDTH: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:214: Operator ADD expects 12 bits on the RHS, but RHS\'s VARREF \'SB1\' generates 8 bits.\n                                                                               : ... In instance NINJAKUN_IO_VIDEO.psg\nwire [11:0] SND = SA0+SB0+SC0+SA1+SB1+SC1;\n                                 ^\n%Warning-WIDTH: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:214: Operator ADD expects 12 bits on the RHS, but RHS\'s VARREF \'SC1\' generates 8 bits.\n                                                                               : ... In instance NINJAKUN_IO_VIDEO.psg\nwire [11:0] SND = SA0+SB0+SC0+SA1+SB1+SC1;\n                                     ^\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:44: Cannot find file containing module: \'NINJAKUN_VIDEO\'\nNINJAKUN_VIDEO video (\n^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:56: Cannot find file containing module: \'NINJAKUN_SADEC\'\nNINJAKUN_SADEC sadec( CPADR, CS_PSG, CS_FGV, CS_BGV, CS_SPA, CS_PAL );\n^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:63: Cannot find file containing module: \'VDPRAM400x2\'\nVDPRAM400x2 fgv( SHCLK, CPADR[10:0], CS_FGV & CPWRT, CPODT, FGDAT, VRCLK, FGVAD, FGVDT );\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:64: Cannot find file containing module: \'VDPRAM400x2\'\nVDPRAM400x2 bgv( SHCLK, BGADR      , CS_BGV & CPWRT, CPODT, BGDAT, VRCLK, BGVAD, BGVDT );\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:65: Cannot find file containing module: \'DPRAM800\'\nDPRAM800  spa( SHCLK, CPADR[10:0], CS_SPA & CPWRT, CPODT, SPDAT, VRCLK, SPAAD, 1\'b0, 8\'h0, SPADT );\n^~~~~~~~\n%Error: data/full_repos/permissive/215874117/src/ninjakun_shareio.v:66: Cannot find file containing module: \'DPRAM200\'\nDPRAM200  pal( SHCLK, CPADR[ 8:0], CS_PAL & CPWRT, CPODT, PLDAT,  VCLK, PALET, 1\'b0, 8\'h0, POUT  );\n^~~~~~~~\n%Error: Exiting due to 8 error(s), 7 warning(s)\n'
module NINJAKUN_IO_VIDEO
(
	input				SHCLK,
	input				CLK3M,
	input				RESET,

	input				VRCLK,
	input				VCLKx4,
	input				VCLK,
	input	  [8:0]	PH,
	input	  [8:0]	PV,

	input  [15:0]	CPADR,
	input   [7:0]	CPODT,
	output  [7:0]	CPIDT,
	input    		CPRED,
	input    		CPWRT,

	input   [7:0]  DSW1,
	input   [7:0]  DSW2,

	output			VBLK,
	output  [7:0]	POUT,

	output [15:0]	SNDOUT,
	
	input				ROMCL,
	input  [16:0]	ROMAD,
	input   [7:0]	ROMDT,
	input				ROMEN
);

wire  [9:0]	FGVAD;
wire [15:0]	FGVDT;
wire  [9:0]	BGVAD;
wire [15:0]	BGVDT;
wire [10:0]	SPAAD;
wire  [7:0]	SPADT;
wire  [7:0]	SCRPX, SCRPY;
wire  [8:0]	PALET;

NINJAKUN_VIDEO video (
	RESET, VCLKx4, VCLK, PH, PV,
	PALET,
	FGVAD, FGVDT,
	BGVAD, BGVDT, SCRPX, SCRPY,
	SPAAD, SPADT,
	VBLK, 1'b0,

	ROMCL,ROMAD,ROMDT,ROMEN
);

wire CS_PSG, CS_FGV, CS_BGV, CS_SPA, CS_PAL;
NINJAKUN_SADEC sadec( CPADR, CS_PSG, CS_FGV, CS_BGV, CS_SPA, CS_PAL );

wire  [7:0] PSDAT, FGDAT, BGDAT, SPDAT, PLDAT;

wire  [9:0] BGOFS =  CPADR[9:0]+{SCRPY[7:3],SCRPX[7:3]};
wire [10:0] BGADR = {CPADR[10],BGOFS};

VDPRAM400x2	fgv( SHCLK, CPADR[10:0], CS_FGV & CPWRT, CPODT, FGDAT, VRCLK, FGVAD, FGVDT );
VDPRAM400x2	bgv( SHCLK, BGADR      , CS_BGV & CPWRT, CPODT, BGDAT, VRCLK, BGVAD, BGVDT );
DPRAM800		spa( SHCLK, CPADR[10:0], CS_SPA & CPWRT, CPODT, SPDAT, VRCLK, SPAAD, 1'b0, 8'h0, SPADT );
DPRAM200		pal( SHCLK, CPADR[ 8:0], CS_PAL & CPWRT, CPODT, PLDAT,  VCLK, PALET, 1'b0, 8'h0, POUT  );

DSEL5_8B cpxdsel(
	CPIDT,
	CS_PSG, PSDAT,
	CS_FGV, FGDAT,
	CS_BGV, BGDAT,
	CS_SPA, SPDAT,
	CS_PAL, PLDAT
);

NINJAKUN_PSG psg(
	SHCLK, CLK3M, CPADR[1:0], CS_PSG, CPWRT, CPODT, PSDAT, RESET, CPRED,
	DSW1, DSW2, SCRPX, SCRPY,
	SNDOUT
);

endmodule
module NINJAKUN_IO_VIDEO
(
	input				SHCLK,
	input				CLK3M,
	input				RESET,

	input				VRCLK,
	input				VCLKx4,
	input				VCLK,
	input	  [8:0]	PH,
	input	  [8:0]	PV,

	input  [15:0]	CPADR,
	input   [7:0]	CPODT,
	output  [7:0]	CPIDT,
	input    		CPRED,
	input    		CPWRT,

	input   [7:0]  DSW1,
	input   [7:0]  DSW2,

	output			VBLK,
	output  [7:0]	POUT,

	output [15:0]	SNDOUT,
	
	input				ROMCL,
	input  [16:0]	ROMAD,
	input   [7:0]	ROMDT,
	input				ROMEN
);


wire  [9:0]	FGVAD;
wire [15:0]	FGVDT;
wire  [9:0]	BGVAD;
wire [15:0]	BGVDT;
wire [10:0]	SPAAD;
wire  [7:0]	SPADT;
wire  [7:0]	SCRPX, SCRPY;
wire  [8:0]	PALET;

NINJAKUN_VIDEO video (
	RESET, VCLKx4, VCLK, PH, PV,
	PALET,
	FGVAD, FGVDT,
	BGVAD, BGVDT, SCRPX, SCRPY,
	SPAAD, SPADT,
	VBLK, 1'b0,

	ROMCL,ROMAD,ROMDT,ROMEN
);

wire CS_PSG, CS_FGV, CS_BGV, CS_SPA, CS_PAL;
NINJAKUN_SADEC sadec( CPADR, CS_PSG, CS_FGV, CS_BGV, CS_SPA, CS_PAL );

wire  [7:0] PSDAT, FGDAT, BGDAT, SPDAT, PLDAT;

wire  [9:0] BGOFS =  CPADR[9:0]+{SCRPY[7:3],SCRPX[7:3]};
wire [10:0] BGADR = {CPADR[10],BGOFS};

VDPRAM400x2	fgv( SHCLK, CPADR[10:0], CS_FGV & CPWRT, CPODT, FGDAT, VRCLK, FGVAD, FGVDT );
VDPRAM400x2	bgv( SHCLK, BGADR      , CS_BGV & CPWRT, CPODT, BGDAT, VRCLK, BGVAD, BGVDT );
DPRAM800		spa( SHCLK, CPADR[10:0], CS_SPA & CPWRT, CPODT, SPDAT, VRCLK, SPAAD, 1'b0, 8'h0, SPADT );
DPRAM200		pal( SHCLK, CPADR[ 8:0], CS_PAL & CPWRT, CPODT, PLDAT,  VCLK, PALET, 1'b0, 8'h0, POUT  );

DSEL5_8B cpxdsel(
	CPIDT,
	CS_PSG, PSDAT,
	CS_FGV, FGDAT,
	CS_BGV, BGDAT,
	CS_SPA, SPDAT,
	CS_PAL, PLDAT
);

NINJAKUN_PSG psg(
	SHCLK, CLK3M, CPADR[1:0], CS_PSG, CPWRT, CPODT, PSDAT, RESET, CPRED,
	DSW1, DSW2, SCRPX, SCRPY,
	SNDOUT
);

endmodule