mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	abstract: test -init
This commit is contained in:
		
							parent
							
								
									925c617c52
								
							
						
					
					
						commit
						5bd18613bb
					
				
					 1 changed files with 39 additions and 0 deletions
				
			
		
							
								
								
									
										39
									
								
								tests/various/abstract_init.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								tests/various/abstract_init.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,39 @@
 | 
			
		|||
design -reset
 | 
			
		||||
read_verilog <<EOT
 | 
			
		||||
module foo (CLK, Q, QQQ);
 | 
			
		||||
	input CLK;
 | 
			
		||||
	output reg QQQ;
 | 
			
		||||
	output reg Q = 1'b1;
 | 
			
		||||
	assign QQQ = Q;
 | 
			
		||||
	always @(posedge CLK)
 | 
			
		||||
		Q <= ~Q;
 | 
			
		||||
endmodule
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
proc
 | 
			
		||||
opt_expr
 | 
			
		||||
opt_dff
 | 
			
		||||
select -assert-count 1 w:Q a:init %i
 | 
			
		||||
abstract -init w:QQQ
 | 
			
		||||
check -assert
 | 
			
		||||
select -assert-count 0 w:Q a:init %i
 | 
			
		||||
 | 
			
		||||
design -reset
 | 
			
		||||
read_verilog <<EOT
 | 
			
		||||
module foo (CLK, Q, QQQ);
 | 
			
		||||
	input CLK;
 | 
			
		||||
	output reg QQQ;
 | 
			
		||||
	output reg [1:0] Q = 1'b1;
 | 
			
		||||
	assign QQQ = Q;
 | 
			
		||||
	always @(posedge CLK)
 | 
			
		||||
		Q <= ~Q;
 | 
			
		||||
endmodule
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
proc
 | 
			
		||||
opt_expr
 | 
			
		||||
opt_dff
 | 
			
		||||
select -assert-count 1 w:Q a:init=2'b01 %i
 | 
			
		||||
abstract -init w:QQQ
 | 
			
		||||
check -assert
 | 
			
		||||
select -assert-count 1 w:Q a:init=2'b0x %i
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue