mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	dffinit: Avoid setting init parameter to zero-length value.
Fixes #1704.
This commit is contained in:
		
							parent
							
								
									3a27906ac6
								
							
						
					
					
						commit
						7a36728b2f
					
				
					 2 changed files with 30 additions and 3 deletions
				
			
		
							
								
								
									
										25
									
								
								tests/techmap/dffinit.ys
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								tests/techmap/dffinit.ys
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,25 @@
 | 
			
		|||
read_verilog <<EOT
 | 
			
		||||
 | 
			
		||||
module ff(...);
 | 
			
		||||
input d;
 | 
			
		||||
output q;
 | 
			
		||||
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
module top(...);
 | 
			
		||||
input d;
 | 
			
		||||
output q1;
 | 
			
		||||
(* init = 1'b1 *)
 | 
			
		||||
output q2;
 | 
			
		||||
 | 
			
		||||
ff my_ff1(.d(d), .q(q1));
 | 
			
		||||
ff my_ff2(.d(d), .q(q2));
 | 
			
		||||
 | 
			
		||||
endmodule
 | 
			
		||||
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
dffinit -ff ff q init
 | 
			
		||||
select -assert-count 2 t:ff
 | 
			
		||||
select -assert-count 1 t:ff r:init %i
 | 
			
		||||
select -assert-count 1 t:ff r:init=1'b1 %i
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue