mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Add SigSpec::is_fully_ones()
This commit is contained in:
		
							parent
							
								
									82d1fd77de
								
							
						
					
					
						commit
						2b6307547f
					
				
					 2 changed files with 16 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -3353,6 +3353,21 @@ bool RTLIL::SigSpec::is_fully_zero() const
 | 
			
		|||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool RTLIL::SigSpec::is_fully_ones() const
 | 
			
		||||
{
 | 
			
		||||
	cover("kernel.rtlil.sigspec.is_fully_ones");
 | 
			
		||||
 | 
			
		||||
	pack();
 | 
			
		||||
	for (auto it = chunks_.begin(); it != chunks_.end(); it++) {
 | 
			
		||||
		if (it->width > 0 && it->wire != NULL)
 | 
			
		||||
			return false;
 | 
			
		||||
		for (size_t i = 0; i < it->data.size(); i++)
 | 
			
		||||
			if (it->data[i] != RTLIL::State::S1)
 | 
			
		||||
				return false;
 | 
			
		||||
	}
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool RTLIL::SigSpec::is_fully_def() const
 | 
			
		||||
{
 | 
			
		||||
	cover("kernel.rtlil.sigspec.is_fully_def");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -704,6 +704,7 @@ public:
 | 
			
		|||
 | 
			
		||||
	bool is_fully_const() const;
 | 
			
		||||
	bool is_fully_zero() const;
 | 
			
		||||
	bool is_fully_ones() const;
 | 
			
		||||
	bool is_fully_def() const;
 | 
			
		||||
	bool is_fully_undef() const;
 | 
			
		||||
	bool has_const() const;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue