mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Add $live and $fair cell types, add support for s_eventually keyword
This commit is contained in:
		
							parent
							
								
									7af9727f78
								
							
						
					
					
						commit
						5f1d0b1024
					
				
					 14 changed files with 80 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -84,6 +84,8 @@ std::string AST::type2str(AstNodeType type)
 | 
			
		|||
	X(AST_PREFIX)
 | 
			
		||||
	X(AST_ASSERT)
 | 
			
		||||
	X(AST_ASSUME)
 | 
			
		||||
	X(AST_LIVE)
 | 
			
		||||
	X(AST_FAIR)
 | 
			
		||||
	X(AST_COVER)
 | 
			
		||||
	X(AST_FCALL)
 | 
			
		||||
	X(AST_TO_BITS)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,6 +65,8 @@ namespace AST
 | 
			
		|||
		AST_PREFIX,
 | 
			
		||||
		AST_ASSERT,
 | 
			
		||||
		AST_ASSUME,
 | 
			
		||||
		AST_LIVE,
 | 
			
		||||
		AST_FAIR,
 | 
			
		||||
		AST_COVER,
 | 
			
		||||
 | 
			
		||||
		AST_FCALL,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1336,10 +1336,15 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
 | 
			
		|||
	// generate $assert cells
 | 
			
		||||
	case AST_ASSERT:
 | 
			
		||||
	case AST_ASSUME:
 | 
			
		||||
	case AST_LIVE:
 | 
			
		||||
	case AST_FAIR:
 | 
			
		||||
	case AST_COVER:
 | 
			
		||||
		{
 | 
			
		||||
			const char *celltype = "$assert";
 | 
			
		||||
			const char *celltype = nullptr;
 | 
			
		||||
			if (type == AST_ASSERT) celltype = "$assert";
 | 
			
		||||
			if (type == AST_ASSUME) celltype = "$assume";
 | 
			
		||||
			if (type == AST_LIVE) celltype = "$live";
 | 
			
		||||
			if (type == AST_FAIR) celltype = "$fair";
 | 
			
		||||
			if (type == AST_COVER) celltype = "$cover";
 | 
			
		||||
 | 
			
		||||
			log_assert(children.size() == 2);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1400,7 +1400,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
 | 
			
		|||
	}
 | 
			
		||||
skip_dynamic_range_lvalue_expansion:;
 | 
			
		||||
 | 
			
		||||
	if (stage > 1 && (type == AST_ASSERT || type == AST_ASSUME || type == AST_COVER) && current_block != NULL)
 | 
			
		||||
	if (stage > 1 && (type == AST_ASSERT || type == AST_ASSUME || type == AST_LIVE || type == AST_FAIR || type == AST_COVER) && current_block != NULL)
 | 
			
		||||
	{
 | 
			
		||||
		std::stringstream sstr;
 | 
			
		||||
		sstr << "$formal$" << filename << ":" << linenum << "$" << (autoidx++);
 | 
			
		||||
| 
						 | 
				
			
			@ -1462,7 +1462,7 @@ skip_dynamic_range_lvalue_expansion:;
 | 
			
		|||
		goto apply_newNode;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (stage > 1 && (type == AST_ASSERT || type == AST_ASSUME || type == AST_COVER) && children.size() == 1)
 | 
			
		||||
	if (stage > 1 && (type == AST_ASSERT || type == AST_ASSUME || type == AST_LIVE || type == AST_FAIR || type == AST_COVER) && children.size() == 1)
 | 
			
		||||
	{
 | 
			
		||||
		children.push_back(mkconst_int(1, false, 1));
 | 
			
		||||
		did_something = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue