mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Added support for simple gates with one constant input to opt_const
This commit is contained in:
		
							parent
							
								
									da3d55a29c
								
							
						
					
					
						commit
						1bbc2b34c8
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -76,6 +76,8 @@ void replace_const_cells(RTLIL::Module *module)
 | 
				
			||||||
			if (input.match("11")) ACTION_DO_Y(1);
 | 
								if (input.match("11")) ACTION_DO_Y(1);
 | 
				
			||||||
			if (input.match(" *")) ACTION_DO_Y(x);
 | 
								if (input.match(" *")) ACTION_DO_Y(x);
 | 
				
			||||||
			if (input.match("* ")) ACTION_DO_Y(x);
 | 
								if (input.match("* ")) ACTION_DO_Y(x);
 | 
				
			||||||
 | 
								if (input.match(" 1")) ACTION_DO("\\Y", input.extract(1, 1));
 | 
				
			||||||
 | 
								if (input.match("1 ")) ACTION_DO("\\Y", input.extract(0, 1));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (cell->type == "$_OR_") {
 | 
							if (cell->type == "$_OR_") {
 | 
				
			||||||
| 
						 | 
					@ -88,6 +90,8 @@ void replace_const_cells(RTLIL::Module *module)
 | 
				
			||||||
			if (input.match("00")) ACTION_DO_Y(0);
 | 
								if (input.match("00")) ACTION_DO_Y(0);
 | 
				
			||||||
			if (input.match(" *")) ACTION_DO_Y(x);
 | 
								if (input.match(" *")) ACTION_DO_Y(x);
 | 
				
			||||||
			if (input.match("* ")) ACTION_DO_Y(x);
 | 
								if (input.match("* ")) ACTION_DO_Y(x);
 | 
				
			||||||
 | 
								if (input.match(" 0")) ACTION_DO("\\Y", input.extract(1, 1));
 | 
				
			||||||
 | 
								if (input.match("0 ")) ACTION_DO("\\Y", input.extract(0, 1));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (cell->type == "$_XOR_") {
 | 
							if (cell->type == "$_XOR_") {
 | 
				
			||||||
| 
						 | 
					@ -101,6 +105,8 @@ void replace_const_cells(RTLIL::Module *module)
 | 
				
			||||||
			if (input.match("11")) ACTION_DO_Y(0);
 | 
								if (input.match("11")) ACTION_DO_Y(0);
 | 
				
			||||||
			if (input.match(" *")) ACTION_DO_Y(x);
 | 
								if (input.match(" *")) ACTION_DO_Y(x);
 | 
				
			||||||
			if (input.match("* ")) ACTION_DO_Y(x);
 | 
								if (input.match("* ")) ACTION_DO_Y(x);
 | 
				
			||||||
 | 
								if (input.match(" 0")) ACTION_DO("\\Y", input.extract(1, 1));
 | 
				
			||||||
 | 
								if (input.match("0 ")) ACTION_DO("\\Y", input.extract(0, 1));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (cell->type == "$_MUX_") {
 | 
							if (cell->type == "$_MUX_") {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue