mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	Add flatten handling of pre-existing wires as created by interfaces, fixes #1145
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
		
							parent
							
								
									8d91960663
								
							
						
					
					
						commit
						694a8f75cf
					
				
					 1 changed files with 20 additions and 8 deletions
				
			
		|  | @ -211,7 +211,18 @@ struct TechmapWorker | |||
| 				positional_ports[stringf("$%d", it.second->port_id)] = it.first; | ||||
| 			IdString w_name = it.second->name; | ||||
| 			apply_prefix(cell->name, w_name); | ||||
| 			RTLIL::Wire *w = module->addWire(w_name, it.second); | ||||
| 			RTLIL::Wire *w = module->wire(w_name); | ||||
| 			if (w != nullptr) { | ||||
| 				if (!flatten_mode) | ||||
| 					log_error("Signal %s.%s conflicts with %s.%s (via %s.%s).\n", log_id(module), log_id(w), | ||||
| 							log_id(tpl), log_id(it.second), log_id(module), log_id(cell)); | ||||
| 				if (GetSize(w) < GetSize(it.second)) { | ||||
| 					log_warning("Widening signal %s.%s to match size of %s.%s (via %s.%s).\n", log_id(module), log_id(w), | ||||
| 							log_id(tpl), log_id(it.second), log_id(module), log_id(cell)); | ||||
| 					w->width = GetSize(it.second); | ||||
| 				} | ||||
| 			} else { | ||||
| 				w = module->addWire(w_name, it.second); | ||||
| 				w->port_input = false; | ||||
| 				w->port_output = false; | ||||
| 				w->port_id = 0; | ||||
|  | @ -219,6 +230,7 @@ struct TechmapWorker | |||
| 					w->attributes.clear(); | ||||
| 				if (w->attributes.count(ID(src))) | ||||
| 					w->add_strpool_attribute(ID(src), extra_src_attrs); | ||||
| 			} | ||||
| 			design->select(module, w); | ||||
| 		} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue