-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ImportVerilog] Add assign and pre/post increment/decrement expressio…
…ns (#6859) Add support for pre and post increment and decrement expressions, like `x++` and `--x`, as well as assign expressions, like `a += 5`. Slang represents these assignments as `Assign(a, Add(LValueRef, 5))` in the AST. The `LValueRef` node contextually refers to the parent assignment's left-hand side. To deal with this, also add a corresponding lvalue stack to the conversion context. Assignments push and pop their lvalues onto and off of this stack. These expressions require a mechanism in the IR to express _when_ a variable is read. To capture this, add a new `moore.read_lvalue` op. It currently looks like an identity operation with a `MemRead` side effect. Further down the road, we may want to introduce a proper reference type for variables, ports, nets, and other things, and have `read_lvalue` and the various assigns operate on that type instead. This sets the foundation for that. Co-authored-by: Hailong Sun <hailong.sun@terapines.com> Co-authored-by: ShiZuoye <albertethon@163.com> Co-authored-by: hunterzju <hunter_ht@zju.edu.cn> Co-authored-by: Anqi Yu <anqi.yu@terapines.com>
- Loading branch information
1 parent
7a01c49
commit 8ec0523
Showing
4 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters