mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Copy attributes to _TECHMAP_REPLACE_ cells
This commit is contained in:
		
							parent
							
								
									e6d56d23b5
								
							
						
					
					
						commit
						cf25dc9ce7
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -327,8 +327,9 @@ struct TechmapWorker
 | 
			
		|||
		for (auto &it : tpl->cells_)
 | 
			
		||||
		{
 | 
			
		||||
			std::string c_name = it.second->name.str();
 | 
			
		||||
			bool techmap_replace_cell = (!flatten_mode) && (c_name == "\\_TECHMAP_REPLACE_");
 | 
			
		||||
 | 
			
		||||
			if (!flatten_mode && c_name == "\\_TECHMAP_REPLACE_")
 | 
			
		||||
			if (techmap_replace_cell)
 | 
			
		||||
				c_name = orig_cell_name;
 | 
			
		||||
			else
 | 
			
		||||
				apply_prefix(cell->name.str(), c_name);
 | 
			
		||||
| 
						 | 
				
			
			@ -358,6 +359,11 @@ struct TechmapWorker
 | 
			
		|||
 | 
			
		||||
			if (c->attributes.count("\\src"))
 | 
			
		||||
				c->add_strpool_attribute("\\src", extra_src_attrs);
 | 
			
		||||
 | 
			
		||||
			if (techmap_replace_cell)
 | 
			
		||||
				for (auto attr : cell->attributes)
 | 
			
		||||
					if (!c->attributes.count(attr.first))
 | 
			
		||||
						c->attributes[attr.first] = attr.second;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		for (auto &it : tpl->connections()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1005,7 +1011,7 @@ struct TechmapPass : public Pass {
 | 
			
		|||
		log("constant value.\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("A cell with the name _TECHMAP_REPLACE_ in the map file will inherit the name\n");
 | 
			
		||||
		log("of the cell that is being replaced.\n");
 | 
			
		||||
		log("and attributes of the cell that is being replaced.\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("See 'help extract' for a pass that does the opposite thing.\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue