mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Add statement labels for immediate assertions
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
		
							parent
							
								
									66ffc99695
								
							
						
					
					
						commit
						2d7f3123f0
					
				
					 1 changed files with 23 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -1239,39 +1239,42 @@ opt_label:
 | 
			
		|||
opt_property:
 | 
			
		||||
	TOK_PROPERTY | /* empty */;
 | 
			
		||||
 | 
			
		||||
opt_stmt_label:
 | 
			
		||||
	TOK_ID ':' | /* empty */;
 | 
			
		||||
 | 
			
		||||
assert:
 | 
			
		||||
	TOK_ASSERT opt_property '(' expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(assume_asserts_mode ? AST_ASSUME : AST_ASSERT, $4));
 | 
			
		||||
	opt_stmt_label TOK_ASSERT opt_property '(' expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(assume_asserts_mode ? AST_ASSUME : AST_ASSERT, $5));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_ASSUME opt_property '(' expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_ASSUME, $4));
 | 
			
		||||
	opt_stmt_label TOK_ASSUME opt_property '(' expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_ASSUME, $5));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_ASSERT opt_property '(' TOK_EVENTUALLY expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(assume_asserts_mode ? AST_FAIR : AST_LIVE, $5));
 | 
			
		||||
	opt_stmt_label TOK_ASSERT opt_property '(' TOK_EVENTUALLY expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(assume_asserts_mode ? AST_FAIR : AST_LIVE, $6));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_ASSUME opt_property '(' TOK_EVENTUALLY expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_FAIR, $5));
 | 
			
		||||
	opt_stmt_label TOK_ASSUME opt_property '(' TOK_EVENTUALLY expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_FAIR, $6));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_COVER opt_property '(' expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_COVER, $4));
 | 
			
		||||
	opt_stmt_label TOK_COVER opt_property '(' expr ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_COVER, $5));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_COVER opt_property '(' ')' ';' {
 | 
			
		||||
	opt_stmt_label TOK_COVER opt_property '(' ')' ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_COVER, AstNode::mkconst_int(1, false)));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_COVER ';' {
 | 
			
		||||
	opt_stmt_label TOK_COVER ';' {
 | 
			
		||||
		ast_stack.back()->children.push_back(new AstNode(AST_COVER, AstNode::mkconst_int(1, false)));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_RESTRICT opt_property '(' expr ')' ';' {
 | 
			
		||||
		if (norestrict_mode)
 | 
			
		||||
			delete $4;
 | 
			
		||||
		else
 | 
			
		||||
			ast_stack.back()->children.push_back(new AstNode(AST_ASSUME, $4));
 | 
			
		||||
	} |
 | 
			
		||||
	TOK_RESTRICT opt_property '(' TOK_EVENTUALLY expr ')' ';' {
 | 
			
		||||
	opt_stmt_label TOK_RESTRICT opt_property '(' expr ')' ';' {
 | 
			
		||||
		if (norestrict_mode)
 | 
			
		||||
			delete $5;
 | 
			
		||||
		else
 | 
			
		||||
			ast_stack.back()->children.push_back(new AstNode(AST_FAIR, $5));
 | 
			
		||||
			ast_stack.back()->children.push_back(new AstNode(AST_ASSUME, $5));
 | 
			
		||||
	} |
 | 
			
		||||
	opt_stmt_label TOK_RESTRICT opt_property '(' TOK_EVENTUALLY expr ')' ';' {
 | 
			
		||||
		if (norestrict_mode)
 | 
			
		||||
			delete $6;
 | 
			
		||||
		else
 | 
			
		||||
			ast_stack.back()->children.push_back(new AstNode(AST_FAIR, $6));
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
assert_property:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue