mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	setundef: Add test for -blackbox
This commit is contained in:
		
							parent
							
								
									15b142371c
								
							
						
					
					
						commit
						1d374fdd48
					
				
					 1 changed files with 32 additions and 0 deletions
				
			
		
							
								
								
									
										32
									
								
								tests/various/setundef_blackbox.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								tests/various/setundef_blackbox.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
read_verilog -specify << EOT
 | 
			
		||||
module top(input a, b, output o);
 | 
			
		||||
    wire c, d;
 | 
			
		||||
    bb bb1 (.a (a), .b (b), .o (c));
 | 
			
		||||
    wb wb1 (.a (a), .b (b), .o (d));
 | 
			
		||||
    some_mod some_inst (.a (c), .b (d), .o (o));
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
(* blackbox *)
 | 
			
		||||
module bb(input a, b, output o);
 | 
			
		||||
assign o = a | b;
 | 
			
		||||
specify
 | 
			
		||||
	(a => o) = 1;
 | 
			
		||||
endspecify
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
(* whitebox *)
 | 
			
		||||
module wb(input a, b, output o);
 | 
			
		||||
assign o = a ^ b;
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module some_mod(input a, b, output o);
 | 
			
		||||
assign o = a & b;
 | 
			
		||||
endmodule
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
select top
 | 
			
		||||
 | 
			
		||||
select -assert-count 2 =t:?b
 | 
			
		||||
setundef -blackbox -anyseq
 | 
			
		||||
select -assert-count 2 t:$anyseq
 | 
			
		||||
select -assert-count 0 =t:?b
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue