data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v
1: b'%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:46: syntax error, unexpected \'@\'\n  @(posedge clk);\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:47: Unsupported: Ignoring delay on this delayed statement.\n  #100;\n  ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:49: syntax error, unexpected \'@\'\n  @(posedge clk);\n  ^\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:50: Unsupported: wait statements\n  wait (req == 1\'b1);\n  ^~~~\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:51: syntax error, unexpected \'@\'\n  @(posedge clk);\n  ^\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:74: Unsupported or unknown PLI call: $monitor\n    $monitor("data = %b", data);\n    ^~~~~~~~\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:75: syntax error, unexpected \'@\'\n    @(posedge clk);\n    ^\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:98: Unsupported or unknown PLI call: $monitor\n    $monitor("data = %b", data);\n    ^~~~~~~~\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:99: syntax error, unexpected \'@\'\n    @(posedge clk);\n    ^\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:124: Unsupported or unknown PLI call: $monitor\n    $monitor("data = %b", data);\n    ^~~~~~~~\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:125: syntax error, unexpected \'@\'\n    @(posedge clk);\n    ^\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:132: syntax error, unexpected \'@\'\n  @(posedge clk);\n  ^\n%Error: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:134: syntax error, unexpected \'@\'\n  @(posedge clk);\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/21716763/uncle_gates/stimulus_gen.v:136: Unsupported: Ignoring delay on this delayed statement.\n  #100;\n  ^\n%Error: Exiting due to 12 error(s), 2 warning(s)\n'
module stimulus_gen(clk, rst, req, stm_value, rsb, gnt);

	parameter INPUT_PORTS = 3;
	parameter RESET_PORT = 1;
	parameter RESET_SENS = 0;
	

	input clk;
	input rst;
	input req;
	
	output [INPUT_PORTS-1: 0] stm_value; 
	output rsb;
	output gnt;
	
	reg rsb;
	reg gnt;

	reg [INPUT_PORTS-1:0] data;
	integer fd;
	integer code, dummy;
	reg [(INPUT_PORTS)*8-1:0] str;
	
	assign stm_value = data;

	initial begin
		rsb = 1'b0;
		gnt = 1'b0;
		
		@(posedge clk);
		#100;
		
		@(posedge clk);
		wait (req == 1'b1);
		@(posedge clk);


		if(RESET_PORT == 0) begin
		

			if(INPUT_PORTS == 1)
				fd = $fopen("ncl_stimul_1input.txt","r"); 
			else if(INPUT_PORTS == 2)
				fd = $fopen("ncl_stimul_2input.txt","r"); 
			else if(INPUT_PORTS == 3)
				fd = $fopen("ncl_stimul_3input.txt","r"); 
			else if(INPUT_PORTS == 4)
				fd = $fopen("ncl_stimul_4input.txt","r"); 
			
			data = {INPUT_PORTS-1{1'b0}};
			code = 1;

			while (code) begin
				code = $fgets(str, fd);
				dummy = $sscanf(str, "%b", data);
				code = $fgets(str, fd);
				rsb = 1'b0;
				$monitor("data = %b", data);
				@(posedge clk);
			end
		end
		else if(RESET_PORT == 1) begin
		

			if(INPUT_PORTS == 1)
				fd = $fopen("ncl_stimul_1input.txt","r"); 
			else if(INPUT_PORTS == 2)
				fd = $fopen("ncl_stimul_2input.txt","r"); 
			else if(INPUT_PORTS == 3)
				fd = $fopen("ncl_stimul_3input.txt","r"); 
			else if(INPUT_PORTS == 4)
				fd = $fopen("ncl_stimul_4input.txt","r"); 
			
			data = {INPUT_PORTS-1{1'b0}};
			code = 1;

			while (code) begin
				code = $fgets(str, fd);
				dummy = $sscanf(str, "%b", data);
				code = $fgets(str, fd);
				rsb = 1'b0;
				$monitor("data = %b", data);
				@(posedge clk);
			end


			$fclose(fd); 
			
			

			if(INPUT_PORTS == 1)
				fd = $fopen("ncl_stimul_1input.txt","r"); 
			else if(INPUT_PORTS == 2)
				fd = $fopen("ncl_stimul_2input.txt","r"); 
			else if(INPUT_PORTS == 3)
				fd = $fopen("ncl_stimul_3input.txt","r"); 
			else if(INPUT_PORTS == 4)
				fd = $fopen("ncl_stimul_4input.txt","r"); 
			
			data = {INPUT_PORTS-1{1'b0}};
			code = 1;

			while (code) begin
				code = $fgets(str, fd);
				dummy = $sscanf(str, "%b", data);
				code = $fgets(str, fd);
				rsb = 1'b1;
				$monitor("data = %b", data);
				@(posedge clk);
			end
			
			$fclose(fd); 
			
		end
		
		@(posedge clk);
		gnt = 1'b1;
		@(posedge clk);
		gnt = 1'b0;
		#100;

	end

endmodule
module stimulus_gen(clk, rst, req, stm_value, rsb, gnt);


	parameter INPUT_PORTS = 3;
	parameter RESET_PORT = 1;
	parameter RESET_SENS = 0;
	

	input clk;
	input rst;
	input req;
	
	output [INPUT_PORTS-1: 0] stm_value; 
	output rsb;
	output gnt;
	
	reg rsb;
	reg gnt;

	reg [INPUT_PORTS-1:0] data;
	integer fd;
	integer code, dummy;
	reg [(INPUT_PORTS)*8-1:0] str;
	
	assign stm_value = data;

	initial begin
		rsb = 1'b0;
		gnt = 1'b0;
		
		@(posedge clk);
		#100;
		
		@(posedge clk);
		wait (req == 1'b1);
		@(posedge clk);


		if(RESET_PORT == 0) begin
		

			if(INPUT_PORTS == 1)
				fd = $fopen("ncl_stimul_1input.txt","r"); 
			else if(INPUT_PORTS == 2)
				fd = $fopen("ncl_stimul_2input.txt","r"); 
			else if(INPUT_PORTS == 3)
				fd = $fopen("ncl_stimul_3input.txt","r"); 
			else if(INPUT_PORTS == 4)
				fd = $fopen("ncl_stimul_4input.txt","r"); 
			
			data = {INPUT_PORTS-1{1'b0}};
			code = 1;

			while (code) begin
				code = $fgets(str, fd);
				dummy = $sscanf(str, "%b", data);
				code = $fgets(str, fd);
				rsb = 1'b0;
				$monitor("data = %b", data);
				@(posedge clk);
			end
		end
		else if(RESET_PORT == 1) begin
		

			if(INPUT_PORTS == 1)
				fd = $fopen("ncl_stimul_1input.txt","r"); 
			else if(INPUT_PORTS == 2)
				fd = $fopen("ncl_stimul_2input.txt","r"); 
			else if(INPUT_PORTS == 3)
				fd = $fopen("ncl_stimul_3input.txt","r"); 
			else if(INPUT_PORTS == 4)
				fd = $fopen("ncl_stimul_4input.txt","r"); 
			
			data = {INPUT_PORTS-1{1'b0}};
			code = 1;

			while (code) begin
				code = $fgets(str, fd);
				dummy = $sscanf(str, "%b", data);
				code = $fgets(str, fd);
				rsb = 1'b0;
				$monitor("data = %b", data);
				@(posedge clk);
			end


			$fclose(fd); 
			
			

			if(INPUT_PORTS == 1)
				fd = $fopen("ncl_stimul_1input.txt","r"); 
			else if(INPUT_PORTS == 2)
				fd = $fopen("ncl_stimul_2input.txt","r"); 
			else if(INPUT_PORTS == 3)
				fd = $fopen("ncl_stimul_3input.txt","r"); 
			else if(INPUT_PORTS == 4)
				fd = $fopen("ncl_stimul_4input.txt","r"); 
			
			data = {INPUT_PORTS-1{1'b0}};
			code = 1;

			while (code) begin
				code = $fgets(str, fd);
				dummy = $sscanf(str, "%b", data);
				code = $fgets(str, fd);
				rsb = 1'b1;
				$monitor("data = %b", data);
				@(posedge clk);
			end
			
			$fclose(fd); 
			
		end
		
		@(posedge clk);
		gnt = 1'b1;
		@(posedge clk);
		gnt = 1'b0;
		#100;

	end

endmodule