mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Improved seeding of color rng in show command
This commit is contained in:
		
							parent
							
								
									a341931972
								
							
						
					
					
						commit
						44f13aff92
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -54,7 +54,7 @@ struct ShowWorker
 | 
			
		|||
	const std::vector<std::pair<std::string, RTLIL::Selection>> &color_selections;
 | 
			
		||||
	const std::vector<std::pair<std::string, RTLIL::Selection>> &label_selections;
 | 
			
		||||
 | 
			
		||||
	uint32_t xorshift32(uint32_t x) {
 | 
			
		||||
	static uint32_t xorshift32(uint32_t x) {
 | 
			
		||||
		x ^= x << 13;
 | 
			
		||||
		x ^= x >> 17;
 | 
			
		||||
		x ^= x << 5;
 | 
			
		||||
| 
						 | 
				
			
			@ -655,6 +655,8 @@ struct ShowPass : public Pass {
 | 
			
		|||
			}
 | 
			
		||||
			if (arg == "-colors" && argidx+1 < args.size()) {
 | 
			
		||||
				colorSeed = atoi(args[++argidx].c_str());
 | 
			
		||||
				for (int i = 0; i < 100; i++)
 | 
			
		||||
					colorSeed = ShowWorker::xorshift32(colorSeed);
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			if (arg == "-format" && argidx+1 < args.size()) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue