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

casting to a constant size #865

Closed
veripoolbot opened this issue Dec 23, 2014 · 4 comments
Closed

casting to a constant size #865

veripoolbot opened this issue Dec 23, 2014 · 4 comments
Assignees
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800

Comments

@veripoolbot
Copy link
Contributor


Author Name: Iztok Jeras (@jeras)
Original Redmine Issue: 865 from https://www.veripool.org
Original Date: 2014-12-23
Original Assignee: Wilson Snyder (@wsnyder)


Some casting operations return an error. The SV standard contains the next definition:

If the casting type is a constant expression with a positive integral value, the expression in parentheses shall
be padded or truncated to the size specified. It shall be an error if the size specified is zero or negative.
Examples:

17'(x - 2)
parameter P = 16;
(P+1)'(x – 2)

The next example would not work in ModelSim, unless the parameter was inside parentheres ():

parameter P = 16;
P'(x – 2)

Regards,
Iztok Jeras

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-12-23T14:50:01Z


Could you submit a test_regress format test that passes on other simulations with some cases of interest? Thanks.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Iztok Jeras (@jeras)
Original Date: 2014-12-23T18:45:49Z


I attached an updated "test_regress/t/t_cast.v", but I was not able to test it, since I do not have access to a reference simulator, except for ModelSim (Altera edition) which is not supported by the Perl script.

Regards,
Iztok Jeras

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2014-12-24T03:15:44Z


Fixed in git towards 3.869.

Thanks for the test. Note this only adds support for sizing; note generic cast-to-types is still not supported.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-02-13T01:40:26Z


In 3.870.

@veripoolbot veripoolbot added resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800 labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800
Projects
None yet
Development

No branches or pull requests

2 participants