3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 22:23:23 +00:00

Added cast to type support (#4284)

This commit is contained in:
rherveille 2024-09-29 23:03:01 +02:00 committed by GitHub
parent 8e1e2b9a39
commit ce7db661a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 573 additions and 2 deletions

View file

@ -3506,6 +3506,12 @@ basic_expr:
$$ = new AstNode(AST_CAST_SIZE, $1, $4);
SET_AST_NODE_LOC($$, @1, @4);
} |
typedef_base_type OP_CAST '(' expr ')' {
if (!sv_mode)
frontend_verilog_yyerror("Static cast is only supported in SystemVerilog mode.");
$$ = new AstNode(AST_CAST_SIZE, $1, $4);
SET_AST_NODE_LOC($$, @1, @4);
} |
'(' expr '=' expr ')' {
ensureAsgnExprAllowed();
AstNode *node = new AstNode(AST_ASSIGN_EQ, $2, $4);