mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Better preserve wires when flattening (in comparison to techmap)
This commit is contained in:
		
							parent
							
								
									37cbb1ca60
								
							
						
					
					
						commit
						ca53ef5098
					
				
					 1 changed files with 12 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -151,18 +151,18 @@ struct TechmapWorker
 | 
			
		|||
			if (c.second.width < c.first.width)
 | 
			
		||||
				c.second.append(RTLIL::SigSpec(RTLIL::State::S0, c.first.width - c.second.width));
 | 
			
		||||
			assert(c.first.width == c.second.width);
 | 
			
		||||
#if 0
 | 
			
		||||
			// more conservative approach:
 | 
			
		||||
			// connect internal and external wires
 | 
			
		||||
			module->connections.push_back(c);
 | 
			
		||||
#else
 | 
			
		||||
			// approach that yields nicer outputs:
 | 
			
		||||
			// replace internal wires that are connected to external wires
 | 
			
		||||
			if (w->port_output)
 | 
			
		||||
				port_signal_map.add(c.second, c.first);
 | 
			
		||||
			else
 | 
			
		||||
				port_signal_map.add(c.first, c.second);
 | 
			
		||||
#endif
 | 
			
		||||
			if (flatten_mode) {
 | 
			
		||||
				// more conservative approach:
 | 
			
		||||
				// connect internal and external wires
 | 
			
		||||
				module->connections.push_back(c);
 | 
			
		||||
			} else {
 | 
			
		||||
				// approach that yields nicer outputs:
 | 
			
		||||
				// replace internal wires that are connected to external wires
 | 
			
		||||
				if (w->port_output)
 | 
			
		||||
					port_signal_map.add(c.second, c.first);
 | 
			
		||||
				else
 | 
			
		||||
					port_signal_map.add(c.first, c.second);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		for (auto &it : tpl->cells) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue