mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	dfflegalize: Fix decision tree for adffe.
When an adffe is being legalized, and is not natively supported, prioritize unmapping to adff over converting to dffsre if dffsre is not natively supported itself. Fixes #2361.
This commit is contained in:
		
							parent
							
								
									925c0f2594
								
							
						
					
					
						commit
						880df4c897
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -418,7 +418,8 @@ unmap_enable: | ||||||
| 					ff_type = has_set ? FF_ADFFE1 : FF_ADFFE0; | 					ff_type = has_set ? FF_ADFFE1 : FF_ADFFE0; | ||||||
| 					break; | 					break; | ||||||
| 				} | 				} | ||||||
| 				if (supported_dffsr & initmask) { | 				if (supported_cells[has_en ? FF_DFFSRE : FF_DFFSR] & initmask) { | ||||||
|  | adff_to_dffsr: | ||||||
| 					// Throw in a set/reset, retry in DFFSR/DFFSRE branch.
 | 					// Throw in a set/reset, retry in DFFSR/DFFSRE branch.
 | ||||||
| 					if (has_set) { | 					if (has_set) { | ||||||
| 						sig_s = sig_r; | 						sig_s = sig_r; | ||||||
|  | @ -441,6 +442,9 @@ unmap_enable: | ||||||
| 					ff_type = has_set ? FF_ADFF1 : FF_ADFF0; | 					ff_type = has_set ? FF_ADFF1 : FF_ADFF0; | ||||||
| 					goto unmap_enable; | 					goto unmap_enable; | ||||||
| 				} | 				} | ||||||
|  | 				if (supported_dffsr & initmask) { | ||||||
|  | 					goto adff_to_dffsr; | ||||||
|  | 				} | ||||||
| 				log_assert(!((has_set ? supported_adff1 : supported_adff0) & initmask)); | 				log_assert(!((has_set ? supported_adff1 : supported_adff0) & initmask)); | ||||||
| 				// Alright, so this particular combination of initval and
 | 				// Alright, so this particular combination of initval and
 | ||||||
| 				// resetval is not natively supported.  First, try flipping
 | 				// resetval is not natively supported.  First, try flipping
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue