mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	allow enums to be declared at toplevel scope
This commit is contained in:
		
							parent
							
								
									caf35896da
								
							
						
					
					
						commit
						41a0a93dcc
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
					@ -428,6 +428,13 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 | 
				
			||||||
			if (node->type == AST_PARAMETER || node->type == AST_LOCALPARAM || node->type == AST_WIRE || node->type == AST_AUTOWIRE || node->type == AST_MEMORY || node->type == AST_TYPEDEF)
 | 
								if (node->type == AST_PARAMETER || node->type == AST_LOCALPARAM || node->type == AST_WIRE || node->type == AST_AUTOWIRE || node->type == AST_MEMORY || node->type == AST_TYPEDEF)
 | 
				
			||||||
				while (node->simplify(true, false, false, 1, -1, false, node->type == AST_PARAMETER || node->type == AST_LOCALPARAM))
 | 
									while (node->simplify(true, false, false, 1, -1, false, node->type == AST_PARAMETER || node->type == AST_LOCALPARAM))
 | 
				
			||||||
					did_something = true;
 | 
										did_something = true;
 | 
				
			||||||
 | 
								if (node->type == AST_ENUM) {
 | 
				
			||||||
 | 
									for (auto enode : node->children){
 | 
				
			||||||
 | 
										log_assert(enode->type==AST_ENUM_ITEM);
 | 
				
			||||||
 | 
										while (node->simplify(true, false, false, 1, -1, false, node->type == AST_ENUM_ITEM))
 | 
				
			||||||
 | 
											did_something = true;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue