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

Support enums #173

Closed
veripoolbot opened this issue Nov 3, 2009 · 5 comments
Closed

Support enums #173

veripoolbot opened this issue Nov 3, 2009 · 5 comments

Comments

@veripoolbot
Copy link
Contributor

@veripoolbot veripoolbot commented Nov 3, 2009


Author Name: Wilson Snyder (@wsnyder)
Original Redmine Issue: 173 from https://www.veripool.org
Original Date: 2009-11-03
Original Assignee: Wilson Snyder (@wsnyder)


Add support for enums

@veripoolbot
Copy link
Contributor Author

@veripoolbot veripoolbot commented Nov 3, 2009


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-11-03T20:16:51Z


Some notes on writing tests:

Look at "writing a test" section in the verilator manual and at the enum requirements in IEEE spec. If you look at the existing test_regress/t directory you'll also get some ideas. Some things to focus on are testing that the size and datatype get assigned, make sure initial values (= foo) get set right and then number after those, and negative tests like width violations, assigning too many elements (see IEEE spec) and assigning the wrong types to each other. See the _bad tests for how to do negative tests; though the error message will need to be a placeholder.

@veripoolbot
Copy link
Contributor Author

@veripoolbot veripoolbot commented Nov 3, 2009


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-11-03T20:17:41Z


BTW some experiments I did a few months ago suggested the [m:n] format to assign a range of enum values isn't supported by most tools, so I'll probably punt on that for now.

@veripoolbot
Copy link
Contributor Author

@veripoolbot veripoolbot commented Nov 4, 2009


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-11-04T11:28:40Z


After tests the next step is adding grammar - see internals.txt in the kit - you'll want to grab from VParseBison.

For the Ast tree, add AstEnumDType:AstNodeDType which would have a name(), dtypep() (ala AstArrayDType) child and list of AstEnumValues:AstNodeUniop(maybe). The values need a name and lhsp() value expression.

@veripoolbot
Copy link
Contributor Author

@veripoolbot veripoolbot commented Dec 27, 2009


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-12-27T13:33:45Z


Committed to git for next release. Much credit to Donal Casey who wrote the front end and tests.

@veripoolbot
Copy link
Contributor Author

@veripoolbot veripoolbot commented Feb 7, 2010


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2010-02-07T12:40:57Z


In 3.800.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.