data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v
1: b'%Warning-IMPLICIT: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:184: Signal definition not found, creating implicitly: \'sseg_wr\'\n                                                                                       : ... Suggested alternative: \'sseg_dp\'\n assign sseg_wr_val = { sseg_wr, sseg_en, sseg_sign, sseg_dp, sseg_val };\n                        ^~~~~~~\n                   ... Use "/* verilator lint_off IMPLICIT */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:131: Cannot find file containing module: \'mod_m_counter\'\n mod_m_counter #(.M_BITS(24)) tick_counter(.clk(clk), .reset(0), .m(LED_DISPLAY_PERIOD), .max_tick(led_tick), .q());\n ^~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/139213403/FPGA,data/full_repos/permissive/139213403/mod_m_counter\n             data/full_repos/permissive/139213403/FPGA,data/full_repos/permissive/139213403/mod_m_counter.v\n             data/full_repos/permissive/139213403/FPGA,data/full_repos/permissive/139213403/mod_m_counter.sv\n             mod_m_counter\n             mod_m_counter.v\n             mod_m_counter.sv\n             obj_dir/mod_m_counter\n             obj_dir/mod_m_counter.v\n             obj_dir/mod_m_counter.sv\n%Error: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:134: Cannot find file containing module: \'pwm\'\n pwm #(.N(WARN_PWM_BITS), .M(1)) warn_pwm(.clk(clk), .reset(warn_pwm_reset), .in(warn_pwm_en), .w(warn_pwm_brightness), .out(WARN));\n ^~~\n%Error: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:137: Cannot find file containing module: \'sseg_array\'\n sseg_array #(.SSEG_BITS(SSEG_BITS), .SSEG_N(SSEG_N), .PWM_BITS(SSEG_PWM_BITS), .LED_PERIOD_BITS(LED_PERIOD_BITS))\n ^~~~~~~~~~\n%Error: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:141: Cannot find file containing module: \'tick_counter\'\n tick_counter #(.N(SSEG_TICK_BITS)) sseg_tc(.clk(clk), .reset(sseg_tc_reset), .tick(sseg_done_tick), .counter(sseg_counter), .of(sseg_counter_of));                \n ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:144: Cannot find file containing module: \'led_matrix\'\n led_matrix #(.LEDS_N(LEDS_N), .LEDS_M(LEDS_M), .N_BITS(LEDS_N_BITS), .M_BITS(LEDS_M_BITS), .PWM_BITS(LEDS_PWM_BITS), .LED_PERIOD_BITS(LED_PERIOD_BITS))\n ^~~~~~~~~~\n%Error: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:147: Cannot find file containing module: \'tick_counter\'\n tick_counter #(.N(LEDS_COUNTER_BITS)) \n ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/139213403/FPGA/blastit_demo_marquee.v:151: Cannot find file containing module: \'mod_m_counter\'\n mod_m_counter #(.M_BITS(LED_PERIOD_BITS)) status_led_counter(.clk(clk), .reset(0), .m(LED_DISPLAY_PERIOD), .max_tick(led_tick), .q());\n ^~~~~~~~~~~~~\n%Error: Exiting due to 7 error(s), 1 warning(s)\n'
module blastit_main
(



	input wire CLOCK_50,




	input wire DAYLIGHT,
	



	input wire UART_RX,
	



	output wire[7:0] C_SSEG,
	



	output wire[15:0] C,
	



	output wire[7:0] D,
	



	output wire[9:0] G,
	



	output wire UART_TX,
	



	output wire[3:0] LED,
	



	output wire WARN
);




	localparam T = 20;
	localparam LED_DISPLAY_PERIOD = 24'd5000,
	           LED_PERIOD_BITS = 24;
	

	localparam WARN_PWM_BITS = 8;
	

	localparam SSEG_BITS=4,
				  SSEG_N=16,
				  SSEG_PWM_BITS=8,
				  SSEG_TICK_BITS=8;
				  

	localparam LEDS_N=10,
				  LEDS_M=8,
				  LEDS_N_BITS = 4,
				  LEDS_M_BITS = 4,
				  LEDS_PWM_BITS = 8,
				  LEDS_COUNTER_BITS = 8;
	



	
	genvar status_led_i, c_i, c_cseg_i, g_i, d_i;
	wire clk;
	wire led_tick;
				  

	wire warn_pwm_reset, warn_pwm_en;
	wire [WARN_PWM_BITS-1:0] warn_pwm_brightness;
	wire [3:0] status_led_en;
	wire [1:0] warn_pwm_control;
	reg [3:0] led_i_reg, led_i_next;
	

	wire sseg_reset, sseg_tc_reset;
	wire [SSEG_PWM_BITS-1:0] sseg_sel;
	wire [SSEG_BITS-1:0] sseg_addr;
	wire sseg_en, sseg_sign, sseg_dp;
	wire [3:0] sseg_val;
	wire [1:0] sseg_reset_control;
	wire [7:0] sseg_wr_val;
	

	wire [7:0] sseg;
	wire sseg_done_tick;
	wire [SSEG_N - 1:0] sseg_oe;
	wire [SSEG_TICK_BITS-1:0] sseg_counter;
	wire sseg_counter_of;
	

	wire leds_reset, leds_counter_reset;
	wire [LEDS_COUNTER_BITS-1:0] leds_brightness;
	wire [LEDS_N_BITS + LEDS_M_BITS - 1:0] leds_sel_addr;
	wire leds_sel, leds_en;
	wire [1:0] leds_reset_control;
	wire [2 + LEDS_N_BITS + LEDS_M_BITS - 1:0] leds_wr_val;
	

	wire [LEDS_N-1:0] leds_n_en;
	wire [LEDS_M-1:0] leds_m_en;
	wire leds_done_tick;
	wire [LEDS_COUNTER_BITS-1:0] leds_counter;
	wire leds_counter_of;
	



	

	mod_m_counter #(.M_BITS(24)) tick_counter(.clk(clk), .reset(0), .m(LED_DISPLAY_PERIOD), .max_tick(led_tick), .q());
	

	pwm #(.N(WARN_PWM_BITS), .M(1)) warn_pwm(.clk(clk), .reset(warn_pwm_reset), .in(warn_pwm_en), .w(warn_pwm_brightness), .out(WARN));
	

	sseg_array #(.SSEG_BITS(SSEG_BITS), .SSEG_N(SSEG_N), .PWM_BITS(SSEG_PWM_BITS), .LED_PERIOD_BITS(LED_PERIOD_BITS))
		sseg_array(.clk(clk), .reset(sseg_boost), .wr(sseg_wr), .brightness(sseg_boost),
					  .sel(sseg_sel_addr), .led_period(LED_DISPLAY_PERIOD), .en(sseg_en), .sign(sseg_sign), .dp(sseg_dp),
					  .val(sseg_val), .sseg(sseg), .oe(sseg_oe), .done_tick(sseg_done_tick));
	tick_counter #(.N(SSEG_TICK_BITS)) sseg_tc(.clk(clk), .reset(sseg_tc_reset), .tick(sseg_done_tick), .counter(sseg_counter), .of(sseg_counter_of));																
	

	led_matrix #(.LEDS_N(LEDS_N), .LEDS_M(LEDS_M), .N_BITS(LEDS_N_BITS), .M_BITS(LEDS_M_BITS), .PWM_BITS(LEDS_PWM_BITS), .LED_PERIOD_BITS(LED_PERIOD_BITS))
		led_boost(.clk(clk), .reset(leds_reset), .brightness(leds_brightness), .sel_addr(leds_sel_addr),
					 .sel(leds_sel), .led_period(LED_DISPLAY_PERIOD), .en(leds_en), .n_en(leds_n_en), .m_en(leds_m_en), .done_tick(leds_done_tick));
	tick_counter #(.N(LEDS_COUNTER_BITS)) 
		leds_tc(.clk(clk), .reset(leds_counter_reset), .tick(leds_done_tick), .counter(leds_counter), .of(leds_counter_of));
	

	mod_m_counter #(.M_BITS(LED_PERIOD_BITS)) status_led_counter(.clk(clk), .reset(0), .m(LED_DISPLAY_PERIOD), .max_tick(led_tick), .q());




	
	always @(posedge clk)
		begin
			led_i_reg <= led_i_next;
		end
		
	always @*
		begin
			led_i_next = led_i_reg;
			if (led_tick)
				begin
					led_i_next = led_i_reg + 1'b1;
					if (led_i_next == 4'd4)
						led_i_next = 0;
				end
		end
	



	
	assign clk = CLOCK_50;
	

	assign warn_pwm_control = { warn_pwm_reset, warn_pwm_en };
	

	assign sseg_reset_control = { sseg_reset, sseg_tc_reset };
	assign sseg_wr_val = { sseg_wr, sseg_en, sseg_sign, sseg_dp, sseg_val };
	

	assign leds_reset_control = { leds_reset, leds_counter_reset };
	assign leds_wr_val = { leds_sel, leds_en, leds_sel_addr };
	



				 						
	generate
		for (status_led_i = 0; status_led_i < 4; status_led_i = status_led_i + 1) begin:gen_status_led
			assign LED[status_led_i] = status_led_en[status_led_i] == 1'b1 ? 1'b0 : 1'bz;
		end
	
		for (c_i = 0; c_i < SSEG_N; c_i = c_i + 1) begin:gen_c
			assign C[c_i] = (sseg_oe[c_i] == 1'b1) ? 1'b1 : 1'bz;
		end
		
		for (c_cseg_i = 0; c_cseg_i < 8; c_cseg_i = c_cseg_i + 1) begin:gen_c_cseg
			assign C[c_cseg_i] = (sseg[c_i] == 1'b0) ? 1'b0 : 1'bz;
		end
		
		for (g_i = 0; g_i < LEDS_N; g_i = g_i + 1) begin:gen_g
			assign G[g_i] = (leds_n_en[g_i] == 1'b1) ? 1'b0 : 1'bz;
		end
		
		for (d_i = 0; d_i < LEDS_M; d_i = d_i + 1) begin:gen_d
			assign D[d_i] = (leds_m_en[d_i] == 1'b1) ? 1'b1 : 1'bz;
		end
	endgenerate
	
endmodule
module blastit_main
(



	input wire CLOCK_50,




	input wire DAYLIGHT,
	



	input wire UART_RX,
	



	output wire[7:0] C_SSEG,
	



	output wire[15:0] C,
	



	output wire[7:0] D,
	



	output wire[9:0] G,
	



	output wire UART_TX,
	



	output wire[3:0] LED,
	



	output wire WARN
);





	localparam T = 20;
	localparam LED_DISPLAY_PERIOD = 24'd5000,
	           LED_PERIOD_BITS = 24;
	

	localparam WARN_PWM_BITS = 8;
	

	localparam SSEG_BITS=4,
				  SSEG_N=16,
				  SSEG_PWM_BITS=8,
				  SSEG_TICK_BITS=8;
				  

	localparam LEDS_N=10,
				  LEDS_M=8,
				  LEDS_N_BITS = 4,
				  LEDS_M_BITS = 4,
				  LEDS_PWM_BITS = 8,
				  LEDS_COUNTER_BITS = 8;
	



	
	genvar status_led_i, c_i, c_cseg_i, g_i, d_i;
	wire clk;
	wire led_tick;
				  

	wire warn_pwm_reset, warn_pwm_en;
	wire [WARN_PWM_BITS-1:0] warn_pwm_brightness;
	wire [3:0] status_led_en;
	wire [1:0] warn_pwm_control;
	reg [3:0] led_i_reg, led_i_next;
	

	wire sseg_reset, sseg_tc_reset;
	wire [SSEG_PWM_BITS-1:0] sseg_sel;
	wire [SSEG_BITS-1:0] sseg_addr;
	wire sseg_en, sseg_sign, sseg_dp;
	wire [3:0] sseg_val;
	wire [1:0] sseg_reset_control;
	wire [7:0] sseg_wr_val;
	

	wire [7:0] sseg;
	wire sseg_done_tick;
	wire [SSEG_N - 1:0] sseg_oe;
	wire [SSEG_TICK_BITS-1:0] sseg_counter;
	wire sseg_counter_of;
	

	wire leds_reset, leds_counter_reset;
	wire [LEDS_COUNTER_BITS-1:0] leds_brightness;
	wire [LEDS_N_BITS + LEDS_M_BITS - 1:0] leds_sel_addr;
	wire leds_sel, leds_en;
	wire [1:0] leds_reset_control;
	wire [2 + LEDS_N_BITS + LEDS_M_BITS - 1:0] leds_wr_val;
	

	wire [LEDS_N-1:0] leds_n_en;
	wire [LEDS_M-1:0] leds_m_en;
	wire leds_done_tick;
	wire [LEDS_COUNTER_BITS-1:0] leds_counter;
	wire leds_counter_of;
	



	

	mod_m_counter #(.M_BITS(24)) tick_counter(.clk(clk), .reset(0), .m(LED_DISPLAY_PERIOD), .max_tick(led_tick), .q());
	

	pwm #(.N(WARN_PWM_BITS), .M(1)) warn_pwm(.clk(clk), .reset(warn_pwm_reset), .in(warn_pwm_en), .w(warn_pwm_brightness), .out(WARN));
	

	sseg_array #(.SSEG_BITS(SSEG_BITS), .SSEG_N(SSEG_N), .PWM_BITS(SSEG_PWM_BITS), .LED_PERIOD_BITS(LED_PERIOD_BITS))
		sseg_array(.clk(clk), .reset(sseg_boost), .wr(sseg_wr), .brightness(sseg_boost),
					  .sel(sseg_sel_addr), .led_period(LED_DISPLAY_PERIOD), .en(sseg_en), .sign(sseg_sign), .dp(sseg_dp),
					  .val(sseg_val), .sseg(sseg), .oe(sseg_oe), .done_tick(sseg_done_tick));
	tick_counter #(.N(SSEG_TICK_BITS)) sseg_tc(.clk(clk), .reset(sseg_tc_reset), .tick(sseg_done_tick), .counter(sseg_counter), .of(sseg_counter_of));																
	

	led_matrix #(.LEDS_N(LEDS_N), .LEDS_M(LEDS_M), .N_BITS(LEDS_N_BITS), .M_BITS(LEDS_M_BITS), .PWM_BITS(LEDS_PWM_BITS), .LED_PERIOD_BITS(LED_PERIOD_BITS))
		led_boost(.clk(clk), .reset(leds_reset), .brightness(leds_brightness), .sel_addr(leds_sel_addr),
					 .sel(leds_sel), .led_period(LED_DISPLAY_PERIOD), .en(leds_en), .n_en(leds_n_en), .m_en(leds_m_en), .done_tick(leds_done_tick));
	tick_counter #(.N(LEDS_COUNTER_BITS)) 
		leds_tc(.clk(clk), .reset(leds_counter_reset), .tick(leds_done_tick), .counter(leds_counter), .of(leds_counter_of));
	

	mod_m_counter #(.M_BITS(LED_PERIOD_BITS)) status_led_counter(.clk(clk), .reset(0), .m(LED_DISPLAY_PERIOD), .max_tick(led_tick), .q());




	
	always @(posedge clk)
		begin
			led_i_reg <= led_i_next;
		end
		
	always @*
		begin
			led_i_next = led_i_reg;
			if (led_tick)
				begin
					led_i_next = led_i_reg + 1'b1;
					if (led_i_next == 4'd4)
						led_i_next = 0;
				end
		end
	



	
	assign clk = CLOCK_50;
	

	assign warn_pwm_control = { warn_pwm_reset, warn_pwm_en };
	

	assign sseg_reset_control = { sseg_reset, sseg_tc_reset };
	assign sseg_wr_val = { sseg_wr, sseg_en, sseg_sign, sseg_dp, sseg_val };
	

	assign leds_reset_control = { leds_reset, leds_counter_reset };
	assign leds_wr_val = { leds_sel, leds_en, leds_sel_addr };
	



				 						
	generate
		for (status_led_i = 0; status_led_i < 4; status_led_i = status_led_i + 1) begin:gen_status_led
			assign LED[status_led_i] = status_led_en[status_led_i] == 1'b1 ? 1'b0 : 1'bz;
		end
	
		for (c_i = 0; c_i < SSEG_N; c_i = c_i + 1) begin:gen_c
			assign C[c_i] = (sseg_oe[c_i] == 1'b1) ? 1'b1 : 1'bz;
		end
		
		for (c_cseg_i = 0; c_cseg_i < 8; c_cseg_i = c_cseg_i + 1) begin:gen_c_cseg
			assign C[c_cseg_i] = (sseg[c_i] == 1'b0) ? 1'b0 : 1'bz;
		end
		
		for (g_i = 0; g_i < LEDS_N; g_i = g_i + 1) begin:gen_g
			assign G[g_i] = (leds_n_en[g_i] == 1'b1) ? 1'b0 : 1'bz;
		end
		
		for (d_i = 0; d_i < LEDS_M; d_i = d_i + 1) begin:gen_d
			assign D[d_i] = (leds_m_en[d_i] == 1'b1) ? 1'b1 : 1'bz;
		end
	endgenerate
	
endmodule