mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Fix shregmap to correctly recognise non chain users; cleanup
This commit is contained in:
		
							parent
							
								
									b94db54664
								
							
						
					
					
						commit
						ed32119d13
					
				
					 1 changed files with 15 additions and 17 deletions
				
			
		| 
						 | 
				
			
			@ -120,7 +120,7 @@ struct ShregmapTechXilinx7 : ShregmapTech
 | 
			
		|||
			return;
 | 
			
		||||
		if (cell->type == "$shiftx" && port == "\\A")
 | 
			
		||||
			return;
 | 
			
		||||
		it->second = std::make_pair(nullptr, 0);
 | 
			
		||||
		sigbit_to_shiftx_offset.erase(it);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	virtual bool analyze(vector<int> &taps, const vector<SigBit> &qbits) override
 | 
			
		||||
| 
						 | 
				
			
			@ -140,11 +140,11 @@ struct ShregmapTechXilinx7 : ShregmapTech
 | 
			
		|||
			// or sequential to the same shift register
 | 
			
		||||
			auto it = sigbit_to_shiftx_offset.find(qbits[i]);
 | 
			
		||||
			if (i == 0) {
 | 
			
		||||
				if (it != sigbit_to_shiftx_offset.end()) {
 | 
			
		||||
					shiftx = it->second.first;
 | 
			
		||||
					// NULL indicates there are non-shiftx users
 | 
			
		||||
					if (shiftx == nullptr)
 | 
			
		||||
				if (it == sigbit_to_shiftx_offset.end()) {
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				else {
 | 
			
		||||
					shiftx = it->second.first;
 | 
			
		||||
					int offset = it->second.second;
 | 
			
		||||
					if (offset != i)
 | 
			
		||||
						return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -152,7 +152,6 @@ struct ShregmapTechXilinx7 : ShregmapTech
 | 
			
		|||
			}
 | 
			
		||||
			else {
 | 
			
		||||
				if (it == sigbit_to_shiftx_offset.end()) {
 | 
			
		||||
					if (shiftx != nullptr)
 | 
			
		||||
					return false;
 | 
			
		||||
				}
 | 
			
		||||
				else {
 | 
			
		||||
| 
						 | 
				
			
			@ -164,8 +163,8 @@ struct ShregmapTechXilinx7 : ShregmapTech
 | 
			
		|||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		log_assert(shiftx);
 | 
			
		||||
 | 
			
		||||
		if (shiftx) {
 | 
			
		||||
		// Cannot implement variable-length shift registers
 | 
			
		||||
		// greater than 128 since Q31 cannot be output onto
 | 
			
		||||
		// fabric
 | 
			
		||||
| 
						 | 
				
			
			@ -175,7 +174,6 @@ struct ShregmapTechXilinx7 : ShregmapTech
 | 
			
		|||
		// Only map if $shiftx exclusively covers the shift register
 | 
			
		||||
		if (GetSize(taps) != shiftx->getParam("\\A_WIDTH").as_int())
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue