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

$bits of type does not work #327

Closed
veripoolbot opened this issue Feb 23, 2011 · 3 comments
Closed

$bits of type does not work #327

veripoolbot opened this issue Feb 23, 2011 · 3 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: Alex Solomatnikov
Original Redmine Issue: 327 from https://www.veripool.org
Original Date: 2011-02-23
Original Assignee: Wilson Snyder (@wsnyder)


The following code:

typedef enum [3:0] { NOP = 0 } req_t;

module arbiter
(
output wire valid_out,
output req_t type_out,
input wire valid_in,
input req_t type_in
);

wire [$bits(req_t):0] internal_type = { 1'b0, type_in };

endmodule // arbiter

results in error:

verilator --cc typedef_bug.v
%Error: typedef_bug.v:11: syntax error, unexpected TYPE-IDENTIFIER
%Error: Exiting due to 1 warning(s)
%Error: Command Failed verilator_bin --cc typedef_bug.v

This is supposed to work according to SystemVerilog 3.1a LRM which has the following example:

typedef struct {
logic valid;
bit [8:1] data;
} MyType;

typedef bit[$bits(MyType):1] MyBits;
MyBits b;

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-02-24T00:04:33Z


That's a easy one line repair.

Fixed in git for 3.812+.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Alex Solomatnikov
Original Date: 2011-02-24T02:27:18Z


It works.

Thanks for a quick fix!

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-04-06T11:40:41Z


In 3.812.

@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