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

Verilog::Perl 3.305 doesn't populate the data_type field in a var callback #361

Closed
veripoolbot opened this issue Jun 30, 2011 · 6 comments
Closed
Assignees

Comments

@veripoolbot
Copy link
Collaborator

@veripoolbot veripoolbot commented Jun 30, 2011


Author Name: Jon Nall
Original Redmine Issue: 361 from https://www.veripool.org
Original Date: 2011-06-30
Original Assignee: Wilson Snyder (@wsnyder)


I'm using Verilog::Perl 3.305. When using the var callback, I don't get a value for the $data_type argument when the var being instantiated is a covergroup.

=item $self->var ( $kwd, $name, $objof, $nettype, $data_type, $array, $value )

I was curious if it's possible to get that argument populated with the name of the cover group.

After an email from Wilson he mentioned cover groups are more like structs than normal variables. In this case, I wouldn't mind the $data_type field to be populated with "covergroup" (similar to how struct works).

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Jul 1, 2011


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-07-01T01:46:49Z


I think I might have misunderstood the original question. Are you looking for the members of the covergroup, or the variable that instantiates the covergroup (with new())? Neither are presently supported.

My original reading was the members, but now think you want the latter? If so, that's a resolution problem which the parser doesn't deal with; it's currently up to the application to know what's behind a data type (covergroups being just a data type.)

I realized though that there wasn't a way to know what data types were declared as covergroups, so I added a covergroup and endgroup callback. So, you can build a hash with the covergroup callback, and check it on each var.

There's also an internal symbol table that 'sort of' knows it's a covergroup, but that's not presently exposed for some ugly reasons.

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Jul 1, 2011


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-07-01T01:47:51Z


BTW covergroup/endgroup now in git towards 3.308.

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Jul 1, 2011


Original Redmine Comment
Author Name: Jon Nall
Original Date: 2011-07-01T02:12:43Z


Thanks for this quick response.

I should have written a reproducer from the start, but was just busy today -- my apologies. Consider the verilog below. These are the args to the var callbacks I see when it gets parsed.

Note the coverGroupInst has no data_type value at all. It would be useful if it could be 'covergroup' (similar to 'struct').

[K: var][N: myReg][O: module][N: ][D: reg][A: ]
[K: var][N: fooA][O: class][N: ][D: reg][A: ]
[K: member][N: structA][O: struct][N: ][D: reg][A: ]
[K: typedef][N: myStruct][O: module][N: ][D: struct][A: ]
[K: var][N: myEvent][O: module][N: ][D: event][A: ]
[K: var][N: fooInst][O: module][N: ][D: myFoo][A: ]
[K: var][N: structInst][O: module][N: ][D: myStruct][A: ]
[K: var][N: coverGroupInst][O: module][N: ][D: ][A: ]

 module gc;

     reg myReg;

     class myFoo;
         reg fooA;
     endclass

     typedef struct
     {
         reg structA;
     } myStruct;

     event myEvent;

     covergroup  myCoverGroup @(myEvent);

     myCoverPoint: coverpoint myReg
     {
         bins A = {1'b0};
         bins B = {1'b1};
     }

     endgroup // myCoverGroup

     myFoo fooInst = new;
     myStruct structInst;
     myCoverGroup coverGroupInst = new;

endmodule

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Jul 1, 2011


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-07-01T02:32:18Z


Ahh, having a empty data_type is just a typo. Fixed in git towards 3.308.

The var callback will now return "myCoverGroup" - if you want to know that's a covergroup, an application could use the new callback to remember the declaration names, and look it up on the var callback.

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Jul 1, 2011


Original Redmine Comment
Author Name: Jon Nall
Original Date: 2011-07-01T02:34:11Z


Perfect, thanks!

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Jul 22, 2011


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2011-07-22T23:46:02Z


In 3.310

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.