mirror of
				https://github.com/YosysHQ/sby.git
				synced 2025-10-31 13:02:28 +00:00 
			
		
		
		
	Fix CEX handle in liveness checking mode
This commit is contained in:
		
							parent
							
								
									7fdbb4c179
								
							
						
					
					
						commit
						2b8533cf17
					
				
					 1 changed files with 23 additions and 8 deletions
				
			
		|  | @ -46,16 +46,21 @@ def run(mode, job, engine_idx, engine): | |||
| 
 | ||||
|     task_status = None | ||||
|     produced_cex = False | ||||
|     end_of_cex = False | ||||
|     aiw_file = open("%s/engine_%d/trace.aiw" % (job.workdir, engine_idx), "w") | ||||
| 
 | ||||
|     def output_callback(line): | ||||
|         nonlocal task_status | ||||
|         nonlocal produced_cex | ||||
|         nonlocal end_of_cex | ||||
| 
 | ||||
|         if task_status is not None: | ||||
|             if not produced_cex and line.isdigit(): | ||||
|             if not end_of_cex and not produced_cex and line.isdigit(): | ||||
|                 produced_cex = True | ||||
|             if not end_of_cex: | ||||
|                 print(line, file=aiw_file) | ||||
|             if line == ".": | ||||
|                 end_of_cex = True | ||||
|             return None | ||||
| 
 | ||||
|         if line.startswith("u"): | ||||
|  | @ -84,6 +89,13 @@ def run(mode, job, engine_idx, engine): | |||
| 
 | ||||
|         if task_status == "FAIL": | ||||
|             if produced_cex: | ||||
|                 if mode == "live": | ||||
|                     task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"), | ||||
|                             ("cd %s; %s -g -s %s --noprogress --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " + | ||||
|                              "--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw model/design_smt2.smt2") % | ||||
|                                     (job.workdir, job.exe_paths["smtbmc"], job.opt_aigsmt, engine_idx, engine_idx, engine_idx, engine_idx), | ||||
|                             logfile=open("%s/engine_%d/logfile2.txt" % (job.workdir, engine_idx), "w")) | ||||
|                 else: | ||||
|                     task2 = SbyTask(job, "engine_%d" % engine_idx, job.model("smt2"), | ||||
|                             ("cd %s; %s -s %s --noprogress --append %d --dump-vcd engine_%d/trace.vcd --dump-vlogtb engine_%d/trace_tb.v " + | ||||
|                              "--dump-smtc engine_%d/trace.smtc --aig model/design_aiger.aim:engine_%d/trace.aiw model/design_smt2.smt2") % | ||||
|  | @ -105,6 +117,9 @@ def run(mode, job, engine_idx, engine): | |||
| 
 | ||||
|                 def exit_callback2(line): | ||||
|                     assert task2_status is not None | ||||
|                     if mode == "live": | ||||
|                         assert task2_status == "PASS" | ||||
|                     else: | ||||
|                         assert task2_status == "FAIL" | ||||
| 
 | ||||
|                     job.summary.append("counterexample trace: %s/engine_%d/trace.vcd" % (job.workdir, engine_idx)) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue