mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-29 18:52:30 +00:00 
			
		
		
		
	cxxrtl: don't assert on edge sync rules tied to a constant.
These are commonly the result of tying an async reset to an inactive level.
This commit is contained in:
		
							parent
							
								
									d1de08e38a
								
							
						
					
					
						commit
						ab76d9cec5
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -1518,6 +1518,8 @@ struct CxxrtlWorker { | ||||||
| 			if (!sync->signal.empty()) { | 			if (!sync->signal.empty()) { | ||||||
| 				sync_bit = sync->signal[0]; | 				sync_bit = sync->signal[0]; | ||||||
| 				sync_bit = sigmaps[sync_bit.wire->module](sync_bit); | 				sync_bit = sigmaps[sync_bit.wire->module](sync_bit); | ||||||
|  | 				if (!sync_bit.is_wire()) | ||||||
|  | 					continue; // a clock, or more commonly a reset, can be tied to a constant driver
 | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			pool<std::string> events; | 			pool<std::string> events; | ||||||
|  | @ -2285,6 +2287,8 @@ struct CxxrtlWorker { | ||||||
| 	void register_edge_signal(SigMap &sigmap, RTLIL::SigSpec signal, RTLIL::SyncType type) | 	void register_edge_signal(SigMap &sigmap, RTLIL::SigSpec signal, RTLIL::SyncType type) | ||||||
| 	{ | 	{ | ||||||
| 		signal = sigmap(signal); | 		signal = sigmap(signal); | ||||||
|  | 		if (signal.is_fully_const()) | ||||||
|  | 			return; // a clock, or more commonly a reset, can be tied to a constant driver
 | ||||||
| 		log_assert(is_valid_clock(signal)); | 		log_assert(is_valid_clock(signal)); | ||||||
| 		log_assert(type == RTLIL::STp || type == RTLIL::STn || type == RTLIL::STe); | 		log_assert(type == RTLIL::STp || type == RTLIL::STn || type == RTLIL::STe); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue