mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 19:52:31 +00:00 
			
		
		
		
	Merge pull request #3840 from povik/cellaigs-cmp-cells
This commit is contained in:
		
						commit
						0a3f805daa
					
				
					 1 changed files with 20 additions and 0 deletions
				
			
		|  | @ -385,6 +385,26 @@ Aig::Aig(Cell *cell) | |||
| 		goto optimize; | ||||
| 	} | ||||
| 
 | ||||
| 	if (cell->type.in({ID($lt), ID($gt), ID($le), ID($ge)})) | ||||
| 	{ | ||||
| 		int width = std::max(GetSize(cell->getPort(ID::A)), | ||||
| 							 GetSize(cell->getPort(ID::B))) + 1; | ||||
| 		vector<int> A = mk.inport_vec(ID::A, width); | ||||
| 		vector<int> B = mk.inport_vec(ID::B, width); | ||||
| 
 | ||||
| 		if (cell->type.in({ID($gt), ID($ge)})) | ||||
| 			std::swap(A, B); | ||||
| 
 | ||||
| 		int carry = mk.bool_node(!cell->type.in({ID($le), ID($ge)})); | ||||
| 		for (auto &n : B) | ||||
| 			n = mk.not_gate(n); | ||||
| 		vector<int> Y = mk.adder(A, B, carry); | ||||
| 		mk.outport(Y.back(), ID::Y); | ||||
| 		for (int i = 1; i < GetSize(cell->getPort(ID::Y)); i++) | ||||
| 			mk.outport(mk.bool_node(false), ID::Y, i); | ||||
| 		goto optimize; | ||||
| 	} | ||||
| 
 | ||||
| 	if (cell->type == ID($alu)) | ||||
| 	{ | ||||
| 		int width = GetSize(cell->getPort(ID::Y)); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue