-
Notifications
You must be signed in to change notification settings - Fork 965
Extend "delay" expressions to handle pair and triplet, i.e. rise, fall and turn-off #2566
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
Conversation
Thanks Prof whitequark! Well that was pretty easy. Do you know if propagating new |
@zachjs Could you please take a look at this PR? I don't understand the relevant parts of the LRM well enough. |
Welcome @TimRudy! Would you be able to add a quick test to (a) demonstrate its usage, and (b) make sure it doesn't get broken in the future? Maybe inside tests/verilog -- adapt an existing test there? |
Relevant portions of the SV grammar: (
So you can have something like module top;
wire o, a, b;
and #(1:2:3, 4:5:6) and_gate (o, a, b);
wire #(1:2:3, 4:5:6, 7:8:9) x;
assign x = o;
endmodule
Both with and without these additions, there are false-positive and false-negative parses with the current grammar. That said, these delays are naturally dropped for synthesis, so it may not be worth worrying about the false-positives. I have no objections to merging this PR for now and revising our grammar for delays down the line. I can also take a stab at this in the near term if desired. |
My enthusiasm for open source dropped off a cliff as cygwin and building was not smooth, I was on StackOverflow which is not a good karma for a weekend passtime. (However after a little segmentation violation scare in an ABC file - solution, try again - C/C++ compilation is like riding a bike? - there is truly a lot of building done now.) To get yosys to finish I need a fresh build of iverilog from Git - but the iverilog build is giving me the bigger problems. ... OK, I did have version 10.1 installed and I seem to have found an 11 of it for Windows at http://bleyer.org/icarus, that's gotta work, it's recent. Back to you about those tests soon |
@TimRudy Have you considered using WSL2? |
Hi guys, It comes down to using
Needs an issue, I guess: What is best way to do these kind of things in platform-independent .sh files? Any comments on that welcome. |
@TimRudy I don't think I'm qualified to comment on the build/script issues mentioned above. However, I'm interested in moving forward with this change. If you're currently blocked, I'd also be happy to take a stab at supporting these and other delay variants and add some test coverage. |
Thanks - My next step is to clone a file like bug2037.ys in verilog test
and write a number of examples of delays in the grammer - starting with only what we would call legitimate verilog-compliant There are non-compliant constructs that you referred to above, I understand, and if tests were written for those they would pass, but would indicate Yosys is allowing weird delays, right? I will do the above basics, some tonight, OK? |
I think it's fine to not worry about coverage for the "negative" cases for the time being. I can add coverage in a future PR once the grammar includes more of the positive cases I described above. |
Yeah I can tell you're interested in tweaking the grammar, so it breaks out the delay specs a bit... That would be cool, I thought about it but will leave that stuff to you. Can you give an example of a positive case so I understand specifically? |
Sorry Zach, I couldn't run tests in a timely way on my machine, so will check in again on the weekend |
I'll push some tests tomorrow, I got the tests to run & pass |
Notes, updated: I didn't uncover every corner of the grammar
Finally, I didn't do SV test - Cheers |
Thanks for adding test coverage and highlighting some of the other cases we should look into in the future. Would you mind squashing so the tests are added in the same commit as the grammar changes? Otherwise, LGTM. |
More missing expressions added to grammar, may help even more people avoid syntax errors. If that's OK, let me know and I'll send the squash commit |
LGTM, let's get this squashed and I'll merge it! |
Can you squash these commits before we merge? This can help make log/blame more useful on popular files like these. |
I see that "squash and merge" is the default setting now. Is there a need to do it on the source branch too? |
Does my head commit look like a squash or like a merge? Tell me if it's good to go, thanks Eddie |
It's only the default for you (it's per repo/user combination).
You can only squash all commits with the GitHub merge button, but sometimes it makes sense to squash some. (Not sure which category this PR is in.) |
Ooh I didn't know that, it must have remembered my last setting. I would assume that it could be enforced at the repo-wide level if one wanted. I think it's the right thing to do now (despite being careless and not doing so in the past and getting my commit count up!)
I would say that when you ask a contributor to squash, they will typically squash all commits into one. Clicking the button could save that round trip. |
It is possible to individually enable or disable each of the three merge options (merge, squash, rebase) at the repo level. While squashing into a single commit is often appropriate, I don't think we should require squashing for all changes. I personally prefer rebase-only, but this would be a significant departure for this project. I also wouldn't mind using GitHub's squash for this and other changes, so long as we are comfortable with results. |
I agree with @zachjs here. |
Barring any objections, I will generally opt for squashing change sets like this one. Note that the author of the squashed commit will likely be the creator of the PR, so if a PR is opened on behalf of another author, we may want to manually squash instead. I also think using rebases rather than merge commits is sometimes preferred, so we may consider trying that out in the near-term and disabling the "standard merge" option if we like it long-term. |
Resolves #2565