mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	ice40_wrapcarry -unwrap to preserve 'src' attribute
This commit is contained in:
		
							parent
							
								
									eff858cd33
								
							
						
					
					
						commit
						36a88be609
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		|  | @ -121,16 +121,24 @@ struct Ice40WrapCarryPass : public Pass { | ||||||
| 					lut->setPort(ID(A), {cell->getPort(ID(I0)), cell->getPort(ID(A)), cell->getPort(ID(B)), cell->getPort(ID(I3)) }); | 					lut->setPort(ID(A), {cell->getPort(ID(I0)), cell->getPort(ID(A)), cell->getPort(ID(B)), cell->getPort(ID(I3)) }); | ||||||
| 					lut->setPort(ID(Y), cell->getPort(ID(O))); | 					lut->setPort(ID(Y), cell->getPort(ID(O))); | ||||||
| 
 | 
 | ||||||
|  | 					Const src; | ||||||
| 					for (const auto &a : cell->attributes) | 					for (const auto &a : cell->attributes) | ||||||
| 						if (a.first.begins_with("\\SB_CARRY.\\")) | 						if (a.first.begins_with("\\SB_CARRY.\\")) | ||||||
| 							carry->attributes[a.first.c_str() + strlen("\\SB_CARRY.")] = a.second; | 							carry->attributes[a.first.c_str() + strlen("\\SB_CARRY.")] = a.second; | ||||||
| 						else if (a.first.begins_with("\\SB_LUT4.\\")) | 						else if (a.first.begins_with("\\SB_LUT4.\\")) | ||||||
| 							lut->attributes[a.first.c_str() + strlen("\\SB_LUT4.")] = a.second; | 							lut->attributes[a.first.c_str() + strlen("\\SB_LUT4.")] = a.second; | ||||||
| 						else if (a.first.in(ID(SB_LUT4.name), ID::keep, ID(module_not_derived), ID(src))) | 						else if (a.first == ID(src)) | ||||||
|  | 							src = a.second; | ||||||
|  | 						else if (a.first.in(ID(SB_LUT4.name), ID::keep, ID(module_not_derived))) | ||||||
| 							continue; | 							continue; | ||||||
| 						else | 						else | ||||||
| 							log_abort(); | 							log_abort(); | ||||||
| 
 | 
 | ||||||
|  | 					if (!src.empty()) { | ||||||
|  | 						carry->attributes.insert(std::make_pair(ID(src), src)); | ||||||
|  | 						lut->attributes.insert(std::make_pair(ID(src), src)); | ||||||
|  | 					} | ||||||
|  | 
 | ||||||
| 					module->remove(cell); | 					module->remove(cell); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue