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

No way to determine constant object's type over VPI #2535

Open
ktbarrett opened this issue Nov 11, 2023 · 1 comment
Open

No way to determine constant object's type over VPI #2535

ktbarrett opened this issue Nov 11, 2023 · 1 comment

Comments

@ktbarrett
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When getting a VPI handle to a constant you are given a handle with vpi_get(vpiType, handle) = vpiConstant. There isn't currently a way to determine what the value type of the constant is. The function vpi_get(vpiConstType, handle) should help a bit, but right now it returns 0 (not a valid vpiConstType) for all types that I was able to test via cocotb. Not only that, but the range of values it can return is pretty limited; there is no way to say it's a constant std_logic_array.

Describe the solution you'd like
It would be preferable if constants were returned over the VPI as if they were regular objects, e.g. std_logic_vectors would return vpiNetArray for vpi_get(vpiType, handle). Then the property vpiConstantVariable, from the SV VPI extensions, could be supported to query whether the object is constant or not.

Describe alternatives you've considered
Implementing VHPI.

@tgingold
Copy link
Member

Do you have an example or a testcase ?

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

No branches or pull requests

2 participants