-
Notifications
You must be signed in to change notification settings - Fork 173
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
docs: update docs for element-addressable memory #1616
Conversation
bbe0410
to
1c233c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did an initial review and things look good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just remove the helper registers as they have no use with the recent changes. For someone without any historical knowledge of the changes, having helper registers in the drawing will just be confusing, I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, and everywhere there are unused helper registers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal: would waddr
or w_addr
work better here and potentially everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find word_addr
to be more descriptive, but I'm also okay with changing it
docs/src/design/chiplets/memory.md
Outdated
- When both the context and the address remain the same, this column contains the inverse of $(i' - i - 1)$. | ||
- When the context remains the same but the word address changes, this column contains the inverse of $(a' - a)$. | ||
- When both the context and the word address remain the same, this column contains the inverse of $(clk' - clk - 1)$. | ||
- Column `f_scw` stands for "flag same context and word address", which is set to $1$ when the current and next rows have the same context and word address, and $0$ otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be "current and previous row" given the usage below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed
docs/src/design/chiplets/memory.md
Outdated
- Column `t` contains the inverse of the delta between two consecutive context IDs, addresses, or clock cycles. Specifically: | ||
- When the context changes, this column contains the inverse of $(c' - c)$. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but is this definition of t
congruent with how n0
and n1
are defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm not sure I follow, could you rephrase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, the above sentence says that t
contains the inverse of c' - c
but n0
is defined as n0 = (c' - c) . t'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current way it's written, it doesn't mention whether the "current" or "next" row in a frame contains the deltas. d0
and d1
are described in a similar manner.
I updated both to say that the "next" row contains the delta.
docs/src/design/chiplets/memory.md
Outdated
- For the first row of the chiplet (in the "next" position of the frame), for $0 \leq i < 4$, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add the selector, or at least a comment about it, for first row?
Similar comment about selector for within memory chiplet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I added the flags to all constraints
c_i = rw' + (1 - rw') \cdot (1 - ew') \cdot (1 - f_i') \text{ | degree} = 4\\ | ||
$$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a naming collision with regards to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed all c
to ctx
8fe0133
to
42a5bc6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you. I left some comments inline. Assuming I didn't make too many mistakes, we should review the constraints more carefully.
@Al-Kindi-0 @paracetamolo - could you take another look as well?
Also, would be good to rebase this PR to get rid of the changes carried over from the previously merged PR. |
42a5bc6
to
3717045
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you! I left a few small comments inline.
Also, a question: are the memory chiplet bus constraints not implemented yet? (asking because even though we changed the description of constraints, nothing changed in the code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
/// - `idx0` and `idx1` are selector columns used to identify which element in the word is being | ||
/// accessed. Specifically, the index within the word is computed as `idx1 * 2 + idx0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably worth adding that this is only when the op is an element op. Else, they are probably set to zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what we have in the sub-bullet point:
- However, when `ew` is set to $1$ (indicating that a word is accessed), these columns are meaningless and are set to $0$.
docs/src/design/chiplets/memory.md
Outdated
- For all rows of the chiplet except the first, and when there is new context or word address, for $0 \leq i < 4$, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably be updated after the merge of constraints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right; fixed
The bus was modified in the previous PR (see miden-vm/processor/src/chiplets/aux_trace/mod.rs Lines 900 to 944 in 0e7c1d6
|
Updates the docs for element-addressable memory