data/full_repos/permissive/127311496/src/v/Infrastructure/VGADevice.v
1: b'%Warning-WIDTH: data/full_repos/permissive/127311496/src/v/Infrastructure/VGADevice.v:37: Operator ADD expects 32 or 19 bits on the RHS, but RHS\'s SEL generates 10 bits.\n                                                                                        : ... In instance VGADevice\n  assign addra = addrBus_reg[18:10] * 640 + addrBus_reg[9:0];\n                                          ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/127311496/src/v/Infrastructure/VGADevice.v:38: Operator ADD expects 32 or 19 bits on the RHS, but RHS\'s VARREF \'HCoord\' generates 10 bits.\n                                                                                        : ... In instance VGADevice\n  assign addrb = VCoord * 640 + HCoord;\n                              ^\n%Error: data/full_repos/permissive/127311496/src/v/Infrastructure/VGADevice.v:39: Cannot find file containing module: \'GraphicVRAM\'\n  GraphicVRAM RAM0 (.clka(clkMem), .ena(ena_reg[1]), .wea(wea_reg[1]), .addra(addra_reg),\n  ^~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/127311496/src/v/Infrastructure,data/full_repos/permissive/127311496/GraphicVRAM\n             data/full_repos/permissive/127311496/src/v/Infrastructure,data/full_repos/permissive/127311496/GraphicVRAM.v\n             data/full_repos/permissive/127311496/src/v/Infrastructure,data/full_repos/permissive/127311496/GraphicVRAM.sv\n             GraphicVRAM\n             GraphicVRAM.v\n             GraphicVRAM.sv\n             obj_dir/GraphicVRAM\n             obj_dir/GraphicVRAM.v\n             obj_dir/GraphicVRAM.sv\n%Error: data/full_repos/permissive/127311496/src/v/Infrastructure/VGADevice.v:68: Cannot find file containing module: \'CharVRAM\'\n CharVRAM RAM1(.clka(clkMem), .ena(en_Char), .wea(weBus), .addra(addrBus[13:2]),\n ^~~~~~~~\n%Error: data/full_repos/permissive/127311496/src/v/Infrastructure/VGADevice.v:71: Cannot find file containing module: \'CharROM\'\n CharROM ROM0(.clk(clkVGA), .ascii(chData[7:0]), .x(HCoord_reg), .y(VCoord[3:0]), .dot(charDot));\n ^~~~~~~\n%Error: data/full_repos/permissive/127311496/src/v/Infrastructure/VGADevice.v:74: Cannot find file containing module: \'VGAScan\'\n VGAScan #(.HCALIBRATE(0), .VCALIBRATE(0)) U0(\n ^~~~~~~\n%Error: Exiting due to 4 error(s), 2 warning(s)\n'
module vgaCursorGen(
	input clk, input [31:0] ctrl,
	input [9:0] HCoord, input [8:0] VCoord, output reg en
);
`define CURSOR_X ctrl[6:0]
`define CURSOR_Y ctrl[12:8]
`define CURSOR_FREQ ctrl[23:16]
	
	reg blink = 0;
	reg [18:0] counter0 = 0;
	reg [7:0] counter1 = 0;
	wire en_ascii;
	always @ (posedge clk)
	begin
		if(counter0 == 0)
		begin
			counter0 <= 19'd390625;
			if(`CURSOR_FREQ == 0)
				blink <= 1'b0;
			else if(counter1 == 0)
				blink <= ~blink;
			
			if(counter1 == 0)
				counter1 <= `CURSOR_FREQ;
			else
				counter1 <= counter1 - 1'b1;
		end
		else
			counter0 <= counter0 - 1'b1;
		
		en <= blink & en_ascii;
	end
	
	assign en_ascii = (HCoord[9:3] == `CURSOR_X) & (VCoord[8:4] == `CURSOR_Y);
	
endmodule
module vgaCursorGen(
	input clk, input [31:0] ctrl,
	input [9:0] HCoord, input [8:0] VCoord, output reg en
);

`define CURSOR_X ctrl[6:0]
`define CURSOR_Y ctrl[12:8]
`define CURSOR_FREQ ctrl[23:16]
	
	reg blink = 0;
	reg [18:0] counter0 = 0;
	reg [7:0] counter1 = 0;
	wire en_ascii;
	always @ (posedge clk)
	begin
		if(counter0 == 0)
		begin
			counter0 <= 19'd390625;
			if(`CURSOR_FREQ == 0)
				blink <= 1'b0;
			else if(counter1 == 0)
				blink <= ~blink;
			
			if(counter1 == 0)
				counter1 <= `CURSOR_FREQ;
			else
				counter1 <= counter1 - 1'b1;
		end
		else
			counter0 <= counter0 - 1'b1;
		
		en <= blink & en_ascii;
	end
	
	assign en_ascii = (HCoord[9:3] == `CURSOR_X) & (VCoord[8:4] == `CURSOR_Y);
	
endmodule