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

question: how to read this syntax? #35

Closed
hughperkins opened this issue May 10, 2022 · 2 comments
Closed

question: how to read this syntax? #35

hughperkins opened this issue May 10, 2022 · 2 comments

Comments

@hughperkins
Copy link

hughperkins commented May 10, 2022

Hi, this isnt an issue, it's a question, about verilog, since you're using a notation I haven't seen before, and not quite sure how to Google.

At e.g.

reg [7:0] m_axi_awlen_reg = 8'd0, m_axi_awlen_next;

reg [7:0] m_axi_awlen_reg = 8'd0, m_axi_awlen_next;

So, I'm interpreting this to mean that, you create an 8 bit register m_axi_awlen_reg, and assign it the value of m_axi_awlen_next. However, I'm not sure what the 8'd0, does? I'm guessing it does something like assert the number of bits in m_axi_awlen_next? (I looked through verilog-std-1364-2005.pdf, eg section 6.2, 9.2, but wasn't able to find the relevant syntax).

@alexforencich
Copy link
Owner

Declare 8 bit reg m_axi_awlen_reg, initialize it to zero, declare 8 bit reg m_axi_awlen_next, initialize it to X.

@hughperkins
Copy link
Author

hughperkins commented May 10, 2022

Oh.... thanks! I assumed it was a declaration of a single register, but I see now that it declares two. Got it. thanks! :)

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

No branches or pull requests

2 participants