mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Renamed extend() to extend_xx(), changed most users to extend_u0()
This commit is contained in:
		
							parent
							
								
									48ca1ff9ef
								
							
						
					
					
						commit
						edb3c9d0c4
					
				
					 12 changed files with 33 additions and 34 deletions
				
			
		| 
						 | 
				
			
			@ -2590,9 +2590,9 @@ void RTLIL::SigSpec::append_bit(const RTLIL::SigBit &bit)
 | 
			
		|||
	check();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void RTLIL::SigSpec::extend(int width, bool is_signed)
 | 
			
		||||
void RTLIL::SigSpec::extend_xx(int width, bool is_signed)
 | 
			
		||||
{
 | 
			
		||||
	cover("kernel.rtlil.sigspec.extend");
 | 
			
		||||
	cover("kernel.rtlil.sigspec.extend_xx");
 | 
			
		||||
 | 
			
		||||
	pack();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -2600,10 +2600,9 @@ void RTLIL::SigSpec::extend(int width, bool is_signed)
 | 
			
		|||
		remove(width, width_ - width);
 | 
			
		||||
	
 | 
			
		||||
	if (width_ < width) {
 | 
			
		||||
		RTLIL::SigSpec padding = width_ > 0 ? extract(width_ - 1, 1) : RTLIL::SigSpec(RTLIL::State::S0);
 | 
			
		||||
		if (!is_signed && padding != RTLIL::SigSpec(RTLIL::State::Sx) && padding != RTLIL::SigSpec(RTLIL::State::Sz) &&
 | 
			
		||||
				padding != RTLIL::SigSpec(RTLIL::State::Sa) && padding != RTLIL::SigSpec(RTLIL::State::Sm))
 | 
			
		||||
			padding = RTLIL::SigSpec(RTLIL::State::S0);
 | 
			
		||||
		RTLIL::SigBit padding = width_ > 0 ? (*this)[width_ - 1] : RTLIL::State::S0;
 | 
			
		||||
		if (!is_signed && (padding == RTLIL::State::S1 || padding.wire))
 | 
			
		||||
			padding = RTLIL::State::S0;
 | 
			
		||||
		while (width_ < width)
 | 
			
		||||
			append(padding);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -2619,9 +2618,9 @@ void RTLIL::SigSpec::extend_u0(int width, bool is_signed)
 | 
			
		|||
		remove(width, width_ - width);
 | 
			
		||||
	
 | 
			
		||||
	if (width_ < width) {
 | 
			
		||||
		RTLIL::SigSpec padding = width_ > 0 ? extract(width_ - 1, 1) : RTLIL::SigSpec(RTLIL::State::S0);
 | 
			
		||||
		RTLIL::SigBit padding = width_ > 0 ? (*this)[width_ - 1] : RTLIL::State::S0;
 | 
			
		||||
		if (!is_signed)
 | 
			
		||||
			padding = RTLIL::SigSpec(RTLIL::State::S0);
 | 
			
		||||
			padding = RTLIL::State::S0;
 | 
			
		||||
		while (width_ < width)
 | 
			
		||||
			append(padding);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1057,7 +1057,7 @@ public:
 | 
			
		|||
	void append(const RTLIL::SigSpec &signal);
 | 
			
		||||
	void append_bit(const RTLIL::SigBit &bit);
 | 
			
		||||
 | 
			
		||||
	void extend(int width, bool is_signed = false);
 | 
			
		||||
	void extend_xx(int width, bool is_signed = false);
 | 
			
		||||
	void extend_u0(int width, bool is_signed = false);
 | 
			
		||||
 | 
			
		||||
	RTLIL::SigSpec repeat(int num) const;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue