mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	fix assignment of non-wires
This commit is contained in:
		
							parent
							
								
									c2caf85f7c
								
							
						
					
					
						commit
						85de9d26c1
					
				
					 1 changed files with 19 additions and 16 deletions
				
			
		|  | @ -1500,8 +1500,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint) | ||||||
| 			for (int i = 0; i < GetSize(left); i++) | 			for (int i = 0; i < GetSize(left); i++) | ||||||
| 				if (left[i].wire) { | 				if (left[i].wire) { | ||||||
| 					std::map<RTLIL::SigSpec, RTLIL::Cell*>::iterator iter = wire_logic_map.find(left[i].wire); | 					std::map<RTLIL::SigSpec, RTLIL::Cell*>::iterator iter = wire_logic_map.find(left[i].wire); | ||||||
| 					if (iter == wire_logic_map.end()) | 					if (iter == wire_logic_map.end()) { | ||||||
| 					{ |  | ||||||
| 						new_left.append(left[i]); | 						new_left.append(left[i]); | ||||||
| 					} else { | 					} else { | ||||||
| 						RTLIL::Cell *reduce_cell = iter->second; | 						RTLIL::Cell *reduce_cell = iter->second; | ||||||
|  | @ -1578,21 +1577,25 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint) | ||||||
| 					if (child->children.size() > 0) { | 					if (child->children.size() > 0) { | ||||||
| 						sig = child->children[0]->genRTLIL(); | 						sig = child->children[0]->genRTLIL(); | ||||||
| 						for (int i = 0; i < GetSize(sig); i++) { | 						for (int i = 0; i < GetSize(sig); i++) { | ||||||
| 							std::map<RTLIL::SigSpec, RTLIL::Cell*>::iterator iter = wire_logic_map.find(sig[i].wire); | 							if (sig[i].wire) { | ||||||
| 							if (iter == wire_logic_map.end()) { | 								std::map<RTLIL::SigSpec, RTLIL::Cell*>::iterator iter = wire_logic_map.find(sig[i].wire); | ||||||
| 								new_sig.append(sig[i]); | 								if (iter == wire_logic_map.end()) { | ||||||
| 							} else { | 									new_sig.append(sig[i]); | ||||||
| 								RTLIL::Cell *reduce_cell = iter->second; | 								} else { | ||||||
| 								RTLIL::SigSpec reduce_cell_in = reduce_cell->getPort("\\A"); | 									RTLIL::Cell *reduce_cell = iter->second; | ||||||
| 								int reduce_width = reduce_cell->getParam("\\A_WIDTH").as_int(); | 									RTLIL::SigSpec reduce_cell_in = reduce_cell->getPort("\\A"); | ||||||
|  | 									int reduce_width = reduce_cell->getParam("\\A_WIDTH").as_int(); | ||||||
| 
 | 
 | ||||||
| 								RTLIL::Wire *new_reduce_input = current_module->addWire( | 									RTLIL::Wire *new_reduce_input = current_module->addWire( | ||||||
| 										stringf("%s_in%d", reduce_cell->name.c_str(), reduce_width)); | 											stringf("%s_in%d", reduce_cell->name.c_str(), reduce_width)); | ||||||
| 								new_reduce_input->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum); | 									new_reduce_input->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum); | ||||||
| 								reduce_cell_in.append(new_reduce_input); | 									reduce_cell_in.append(new_reduce_input); | ||||||
| 								reduce_cell->setPort("\\A", reduce_cell_in); | 									reduce_cell->setPort("\\A", reduce_cell_in); | ||||||
| 								reduce_cell->fixup_parameters(); | 									reduce_cell->fixup_parameters(); | ||||||
| 								new_sig.append(new_reduce_input); | 									new_sig.append(new_reduce_input); | ||||||
|  | 								} | ||||||
|  | 							} else { | ||||||
|  | 								new_sig.append(sig[i]); | ||||||
| 							} | 							} | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue