data/full_repos/permissive/422882113/rtl/sdram.sv
1: b'%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:54: Define or directive not defined: \'`SDRAM_ROWBITS\'\n output reg [`SDRAM_ROWBITS-1:0] SDRAM_A,     \n             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:105: Define or directive not defined: \'`SDRAM_tRC\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam BANK_DELAY = ((`SDRAM_tRC+(SDRAM_tCK-1))/SDRAM_tCK)-2;  \n                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:106: Define or directive not defined: \'`SDRAM_tRP\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam BANK_WRITE_DELAY = ((`SDRAM_tRP+(SDRAM_tCK-1))/SDRAM_tCK)+`SDRAM_tWR;  \n                                ^~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:106: Define or directive not defined: \'`SDRAM_tWR\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam BANK_WRITE_DELAY = ((`SDRAM_tRP+(SDRAM_tCK-1))/SDRAM_tCK)+`SDRAM_tWR;  \n                                                                     ^~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:106: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\nlocalparam BANK_WRITE_DELAY = ((`SDRAM_tRP+(SDRAM_tCK-1))/SDRAM_tCK)+`SDRAM_tWR;  \n                                                                               ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:107: Define or directive not defined: \'`SDRAM_tRC\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam REFRESH_DELAY = ((`SDRAM_tRC+(SDRAM_tCK-1))/SDRAM_tCK)-1;  \n                             ^~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:109: Define or directive not defined: \'`SDRAM_tCKminCL2\'\ninitial assert(2!=2 || SDRAM_tCK>=`SDRAM_tCKminCL2)\n                                  ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:109: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\ninitial assert(2!=2 || SDRAM_tCK>=`SDRAM_tCKminCL2)\n                                                  ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:110: Define or directive not defined: \'`SDRAM_tCKminCL2\'\n else $error("CL2 not allowed at %d MHz (max speed is %d)",1000000/SDRAM_tCK,1000000/`SDRAM_tCKminCL2);\n                                                                                     ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:303: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam bank0_rowbits=(22-`SDRAM_COLBITS);  \n                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:303: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\nlocalparam bank0_rowbits=(22-`SDRAM_COLBITS);  \n                                           ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:304: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam bank1_rowbits=(16-`SDRAM_COLBITS);\n                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:304: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\nlocalparam bank1_rowbits=(16-`SDRAM_COLBITS);\n                                           ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:305: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam bank2_rowbits=(15-`SDRAM_COLBITS);\n                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:305: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\nlocalparam bank2_rowbits=(15-`SDRAM_COLBITS);\n                                           ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:306: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nlocalparam bank3_rowbits=(15-`SDRAM_COLBITS);\n                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:306: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\nlocalparam bank3_rowbits=(15-`SDRAM_COLBITS);\n                                           ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:417: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n  bankaddr[0][`SDRAM_COLBITS:1]<=rom_addr[`SDRAM_COLBITS:1];  \n              ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:417: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n  bankaddr[0][`SDRAM_COLBITS:1]<=rom_addr[`SDRAM_COLBITS:1];  \n                            ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:417: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n  bankaddr[0][`SDRAM_COLBITS:1]<=rom_addr[`SDRAM_COLBITS:1];  \n                                          ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:418: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n  bankaddr[0][23:`SDRAM_COLBITS+1]<={1\'b0,refresh_addr_0}; \n                 ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:443: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n  bankaddr[1][`SDRAM_COLBITS:1]<=wram_addr[`SDRAM_COLBITS:1];  \n              ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:443: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n  bankaddr[1][`SDRAM_COLBITS:1]<=wram_addr[`SDRAM_COLBITS:1];  \n                            ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:443: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n  bankaddr[1][`SDRAM_COLBITS:1]<=wram_addr[`SDRAM_COLBITS:1];  \n                                           ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:444: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n  bankaddr[1][23:`SDRAM_COLBITS+1]<={7\'b0000001,refresh_addr_1};\n                 ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:470: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n   bankaddr[2][`SDRAM_COLBITS:1]<=vram0_addr[`SDRAM_COLBITS:1];  \n               ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:470: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n   bankaddr[2][`SDRAM_COLBITS:1]<=vram0_addr[`SDRAM_COLBITS:1];  \n                             ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:470: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n   bankaddr[2][`SDRAM_COLBITS:1]<=vram0_addr[`SDRAM_COLBITS:1];  \n                                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:471: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n   bankaddr[2][23:`SDRAM_COLBITS+1]<={8\'h00,refresh_addr_2};\n                  ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:496: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n   bankaddr[3][`SDRAM_COLBITS:1]<=vram1_addr[`SDRAM_COLBITS:1];  \n               ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:496: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n   bankaddr[3][`SDRAM_COLBITS:1]<=vram1_addr[`SDRAM_COLBITS:1];  \n                             ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:496: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n   bankaddr[3][`SDRAM_COLBITS:1]<=vram1_addr[`SDRAM_COLBITS:1];  \n                                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:497: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n   bankaddr[3][23:`SDRAM_COLBITS+1]<={8\'h00,refresh_addr_3};\n                  ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:538: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\nreg [`SDRAM_COLBITS-1:0] ras_casaddr;\n     ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:554: Define or directive not defined: \'`SDRAM_ROWBITS\'\nreg [`SDRAM_ROWBITS-1:0] cas_addr;\n     ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:687: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n      ras_casaddr<=bankaddr[2][`SDRAM_COLBITS:1];\n                               ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:687: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n      ras_casaddr<=bankaddr[2][`SDRAM_COLBITS:1];\n                                             ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:695: Define or directive not defined: \'`SDRAM_ROWBITS\'\n      SDRAM_A <= bankaddr[2][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:695: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n      SDRAM_A <= bankaddr[2][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                                            ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:695: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n      SDRAM_A <= bankaddr[2][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                                                          ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:695: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n      SDRAM_A <= bankaddr[2][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                                                           ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:702: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n      ras_casaddr<=bankaddr[3][`SDRAM_COLBITS:1];\n                               ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:702: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n      ras_casaddr<=bankaddr[3][`SDRAM_COLBITS:1];\n                                             ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:710: Define or directive not defined: \'`SDRAM_ROWBITS\'\n      SDRAM_A <= bankaddr[3][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                             ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:710: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n      SDRAM_A <= bankaddr[3][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                                            ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:710: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n      SDRAM_A <= bankaddr[3][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                                                          ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:710: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n      SDRAM_A <= bankaddr[3][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                                                           ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:717: Define or directive not defined: \'`SDRAM_COLBITS\'\n                                                             : ... Suggested alternative: \'`SDRAM_CL\'\n      ras_casaddr<=bankaddr[0][`SDRAM_COLBITS:1];\n                               ^~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:717: syntax error, unexpected \':\', expecting TYPE-IDENTIFIER\n      ras_casaddr<=bankaddr[0][`SDRAM_COLBITS:1];\n                                             ^\n%Error: data/full_repos/permissive/422882113/rtl/sdram.sv:725: Define or directive not defined: \'`SDRAM_ROWBITS\'\n      SDRAM_A <= bankaddr[0][`SDRAM_ROWBITS+`SDRAM_COLBITS:`SDRAM_COLBITS+1];\n                             ^~~~~~~~~~~~~~\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module refresh_schedule #(parameter tCK=7813, parameter tREF=64, parameter rowbits=13)
(
	input clk,
	input reset_n,
	input refreshing,
	input allow,
	output refresh_req,
	output refresh_force,
	output [rowbits-1:0] addr
);





localparam khz = (10**9)/tCK;
localparam ticksperrefresh = (khz*tREF)/(2**rowbits)-2;
localparam forcetime = ticksperrefresh-4;
reg [19:0] refresh_count;
reg need_refresh;
reg force_refresh;

reg [rowbits-1:0] addr_r;

assign refresh_req=(allow & need_refresh) | force_refresh;
assign refresh_force=force_refresh;

always @(posedge clk or negedge reset_n) begin
	if(!reset_n) begin
		addr_r<={rowbits{1'b0}};
		refresh_count<=20'b0;
`ifdef VERILATOR
		$display("%m : tpr %d",ticksperrefresh);
`endif
	end else begin
		refresh_count<=refresh_count+1'b1;

		if(refreshing) begin
			need_refresh<=1'b0;
			force_refresh<=1'b0;
			addr_r<=addr_r+1'b1;
		end

		if(refresh_count==ticksperrefresh) begin
			need_refresh<=1'b1;
			refresh_count<=20'b0;
		end

		if(refresh_count==forcetime) begin
			force_refresh<=need_refresh;
		end
	end
end

assign addr=addr_r;

endmodule
module refresh_schedule #(parameter tCK=7813, parameter tREF=64, parameter rowbits=13)
(
	input clk,
	input reset_n,
	input refreshing,
	input allow,
	output refresh_req,
	output refresh_force,
	output [rowbits-1:0] addr
);






localparam khz = (10**9)/tCK;
localparam ticksperrefresh = (khz*tREF)/(2**rowbits)-2;
localparam forcetime = ticksperrefresh-4;
reg [19:0] refresh_count;
reg need_refresh;
reg force_refresh;

reg [rowbits-1:0] addr_r;

assign refresh_req=(allow & need_refresh) | force_refresh;
assign refresh_force=force_refresh;

always @(posedge clk or negedge reset_n) begin
	if(!reset_n) begin
		addr_r<={rowbits{1'b0}};
		refresh_count<=20'b0;
`ifdef VERILATOR
		$display("%m : tpr %d",ticksperrefresh);
`endif
	end else begin
		refresh_count<=refresh_count+1'b1;

		if(refreshing) begin
			need_refresh<=1'b0;
			force_refresh<=1'b0;
			addr_r<=addr_r+1'b1;
		end

		if(refresh_count==ticksperrefresh) begin
			need_refresh<=1'b1;
			refresh_count<=20'b0;
		end

		if(refresh_count==forcetime) begin
			force_refresh<=need_refresh;
		end
	end
end

assign addr=addr_r;

endmodule