-
Notifications
You must be signed in to change notification settings - Fork 47
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
[Papercut] Check read and write-together specs for combinational groups #1215
Comments
Looked at this a little bit and tried to reduce the file. A particular problem seems to be this line: There no address provided for the read from the memory
The interpreter output difference is likely because of the difference caused by this. We should make the papercut pass warn about such uses of memories in |
Super interesting. I wonder if this (missing input address for a memory read) is something that would be easy for the interpreter to catch? Probably not, because we'd just see it as a zero instead of a missing value. But someday soon we will have a proper treatment of undefinedness… |
I imagine we could add another feature to the interpreter representation of primitives that ensures X signals are driven together, similar to @{write_together,read_together}. |
Yeah, that kind of validation would be useful. Maybe the interpreter should have a bunch of hooks that allow us to add these kinds of analyses in a modular fashion (we already have something for |
Hmm okay, did a tiny bit of digging and reproduced the error locally, though for some reason my local version of verilator
Anyway, afaik this is a case where the verilator version is only "working" because the undriven value is zero and because the memory address is not being driven when the conditional is checked (per the error @rachitnigam identified). Since the memory only contains a single slot, this accidentally behaves as expected. The interpreter doesn't update the value of the memory because it is not given new input, so it retains an undriven output (in this case 0) which means the comparison always fails and the values are consequently never updated. Whether we consider this an interpreter error is down more to our opinions on undefined values and I don't know that it really should agree with verilator here given that the program is unambiguously buggy. Though in the future it would definitely be nice to highlight this error more directly |
Weird about the Verilog syntax error!!! 😬 But yes, this seems (to me) to be a pretty clear instance of our broader conversation about undefinedness (e.g., #922 and #1013). I think the status-quo idea to beat would consist of these axioms:
How to satisfy all of those, however, may be kinda subtle. |
I was also getting the weird syntax error
When the call for /*********** Other Structure **************/
curIter = std_reg(32); // current iteration
add = std_add(32);
lt = std_lt(32);
p = process_edge();
- process = processing_phase();
+ pp = processing_phase();
app = apply_phase(); This is the same reason why all other structures have short naming conventions... Specifically, at line 571 does the code invoke I fixed this by just replacing |
Ah, so That would do it. I know this is silly, but we could consider some form of mangling in our Verilog backend to avoid problems like this. (Possibly using a hard-coded list of reserved words, which get a |
Ah, we should add it to the list of restricted identifiers in the well-formedness check |
When implementing a single source shortest path graph analytics algorithm (Graphicionado) in Calyx, I stumbled onto a bug in my implementation where I didn't iteratively update the values for
VProperty
(the shortest path cycle of each vertex from the initial active vertex). The output was the default value for all vertices:99
(excluding the initial active vertex which is0
).However, when running the program with the verilator front end instead of the interpreter, the output replaces all instances of
99
with0
. This output holds for whatever default values inVProperty
.The buggy code can be found in the calyx-graphicionado private repo, and you can replicate the issue by running the following commands from root:
I'm running
Verilator 5.001 devel rev v4.228-150-g68927d4fd
.The correct code can be found under tests/correctness/graphicionado and doesn't produce an output difference.
The text was updated successfully, but these errors were encountered: