mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	opt_muxtree: Update port_off and port_idx even for constant bits
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
		
							parent
							
								
									1667ad658b
								
							
						
					
					
						commit
						6a6d049f1c
					
				
					 1 changed files with 18 additions and 19 deletions
				
			
		|  | @ -372,8 +372,7 @@ struct OptMuxtreeWorker | |||
| 		int port_idx = 0, port_off = 0; | ||||
| 		vector<int> bits = sig2bits(sig, false); | ||||
| 		for (int i = 0; i < GetSize(bits); i++) { | ||||
| 			if (bits[i] < 0) | ||||
| 				continue; | ||||
| 			if (bits[i] >= 0) { | ||||
| 				if (knowledge.known_inactive.at(bits[i])) { | ||||
| 					sig[i] = State::S0; | ||||
| 					did_something = true; | ||||
|  | @ -382,18 +381,18 @@ struct OptMuxtreeWorker | |||
| 					sig[i] = State::S1; | ||||
| 					did_something = true; | ||||
| 				} | ||||
| 			if (width) { | ||||
| 				if (ctrl_bits.count(bits[i])) { | ||||
| 					if (width) { | ||||
| 						sig[i] = ctrl_bits.at(bits[i]) == port_idx ? State::S1 : State::S0; | ||||
| 					} else { | ||||
| 						sig[i] = State::S0; | ||||
| 					} | ||||
| 					did_something = true; | ||||
| 				} | ||||
| 			} | ||||
| 			if (width) { | ||||
| 				if (++port_off == width) | ||||
| 					port_idx++, port_off=0; | ||||
| 			} else { | ||||
| 				if (ctrl_bits.count(bits[i])) { | ||||
| 					sig[i] = State::S0; | ||||
| 					did_something = true; | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue