mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Added examples/smtbmc
This commit is contained in:
		
							parent
							
								
									2afc72cae3
								
							
						
					
					
						commit
						b3155af5f6
					
				
					 2 changed files with 30 additions and 0 deletions
				
			
		
							
								
								
									
										13
									
								
								examples/smtbmc/Makefile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								examples/smtbmc/Makefile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
 | 
			
		||||
demo1: demo1.smt2
 | 
			
		||||
	yosys-smtbmc -c demo1.vcd demo1.smt2
 | 
			
		||||
	yosys-smtbmc -i -c demo1.vcd demo1.smt2
 | 
			
		||||
 | 
			
		||||
demo1.smt2: demo1.v
 | 
			
		||||
	yosys -p 'read_verilog -formal demo1.v; prep -top demo1; write_smt2 -wires -mem -bv demo1.smt2'
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f demo1.smt2
 | 
			
		||||
 | 
			
		||||
.PHONY: demo1 clean
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										17
									
								
								examples/smtbmc/demo1.v
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								examples/smtbmc/demo1.v
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
module demo1(input clk, input addtwo, output iseven);
 | 
			
		||||
	reg [3:0] cnt = 0;
 | 
			
		||||
	wire [3:0] next_cnt;
 | 
			
		||||
 | 
			
		||||
	inc inc_inst (addtwo, iseven, cnt, next_cnt);
 | 
			
		||||
 | 
			
		||||
	always @(posedge clk)
 | 
			
		||||
		cnt = (iseven ? cnt == 10 : cnt == 11) ? 0 : next_cnt;
 | 
			
		||||
	
 | 
			
		||||
	assert property (cnt != 15);
 | 
			
		||||
	// initial expect ((iseven && addtwo) || cnt == 9);
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module inc(input addtwo, output iseven, input [3:0] a, output [3:0] y);
 | 
			
		||||
	assign iseven = !a[0];
 | 
			
		||||
	assign y = a + (addtwo ? 2 : 1);
 | 
			
		||||
endmodule
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue