Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keywords "def" and "def mut" #24

Open
tcr opened this issue Dec 31, 2016 · 1 comment
Open

Keywords "def" and "def mut" #24

tcr opened this issue Dec 31, 2016 · 1 comment

Comments

@tcr
Copy link
Owner

tcr commented Dec 31, 2016

This issue is for bikeshedding keywords.

"def" is introduced as an analog for "wire" in Verilog, albeit more strictly typed (no latches should be inferred when using this). The term "def" for definition is used instead of "let" because we don't lexically scope the variable definition; instead it is referencable by the entire entity.

"def mut" is analogous to "reg" in Verilog, and is meant to draw a similarity to Rust's "mut" declaration. This means that a latch will be generated (if necessary) for the variable, and it can only be assigned using nonblocking "<=" or blocking ":=" operators inside of an on <expr> { ... } block.

"def" for defining a static declaration isn't my favorite; "static" would be nice, but is fairly verbose. "mut" I am more comfortable with, though it means something different in Rust and HDL, since the guarantees by either feel similar.

@vitiral
Copy link

vitiral commented Apr 1, 2017

Coming from python, "def" makes me think it's a function. What is wrong with "wire"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants