mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Merge pull request #1350 from YosysHQ/clifford/fixsby59
Properly construct $live and $fair cells from "if (...) assume/assert (s_eventually ...)"
This commit is contained in:
		
						commit
						4b7202c9c2
					
				
					 1 changed files with 18 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -1530,10 +1530,16 @@ skip_dynamic_range_lvalue_expansion:;
 | 
			
		|||
		current_scope[wire_en->str] = wire_en;
 | 
			
		||||
		while (wire_en->simplify(true, false, false, 1, -1, false, false)) { }
 | 
			
		||||
 | 
			
		||||
		std::vector<RTLIL::State> x_bit;
 | 
			
		||||
		x_bit.push_back(RTLIL::State::Sx);
 | 
			
		||||
		AstNode *check_defval;
 | 
			
		||||
		if (type == AST_LIVE || type == AST_FAIR) {
 | 
			
		||||
			check_defval = new AstNode(AST_REDUCE_BOOL, children[0]->clone());
 | 
			
		||||
		} else {
 | 
			
		||||
			std::vector<RTLIL::State> x_bit;
 | 
			
		||||
			x_bit.push_back(RTLIL::State::Sx);
 | 
			
		||||
			check_defval = mkconst_bits(x_bit, false);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		AstNode *assign_check = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), mkconst_bits(x_bit, false));
 | 
			
		||||
		AstNode *assign_check = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), check_defval);
 | 
			
		||||
		assign_check->children[0]->str = id_check;
 | 
			
		||||
		assign_check->children[0]->was_checked = true;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1546,9 +1552,13 @@ skip_dynamic_range_lvalue_expansion:;
 | 
			
		|||
		default_signals->children.push_back(assign_en);
 | 
			
		||||
		current_top_block->children.insert(current_top_block->children.begin(), default_signals);
 | 
			
		||||
 | 
			
		||||
		assign_check = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), new AstNode(AST_REDUCE_BOOL, children[0]->clone()));
 | 
			
		||||
		assign_check->children[0]->str = id_check;
 | 
			
		||||
		assign_check->children[0]->was_checked = true;
 | 
			
		||||
		if (type == AST_LIVE || type == AST_FAIR) {
 | 
			
		||||
			assign_check = nullptr;
 | 
			
		||||
		} else {
 | 
			
		||||
			assign_check = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), new AstNode(AST_REDUCE_BOOL, children[0]->clone()));
 | 
			
		||||
			assign_check->children[0]->str = id_check;
 | 
			
		||||
			assign_check->children[0]->was_checked = true;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (current_always == nullptr || current_always->type != AST_INITIAL) {
 | 
			
		||||
			assign_en = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), mkconst_int(1, false, 1));
 | 
			
		||||
| 
						 | 
				
			
			@ -1560,7 +1570,8 @@ skip_dynamic_range_lvalue_expansion:;
 | 
			
		|||
		assign_en->children[0]->was_checked = true;
 | 
			
		||||
 | 
			
		||||
		newNode = new AstNode(AST_BLOCK);
 | 
			
		||||
		newNode->children.push_back(assign_check);
 | 
			
		||||
		if (assign_check != nullptr)
 | 
			
		||||
			newNode->children.push_back(assign_check);
 | 
			
		||||
		newNode->children.push_back(assign_en);
 | 
			
		||||
 | 
			
		||||
		AstNode *assertnode = new AstNode(type);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue