mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Added smtbmc longopt support
This commit is contained in:
		
							parent
							
								
									fe9315b7a1
								
							
						
					
					
						commit
						a889acb897
					
				
					 3 changed files with 17 additions and 16 deletions
				
			
		|  | @ -42,24 +42,24 @@ yosys-smtbmc [options] <yosys_smt2_output> | ||||||
|         assume asserts in skipped steps in BMC |         assume asserts in skipped steps in BMC | ||||||
| 
 | 
 | ||||||
|     -S <step_size> |     -S <step_size> | ||||||
|         proof <step_size> time steps at once |         prove <step_size> time steps at once | ||||||
| 
 |  | ||||||
|     -c <vcd_filename> |  | ||||||
|         write counter-example to this VCD file |  | ||||||
|         (hint: use 'write_smt2 -wires' for maximum |  | ||||||
|         coverage of signals in generated VCD file) |  | ||||||
| 
 | 
 | ||||||
|     -i |     -i | ||||||
|         instead of BMC run temporal induction |         instead of BMC run temporal induction | ||||||
| 
 | 
 | ||||||
|     -m <module_name> |     -m <module_name> | ||||||
|         name of the top module |         name of the top module | ||||||
|  | 
 | ||||||
|  |     --dump-vcd <vcd_filename> | ||||||
|  |         write counter-example to this VCD file | ||||||
|  |         (hint: use 'write_smt2 -wires' for maximum | ||||||
|  |         coverage of signals in generated VCD file) | ||||||
| """ + so.helpmsg()) | """ + so.helpmsg()) | ||||||
|     sys.exit(1) |     sys.exit(1) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| try: | try: | ||||||
|     opts, args = getopt.getopt(sys.argv[1:], so.optstr + "t:u:S:c:im:") |     opts, args = getopt.getopt(sys.argv[1:], so.shortopts + "t:u:S:im:", so.longopts + ["dump-vcd="]) | ||||||
| except: | except: | ||||||
|     usage() |     usage() | ||||||
| 
 | 
 | ||||||
|  | @ -75,7 +75,7 @@ for o, a in opts: | ||||||
|         assume_skipped = int(a) |         assume_skipped = int(a) | ||||||
|     elif o == "-S": |     elif o == "-S": | ||||||
|         step_size = int(a) |         step_size = int(a) | ||||||
|     elif o == "-c": |     elif o == "--dump-vcd": | ||||||
|         vcdfile = a |         vcdfile = a | ||||||
|     elif o == "-i": |     elif o == "-i": | ||||||
|         tempind = True |         tempind = True | ||||||
|  |  | ||||||
|  | @ -348,7 +348,8 @@ class smtio: | ||||||
| 
 | 
 | ||||||
| class smtopts: | class smtopts: | ||||||
|     def __init__(self): |     def __init__(self): | ||||||
|         self.optstr = "s:d:vp" |         self.shortopts = "s:v" | ||||||
|  |         self.longopts = ["no-progress", "dump-smt2="] | ||||||
|         self.solver = "z3" |         self.solver = "z3" | ||||||
|         self.debug_print = False |         self.debug_print = False | ||||||
|         self.debug_file = None |         self.debug_file = None | ||||||
|  | @ -359,9 +360,9 @@ class smtopts: | ||||||
|             self.solver = a |             self.solver = a | ||||||
|         elif o == "-v": |         elif o == "-v": | ||||||
|             self.debug_print = True |             self.debug_print = True | ||||||
|         elif o == "-p": |         elif o == "--no-progress": | ||||||
|             self.timeinfo = True |             self.timeinfo = True | ||||||
|         elif o == "-d": |         elif o == "--dump-smt2": | ||||||
|             self.debug_file = open(a, "w") |             self.debug_file = open(a, "w") | ||||||
|         else: |         else: | ||||||
|             return False |             return False | ||||||
|  | @ -376,10 +377,10 @@ class smtopts: | ||||||
|     -v |     -v | ||||||
|         enable debug output |         enable debug output | ||||||
| 
 | 
 | ||||||
|     -p |     --no-progress | ||||||
|         disable timer display during solving |         disable running timer display during solving | ||||||
| 
 | 
 | ||||||
|     -d <filename> |     --dump-smt2 <filename> | ||||||
|         write smt2 statements to file |         write smt2 statements to file | ||||||
| """ | """ | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| 
 | 
 | ||||||
| demo1: demo1.smt2 | demo1: demo1.smt2 | ||||||
| 	yosys-smtbmc -c demo1.vcd demo1.smt2 | 	yosys-smtbmc --dump-vcd demo1.vcd demo1.smt2 | ||||||
| 	yosys-smtbmc -i -c demo1.vcd demo1.smt2 | 	yosys-smtbmc -i --dump-vcd demo1.vcd demo1.smt2 | ||||||
| 
 | 
 | ||||||
| demo1.smt2: demo1.v | demo1.smt2: demo1.v | ||||||
| 	yosys -p 'read_verilog -formal demo1.v; prep -top demo1; write_smt2 -wires -mem -bv demo1.smt2' | 	yosys -p 'read_verilog -formal demo1.v; prep -top demo1; write_smt2 -wires -mem -bv demo1.smt2' | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue