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

Clarification needed on scope specification with DPI #452

Closed
veripoolbot opened this issue Mar 8, 2012 · 1 comment
Closed

Clarification needed on scope specification with DPI #452

veripoolbot opened this issue Mar 8, 2012 · 1 comment
Labels
area: documentation Issue involves documentation resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 452 from https://www.veripool.org
Original Date: 2012-03-08
Original Assignee: Jeremy Bennett (@jeremybennett)


When working with DPI exported tasks and functions, I spent some time trying to resolve run-time errors such as:

%Error: unknown:0: Testbench C called 'a_read' but scope wasn't set, perhaps due to dpi import call without 'context'
%Warning: vlt/t_dpi_accessors: Exec of obj_dir/t_dpi_accessors/Vt_dpi_accessors failed

I realized that it is necessary to set the scope, so that the task can resolve names referenced within the task. For example, after instantiating the model, but before calling any task or function calling:

    svSetScope (svGetScopeFromName ("dut.v"));

There are other ways of doing this, particularly when using DPI imported functions, which can be used to get the scope. But in this case I was using purely exported functions and tasks.

For the non-SystemVerilog expert this is not immediately obvious, so I propose some additional text for the user manual DPI section. I am not an expert in this area, so please modify as appropriate.

Attached as git diff against current HEAD (commit a8432ed).

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-03-08T23:37:20Z


Good point, pushed to git.

@veripoolbot veripoolbot added area: documentation Issue involves documentation resolution: fixed Closed; fixed labels Dec 22, 2019
kbieganski added a commit to antmicro/verilator that referenced this issue Dec 13, 2021
tgorochowik pushed a commit to antmicro/verilator that referenced this issue Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation Issue involves documentation resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

1 participant