data/full_repos/permissive/43856783/I2C/controller_tst.v
1: b'%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:78: 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%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:81: Unsupported: Ignoring delay on this delayed statement.\n  #150 en = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:82: Unsupported: Ignoring delay on this delayed statement.\n  #150 en = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:83: Unsupported: Ignoring delay on this delayed statement.\n  #3600;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:86: Unsupported: Ignoring delay on this delayed statement.\n  #335;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:88: Unsupported: Ignoring delay on this delayed statement.\n  #3665 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:89: Unsupported: Ignoring delay on this delayed statement.\n  #335 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:90: Unsupported: Ignoring delay on this delayed statement.\n  #3630 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:91: Unsupported: Ignoring delay on this delayed statement.\n  #335 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:93: Unsupported: Ignoring delay on this delayed statement.\n  #4505 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:94: Unsupported: Ignoring delay on this delayed statement.\n  #335 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:95: Unsupported: Ignoring delay on this delayed statement.\n  #3628 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:96: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:97: Unsupported: Ignoring delay on this delayed statement.\n  #3570 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:98: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:100: Unsupported: Ignoring delay on this delayed statement.\n  #4460 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:101: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:102: Unsupported: Ignoring delay on this delayed statement.\n  #3580 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:103: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:104: Unsupported: Ignoring delay on this delayed statement.\n  #3570 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:105: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:107: Unsupported: Ignoring delay on this delayed statement.\n  #4460 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:108: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:109: Unsupported: Ignoring delay on this delayed statement.\n  #3570 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:110: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:111: Unsupported: Ignoring delay on this delayed statement.\n  #3570 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:112: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:114: Unsupported: Ignoring delay on this delayed statement.\n  #4460 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:115: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:116: Unsupported: Ignoring delay on this delayed statement.\n  #3570 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:117: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:118: Unsupported: Ignoring delay on this delayed statement.\n  #3570 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:119: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:121: Unsupported: Ignoring delay on this delayed statement.\n  #4000 en = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:122: Unsupported: Ignoring delay on this delayed statement.\n  #150 en  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:124: Unsupported: Ignoring delay on this delayed statement.\n  #3810 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:125: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:126: Unsupported: Ignoring delay on this delayed statement.\n  #3570 SDA_oen  = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:127: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen  = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:129: Unsupported: Ignoring delay on this delayed statement.\n  #4040 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:130: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:131: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:132: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:133: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:134: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:135: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:136: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:137: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:138: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_oen = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:139: Unsupported: Ignoring delay on this delayed statement.\n  #385 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:142: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:143: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:144: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:145: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:146: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:147: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:148: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:149: Unsupported: Ignoring delay on this delayed statement.\n  #495 SDA_oen = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:150: Unsupported: Ignoring delay on this delayed statement.\n  #413 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:153: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:154: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:155: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:156: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:157: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:158: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:159: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:160: Unsupported: Ignoring delay on this delayed statement.\n  #495 SDA_oen = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:161: Unsupported: Ignoring delay on this delayed statement.\n  #413 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:164: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:165: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:166: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:167: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:168: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:169: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:170: Unsupported: Ignoring delay on this delayed statement.\n  #440 SDA_out = 0;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:171: Unsupported: Ignoring delay on this delayed statement.\n  #495 SDA_oen = 1;  \n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:172: Unsupported: Ignoring delay on this delayed statement.\n  #370 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:175: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:176: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:177: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:178: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:179: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:180: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:181: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:182: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:183: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:184: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:185: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:186: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:187: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:188: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:189: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:190: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:191: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:192: Unsupported: Ignoring delay on this delayed statement.\n  #425 SDA_oen = 0;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:193: Unsupported: Ignoring delay on this delayed statement.\n  #3535 SDA_oen = 1;\n  ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:197: Unsupported: Ignoring delay on this delayed statement.\n always #5 clk = ~clk;\n        ^\n%Warning-STMTDLY: data/full_repos/permissive/43856783/I2C/controller_tst.v:198: Unsupported: Ignoring delay on this delayed statement.\n always #55 clk_frame = ~clk_frame;\n        ^\n%Error: data/full_repos/permissive/43856783/I2C/controller_tst.v:53: Cannot find file containing module: \'MPU_controller\'\n MPU_controller uut (\n ^~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/43856783/I2C,data/full_repos/permissive/43856783/MPU_controller\n             data/full_repos/permissive/43856783/I2C,data/full_repos/permissive/43856783/MPU_controller.v\n             data/full_repos/permissive/43856783/I2C,data/full_repos/permissive/43856783/MPU_controller.sv\n             MPU_controller\n             MPU_controller.v\n             MPU_controller.sv\n             obj_dir/MPU_controller\n             obj_dir/MPU_controller.v\n             obj_dir/MPU_controller.sv\n%Error: Exiting due to 1 error(s), 98 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module controller_tst;


	reg clk;
	reg clk_frame;
	reg rst;
	reg en;


	wire busy;
	wire [15:0] AcX;
	wire [15:0] AcY;
	wire [15:0] AcZ;
	wire [15:0] GyX;
	wire [15:0] GyY;
	wire [15:0] GyZ;
	wire error_i2c;
	wire SCL;


	wire SDA;
	
	reg SDA_out, SDA_oen;
	wire SDA_in;
	assign SDA = SDA_oen? 1'bz : SDA_out;
	assign SDA_in = SDA;


	MPU_controller uut (
		.clk(clk), 
		.clk_frame(clk_frame), 
		.rst(rst), 
		.en(en), 
		.busy(busy), 
		.AcX(AcX), 
		.AcY(AcY), 
		.AcZ(AcZ), 
		.GyX(GyX), 
		.GyY(GyY), 
		.GyZ(GyZ), 
		.error_i2c(error_i2c), 
		.SCL(SCL), 
		.SDA(SDA)
	);

	initial begin

		clk = 0;
		clk_frame = 0;
		rst = 1;
		en = 0;
		SDA_oen = 1;

		#100;
      rst = 0;

		#150 en = 1;
		#150 en = 0;
		#3600;
		SDA_oen = 0;
		SDA_out = 0;
		#335;
		SDA_oen = 1;
		#3665 SDA_oen 	= 0;
		#335 SDA_oen 	= 1;
		#3630 SDA_oen 	= 0;
		#335 SDA_oen 	= 1;
		
		#4505 SDA_oen 	= 0;
		#335 SDA_oen 	= 1;
		#3628 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4460 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3580 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4460 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4460 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4000 en = 1;
		#150 en  = 0;
		
		#3810 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4040 SDA_oen = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_oen = 1;
		#385 SDA_oen = 0;
		
			  SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#495 SDA_oen = 1;
		#413 SDA_oen = 0;
		
			  SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#495 SDA_oen = 1;
		#413 SDA_oen = 0;
		
			  SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#495 SDA_oen = 1;
		#370 SDA_oen = 0;
		
			  SDA_out = 1;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;

	end
	
	always #5 clk = ~clk;
	always #55 clk_frame = ~clk_frame;
endmodule
module controller_tst;



	reg clk;
	reg clk_frame;
	reg rst;
	reg en;


	wire busy;
	wire [15:0] AcX;
	wire [15:0] AcY;
	wire [15:0] AcZ;
	wire [15:0] GyX;
	wire [15:0] GyY;
	wire [15:0] GyZ;
	wire error_i2c;
	wire SCL;


	wire SDA;
	
	reg SDA_out, SDA_oen;
	wire SDA_in;
	assign SDA = SDA_oen? 1'bz : SDA_out;
	assign SDA_in = SDA;


	MPU_controller uut (
		.clk(clk), 
		.clk_frame(clk_frame), 
		.rst(rst), 
		.en(en), 
		.busy(busy), 
		.AcX(AcX), 
		.AcY(AcY), 
		.AcZ(AcZ), 
		.GyX(GyX), 
		.GyY(GyY), 
		.GyZ(GyZ), 
		.error_i2c(error_i2c), 
		.SCL(SCL), 
		.SDA(SDA)
	);

	initial begin

		clk = 0;
		clk_frame = 0;
		rst = 1;
		en = 0;
		SDA_oen = 1;

		#100;
      rst = 0;

		#150 en = 1;
		#150 en = 0;
		#3600;
		SDA_oen = 0;
		SDA_out = 0;
		#335;
		SDA_oen = 1;
		#3665 SDA_oen 	= 0;
		#335 SDA_oen 	= 1;
		#3630 SDA_oen 	= 0;
		#335 SDA_oen 	= 1;
		
		#4505 SDA_oen 	= 0;
		#335 SDA_oen 	= 1;
		#3628 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4460 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3580 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4460 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4460 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4000 en = 1;
		#150 en  = 0;
		
		#3810 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		#3570 SDA_oen 	= 0;
		#385 SDA_oen 	= 1;
		
		#4040 SDA_oen = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_oen = 1;
		#385 SDA_oen = 0;
		
			  SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#495 SDA_oen = 1;
		#413 SDA_oen = 0;
		
			  SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 1;
		#495 SDA_oen = 1;
		#413 SDA_oen = 0;
		
			  SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 1;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#440 SDA_out = 0;
		#495 SDA_oen = 1;
		#370 SDA_oen = 0;
		
			  SDA_out = 1;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;
		#425	SDA_oen = 0;
		#3535 SDA_oen = 1;

	end
	
	always #5 clk = ~clk;
	always #55 clk_frame = ~clk_frame;
endmodule