mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	abc9: preserve $_DFF_?_.Q's (* init *); rely on clean to remove it
This commit is contained in:
		
							parent
							
								
									fa31e84112
								
							
						
					
					
						commit
						13f9d65b6f
					
				
					 4 changed files with 13 additions and 25 deletions
				
			
		| 
						 | 
				
			
			@ -78,18 +78,23 @@ abc9
 | 
			
		|||
 | 
			
		||||
design -reset
 | 
			
		||||
read_verilog -icells <<EOT
 | 
			
		||||
module abc9_test038(input clk, output w, x, y);
 | 
			
		||||
module abc9_test038(input clk, output w, x, y, z);
 | 
			
		||||
(* init=1'b1 *) wire w;
 | 
			
		||||
$_DFF_N_ ff1(.C(clk), .D(1'b1), .Q(w));
 | 
			
		||||
(* init=1'bx *) wire x;
 | 
			
		||||
$_DFF_N_ ff2(.C(clk), .D(1'b0), .Q(x));
 | 
			
		||||
(* init=1'b0 *) wire y;
 | 
			
		||||
$_DFF_N_ ff3(.C(clk), .D(1'b0), .Q(y));
 | 
			
		||||
(* init=1'b0 *) wire z;
 | 
			
		||||
$_DFF_N_ ff4(.C(clk), .D(1'b1), .Q(z));
 | 
			
		||||
endmodule
 | 
			
		||||
EOT
 | 
			
		||||
simplemap
 | 
			
		||||
equiv_opt abc9 -lut 4 -dff
 | 
			
		||||
design -load postopt
 | 
			
		||||
cd abc9_test038
 | 
			
		||||
select -assert-count 2 t:$_DFF_N_
 | 
			
		||||
select -assert-none c:ff1 c:ff2 %% c:* %D
 | 
			
		||||
select -assert-count 3 t:$_DFF_N_
 | 
			
		||||
select -assert-none c:ff1 c:ff2 c:ff4 %% c:* %D
 | 
			
		||||
clean
 | 
			
		||||
select -assert-count 2 a:init
 | 
			
		||||
select -assert-none w:w w:z %% a:init %D
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue