mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	shregmap -tech xilinx to delete $shiftx for var length SRL
This commit is contained in:
		
							parent
							
								
									f239cb821e
								
							
						
					
					
						commit
						4cd8f02973
					
				
					 1 changed files with 3 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -187,19 +187,12 @@ struct ShregmapTechXilinx7 : ShregmapTech
 | 
			
		|||
		if (it == sigbit_to_shiftx_offset.end())
 | 
			
		||||
			return true;
 | 
			
		||||
 | 
			
		||||
		auto cell_q = cell->getPort("\\Q");
 | 
			
		||||
		log_assert(cell_q.is_bit());
 | 
			
		||||
 | 
			
		||||
		Cell* shiftx = it->second.first;
 | 
			
		||||
		// FIXME: Hack to ensure that $shiftx gets optimised away
 | 
			
		||||
		//   Without this, Yosys will refuse to optimise away a $shiftx
 | 
			
		||||
		//   where \\A 's width is not perfectly \\B_WIDTH ** 2
 | 
			
		||||
		// See YosysHQ/yosys#878
 | 
			
		||||
		auto shiftx_bwidth = shiftx->getParam("\\B_WIDTH").as_int();
 | 
			
		||||
		shiftx->setPort("\\A", cell_q.repeat(1 << shiftx_bwidth));
 | 
			
		||||
		shiftx->setParam("\\A_WIDTH", 1 << shiftx_bwidth);
 | 
			
		||||
 | 
			
		||||
		cell->setPort("\\L", shiftx->getPort("\\B"));
 | 
			
		||||
		cell->setPort("\\Q", shiftx->getPort("\\Y"));
 | 
			
		||||
 | 
			
		||||
		cell->module->remove(shiftx);
 | 
			
		||||
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue