mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	celltypes: Comment pointing to ConstEval
`CellTypes::eval()` is more generic but also more limited. `ConstEval::eval()` requires more setup (both in code and at runtime) but has more complete support.
This commit is contained in:
		
							parent
							
								
									20c2d2a6f3
								
							
						
					
					
						commit
						1afe8d9f4d
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -334,6 +334,7 @@ struct CellTypes | |||
| 		return v; | ||||
| 	} | ||||
| 
 | ||||
| 	// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
 | ||||
| 	static RTLIL::Const eval(RTLIL::IdString type, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len, bool *errp = nullptr) | ||||
| 	{ | ||||
| 		if (type == ID($sshr) && !signed1) | ||||
|  | @ -416,6 +417,7 @@ struct CellTypes | |||
| 		log_abort(); | ||||
| 	} | ||||
| 
 | ||||
| 	// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
 | ||||
| 	static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool *errp = nullptr) | ||||
| 	{ | ||||
| 		if (cell->type == ID($slice)) { | ||||
|  | @ -503,6 +505,7 @@ struct CellTypes | |||
| 		return eval(cell->type, arg1, arg2, signed_a, signed_b, result_len, errp); | ||||
| 	} | ||||
| 
 | ||||
| 	// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
 | ||||
| 	static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, bool *errp = nullptr) | ||||
| 	{ | ||||
| 		if (cell->type.in(ID($mux), ID($_MUX_))) | ||||
|  | @ -522,6 +525,7 @@ struct CellTypes | |||
| 		return eval(cell, arg1, arg2, errp); | ||||
| 	} | ||||
| 
 | ||||
| 	// Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
 | ||||
| 	static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, const RTLIL::Const &arg4, bool *errp = nullptr) | ||||
| 	{ | ||||
| 		if (cell->type == ID($_AOI4_)) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue