mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Bugfix in $memrd sharing
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
		
							parent
							
								
									dbd51d7bda
								
							
						
					
					
						commit
						8a63fc51d3
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -710,8 +710,12 @@ struct ShareWorker | ||||||
| 			RTLIL::Cell *supercell = module->addCell(NEW_ID, c1); | 			RTLIL::Cell *supercell = module->addCell(NEW_ID, c1); | ||||||
| 			RTLIL::SigSpec addr1 = c1->getPort("\\ADDR"); | 			RTLIL::SigSpec addr1 = c1->getPort("\\ADDR"); | ||||||
| 			RTLIL::SigSpec addr2 = c2->getPort("\\ADDR"); | 			RTLIL::SigSpec addr2 = c2->getPort("\\ADDR"); | ||||||
| 			if (addr1 != addr2) | 			if (GetSize(addr1) < GetSize(addr2)) | ||||||
| 				supercell->setPort("\\ADDR", module->Mux(NEW_ID, addr2, addr1, act)); | 				addr1.extend_u0(GetSize(addr2)); | ||||||
|  | 			else | ||||||
|  | 				addr2.extend_u0(GetSize(addr1)); | ||||||
|  | 			supercell->setPort("\\ADDR", addr1 != addr2 ? module->Mux(NEW_ID, addr2, addr1, act) : addr1); | ||||||
|  | 			supercell->parameters["\\ABITS"] = RTLIL::Const(GetSize(addr1)); | ||||||
| 			supercell_aux.insert(module->addPos(NEW_ID, supercell->getPort("\\DATA"), c2->getPort("\\DATA"))); | 			supercell_aux.insert(module->addPos(NEW_ID, supercell->getPort("\\DATA"), c2->getPort("\\DATA"))); | ||||||
| 			supercell_aux.insert(supercell); | 			supercell_aux.insert(supercell); | ||||||
| 			return supercell; | 			return supercell; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue