mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	write_xaiger to not use module POs but only write outputs if driven
This commit is contained in:
		
							parent
							
								
									c4ec42ac38
								
							
						
					
					
						commit
						0ab1e496dc
					
				
					 1 changed files with 22 additions and 10 deletions
				
			
		|  | @ -542,18 +542,30 @@ struct XAigerWriter | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		for (auto bit : unused_bits) | 		for (auto bit : unused_bits) | ||||||
| 			undriven_bits.erase(bit); | 			if (holes_mode) | ||||||
|  | 				undriven_bits.erase(bit); | ||||||
|  | 			else if (!undriven_bits.count(bit)) | ||||||
|  | 				output_bits.insert(bit); | ||||||
| 
 | 
 | ||||||
| 		if (!undriven_bits.empty() && !holes_mode) { | 		if (!holes_mode) { | ||||||
| 			bool whole_module = module->design->selected_whole_module(module->name); | 			for (auto port : module->ports) { | ||||||
| 			undriven_bits.sort(); | 				auto wire = module->wire(port); | ||||||
| 			for (auto bit : undriven_bits) { | 				if (!wire->port_output) | ||||||
| 				if (whole_module) | 					continue; | ||||||
| 					log_warning("Treating undriven bit %s.%s like $anyseq.\n", log_id(module), log_signal(bit)); | 				for (int i = 0; i < GetSize(wire); i++) { | ||||||
| 				input_bits.insert(bit); | 					SigBit wirebit(wire, i); | ||||||
|  | 					SigBit bit = sigmap(wirebit); | ||||||
|  | 					if (bit == State::Sx) | ||||||
|  | 						continue; | ||||||
|  | 					if (!undriven_bits.count(bit)) { | ||||||
|  | 						output_bits.insert(wirebit); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
| 			if (whole_module) | 
 | ||||||
| 				log_warning("Treating a total of %d undriven bits in %s like $anyseq.\n", GetSize(undriven_bits), log_id(module)); | 			if (!undriven_bits.empty()) | ||||||
|  | 				for (auto bit : undriven_bits) | ||||||
|  | 					input_bits.insert(bit); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (holes_mode) { | 		if (holes_mode) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue