data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v
 line:118: before: "."
1: b'%Error: data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v:9: Cannot find include file: common_defines.v\n`include "common_defines.v" \n         ^~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source,data/full_repos/permissive/114714167/common_defines.v\n             data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source,data/full_repos/permissive/114714167/common_defines.v.v\n             data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source,data/full_repos/permissive/114714167/common_defines.v.sv\n             common_defines.v\n             common_defines.v.v\n             common_defines.v.sv\n             obj_dir/common_defines.v\n             obj_dir/common_defines.v.v\n             obj_dir/common_defines.v.sv\n%Error: data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v:14: Define or directive not defined: \'`REC_VAL_BIT_WIDTH\'\n reg signed [`REC_VAL_BIT_WIDTH-1:0] throttle_pwm_value_in = 0;\n             ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v:16: Define or directive not defined: \'`REC_VAL_BIT_WIDTH\'\n wire signed [`REC_VAL_BIT_WIDTH-1:0] throttle_pwm_value_out;\n              ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v:54: syntax error, unexpected \'@\'\n   repeat (2) @(posedge us_clk); start_signal    = 0; repeat (8) @(posedge us_clk);\n              ^\n%Error: data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v:54: syntax error, unexpected \'@\'\n   repeat (2) @(posedge us_clk); start_signal    = 0; repeat (8) @(posedge us_clk);\n                                                                 ^\n%Warning-STMTDLY: data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v:66: Unsupported: Ignoring delay on this delayed statement.\n  #10 resetn = 0;\n  ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/114714167/Source-Code/Drone2/impl1/source/test_throttle_controller.v:67: Unsupported: Ignoring delay on this delayed statement.\n  #10 resetn = 1;\n  ^\n%Error: Exiting due to 5 error(s), 2 warning(s)\n'
module test_throttle_controller;


	reg signed [`REC_VAL_BIT_WIDTH-1:0] throttle_pwm_value_in = 0;

	wire signed [`REC_VAL_BIT_WIDTH-1:0] throttle_pwm_value_out;

	reg  resetn;
	wire sys_clk;
	wire us_clk;
	wire complete_signal;
	wire active_signal;
	reg  start_signal;
	integer i;


	defparam OSCH_inst.NOM_FREQ = "38.00";
	OSCH OSCH_inst (.STDBY(1'b0),
       			    .OSC(sys_clk),
       			    .SEDSTDBY());

	us_clk us_clk_divider (
		.us_clk(us_clk),
		.sys_clk(sys_clk),
		.resetn(resetn));


	throttle_controller DUT (
		.throttle_pwm_value_in(throttle_pwm_value_in),
		.throttle_pwm_value_out(throttle_pwm_value_out),
		.complete_signal(complete_signal),
		.active_signal(active_signal),
		.resetn(resetn),
		.start_signal(start_signal),
		.us_clk(us_clk));


	task run_test;
		input reg [15:0] task_throttle_pwm_value_in;
		begin

			throttle_pwm_value_in = task_throttle_pwm_value_in;
			start_signal    = 1;
			repeat (2) @(posedge us_clk); start_signal    = 0; repeat (8) @(posedge us_clk);
			$display("%t: %m Throttle latched_throttle=%d",$time, DUT.latched_throttle);
			$display("%t: %m Throttle debounced_throttle=%d",$time, DUT.debounced_throttle);

			$display("%t: %m Throttle limited_throttle=%d",$time, DUT.limited_throttle);
			$display("%t: %m Throttle prev_throttle_pwm_value_out=%d",$time, DUT.prev_throttle_pwm_value_out);
		end
	endtask

	initial begin

		resetn = 1;
		#10 resetn = 0;
		#10 resetn = 1;


		run_test(.task_throttle_pwm_value_in(0));

		$display("\n\n\n%t: %m Throttle to ranges 0 to 255, MAX",$time);
		


		for(i = 0; i < 26*10; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(((i/10)*10)));
		end
		
		
		$display("%t: %m Test complete", $time);
		$display("\n\n\n%t: %m Throttle to ranges 255 to 0, MAX",$time);

		for(i = 25*10; i > 0; i=i-1) begin

			run_test(.task_throttle_pwm_value_in(((i/10)*10)));
		end
		
		
		$display("%t: %m Test complete", $time);
		
		
		$display("\n\n\n%t: %m Throttle to 250, MAX",$time);

		for(i = 0; i < 62; i=i+1) begin
			run_test(.task_throttle_pwm_value_in(250));
		end
		
		$display("%t: %m Test with 1 PWM cycle of 0 input, nothing should happen", $time);
		run_test(.task_throttle_pwm_value_in(250));
		run_test(.task_throttle_pwm_value_in(0));
		run_test(.task_throttle_pwm_value_in(250));
		
		$display("%t: %m Test with 2 PWM cycle of 0 input, throttle should cut off after second 0 input PWM", $time);
		run_test(.task_throttle_pwm_value_in(250));
		run_test(.task_throttle_pwm_value_in(0));
		run_test(.task_throttle_pwm_value_in(0));
		run_test(.task_throttle_pwm_value_in(250));
		
		$display("%t: %m Test complete", $time);
		$stop;
		$display("\n\n\n%t: %m Throttle to 250, MAX",$time);
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250));
		end
		


		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(10));
		end
		

		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250));
		end

		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(0));
		end
		
		

		

		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(125));
		end
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(135));

			run_test(.task_throttle_pwm_value_in(115));
		end
		
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250*0.40));
		end
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250*0.60));
		end

		$display("%t: %m Test complete", $time);
		$stop;
	end

endmodule
module test_throttle_controller;



	reg signed [`REC_VAL_BIT_WIDTH-1:0] throttle_pwm_value_in = 0;

	wire signed [`REC_VAL_BIT_WIDTH-1:0] throttle_pwm_value_out;

	reg  resetn;
	wire sys_clk;
	wire us_clk;
	wire complete_signal;
	wire active_signal;
	reg  start_signal;
	integer i;


	defparam OSCH_inst.NOM_FREQ = "38.00";
	OSCH OSCH_inst (.STDBY(1'b0),
       			    .OSC(sys_clk),
       			    .SEDSTDBY());

	us_clk us_clk_divider (
		.us_clk(us_clk),
		.sys_clk(sys_clk),
		.resetn(resetn));


	throttle_controller DUT (
		.throttle_pwm_value_in(throttle_pwm_value_in),
		.throttle_pwm_value_out(throttle_pwm_value_out),
		.complete_signal(complete_signal),
		.active_signal(active_signal),
		.resetn(resetn),
		.start_signal(start_signal),
		.us_clk(us_clk));


	task run_test;
		input reg [15:0] task_throttle_pwm_value_in;
		begin

			throttle_pwm_value_in = task_throttle_pwm_value_in;
			start_signal    = 1;
			repeat (2) @(posedge us_clk); start_signal    = 0; repeat (8) @(posedge us_clk);
			$display("%t: %m Throttle latched_throttle=%d",$time, DUT.latched_throttle);
			$display("%t: %m Throttle debounced_throttle=%d",$time, DUT.debounced_throttle);

			$display("%t: %m Throttle limited_throttle=%d",$time, DUT.limited_throttle);
			$display("%t: %m Throttle prev_throttle_pwm_value_out=%d",$time, DUT.prev_throttle_pwm_value_out);
		end
	endtask

	initial begin

		resetn = 1;
		#10 resetn = 0;
		#10 resetn = 1;


		run_test(.task_throttle_pwm_value_in(0));

		$display("\n\n\n%t: %m Throttle to ranges 0 to 255, MAX",$time);
		


		for(i = 0; i < 26*10; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(((i/10)*10)));
		end
		
		
		$display("%t: %m Test complete", $time);
		$display("\n\n\n%t: %m Throttle to ranges 255 to 0, MAX",$time);

		for(i = 25*10; i > 0; i=i-1) begin

			run_test(.task_throttle_pwm_value_in(((i/10)*10)));
		end
		
		
		$display("%t: %m Test complete", $time);
		
		
		$display("\n\n\n%t: %m Throttle to 250, MAX",$time);

		for(i = 0; i < 62; i=i+1) begin
			run_test(.task_throttle_pwm_value_in(250));
		end
		
		$display("%t: %m Test with 1 PWM cycle of 0 input, nothing should happen", $time);
		run_test(.task_throttle_pwm_value_in(250));
		run_test(.task_throttle_pwm_value_in(0));
		run_test(.task_throttle_pwm_value_in(250));
		
		$display("%t: %m Test with 2 PWM cycle of 0 input, throttle should cut off after second 0 input PWM", $time);
		run_test(.task_throttle_pwm_value_in(250));
		run_test(.task_throttle_pwm_value_in(0));
		run_test(.task_throttle_pwm_value_in(0));
		run_test(.task_throttle_pwm_value_in(250));
		
		$display("%t: %m Test complete", $time);
		$stop;
		$display("\n\n\n%t: %m Throttle to 250, MAX",$time);
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250));
		end
		


		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(10));
		end
		

		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250));
		end

		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(0));
		end
		
		

		

		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(125));
		end
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(135));

			run_test(.task_throttle_pwm_value_in(115));
		end
		
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250*0.40));
		end
		
		for(i = 0; i < 64; i=i+1) begin

			run_test(.task_throttle_pwm_value_in(250*0.60));
		end

		$display("%t: %m Test complete", $time);
		$stop;
	end

endmodule