mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Improve handling of "full_case" attributes
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
		
							parent
							
								
									04e920337b
								
							
						
					
					
						commit
						17caaa3fa8
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
					@ -525,7 +525,16 @@ struct AST_INTERNAL::ProcessGenerator
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (last_generated_case != NULL && ast->get_bool_attribute("\\full_case") && default_case == NULL) {
 | 
									if (last_generated_case != NULL && ast->get_bool_attribute("\\full_case") && default_case == NULL) {
 | 
				
			||||||
 | 
								#if 0
 | 
				
			||||||
 | 
										// this is a valid transformation, but as optimization it is premature.
 | 
				
			||||||
 | 
										// better: add a default case that assigns 'x' to everything, and let later
 | 
				
			||||||
 | 
										// optimizations take care of the rest
 | 
				
			||||||
					last_generated_case->compare.clear();
 | 
										last_generated_case->compare.clear();
 | 
				
			||||||
 | 
								#else
 | 
				
			||||||
 | 
										default_case = new RTLIL::CaseRule;
 | 
				
			||||||
 | 
										addChunkActions(default_case->actions, this_case_eq_ltemp, SigSpec(State::Sx, GetSize(this_case_eq_rvalue)));
 | 
				
			||||||
 | 
										sw->cases.push_back(default_case);
 | 
				
			||||||
 | 
								#endif
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					if (default_case == NULL) {
 | 
										if (default_case == NULL) {
 | 
				
			||||||
						default_case = new RTLIL::CaseRule;
 | 
											default_case = new RTLIL::CaseRule;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue