mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-26 18:45:34 +00:00
Add AST_SELFSZ and improve handling of bit slices
Signed-off-by: Claire Wolf <claire@symbioticeda.com>
This commit is contained in:
parent
bbbce0d1c5
commit
589ed2d970
5 changed files with 22 additions and 7 deletions
|
@ -645,13 +645,13 @@ non_opt_range:
|
|||
} |
|
||||
'[' expr TOK_POS_INDEXED expr ']' {
|
||||
$$ = new AstNode(AST_RANGE);
|
||||
AstNode *expr = new AstNode(AST_CONCAT, $2);
|
||||
AstNode *expr = new AstNode(AST_SELFSZ, $2);
|
||||
$$->children.push_back(new AstNode(AST_SUB, new AstNode(AST_ADD, expr->clone(), $4), AstNode::mkconst_int(1, true)));
|
||||
$$->children.push_back(new AstNode(AST_ADD, expr, AstNode::mkconst_int(0, true)));
|
||||
} |
|
||||
'[' expr TOK_NEG_INDEXED expr ']' {
|
||||
$$ = new AstNode(AST_RANGE);
|
||||
AstNode *expr = new AstNode(AST_CONCAT, $2);
|
||||
AstNode *expr = new AstNode(AST_SELFSZ, $2);
|
||||
$$->children.push_back(new AstNode(AST_ADD, expr, AstNode::mkconst_int(0, true)));
|
||||
$$->children.push_back(new AstNode(AST_SUB, new AstNode(AST_ADD, expr->clone(), AstNode::mkconst_int(1, true)), $4));
|
||||
} |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue