I have the following scenario : I have a vpi callback that is triggered when an assertion is triggered. In this callback I want to call an export system verilog function I tried to setSvScope before the export but simulator gives me some errors.
Is it possible to call export function in VPI callback
1k views Asked by Viktorinox At
2
There are 2 answers
1
Serge
On
Usually when vpi invokes a callback function, there is no DPI contents available at this time. So, you need to look it up before calling the exported dpi:
svScope scope = svGetScopeFromName("path.to.your.export.scope");
svSetScope(scope);
where the scope is the one which exports the function. For the exports from the global scope the $unit could be used for the scope name.
Related Questions in SYSTEM-VERILOG
- Matrix Multiplication Testbench Yields Inconsistent Results
- How to connect combo code to a module's interface modport?
- Send transactions using test cases to random channels
- systemverilog assertion become vacuous match when it has if...else statement
- How can I write this SystemVerilog property without the use of a local variable?
- always block not always triggering at event
- How to write into 12 addresses at the same cycle in vivado and still be recognized as BRAM
- Continuous Assignment of Class Property
- No .vcd file found error, but I have used the $dump code
- Verifying all address locations of memory
- Logical Error in Verilog code for converting SR FF to JK FF
- system-verilog - cross cover between generate-loop instances
- Gate-Level Sim: Hold time violation between testbench and first registers?
- Multiple instances of covergroup based on parameter
- Illegal hierarchical reference through a let construct
Related Questions in SYSTEM-VERILOG-ASSERTIONS
- How can I write this SystemVerilog property without the use of a local variable?
- SVA for verifying that two signals are equivalent after some delays
- Evaluation at posedge of SVA assertions
- SVA assertion compile syntax errors
- Assertion to check array contents for duplicate values
- 64 Bit Complex Multiplier
- Signal Must Assert While Other Signal Is Asserted
- Why the assertion happens but its pass count is zero in the coverage result?
- How do I disable assertions when signals are unknown?
- Parameter within module name
- Turning off assertion fail comments
- SystemVerilog assertion scheduling
- SystemVerilog assertion semantics & when to stop simulation
- Assertion writing without clock for async reset
- use System Verilog $past in clocking gate
Related Questions in SYSTEM-VERILOG-DPI
- (SV DPI-C/C)How to manipulate an svOpenArrayHandle in C?
- regexp in hdl path for UVM hdl access functions
- how to convert reg in SV to equivalent in C (DPI)
- Is there DPI-C compatible types for <stdint.h> types?
- In DPI-C, How to map data type to reg or wire
- is there any API to convert "svLogicVecVal *" to "uint_8"?
- System verilog simulation performance for uvm_hdl_read vs assign statement
- Unpacking system verilog packed struct in DPI-C call
- Get port name in SystemVerilog
- how to print from c side with Verilog or SystemVerilog
- How can I copy data from C/C++ array to the entire SV array using SV-DPI?
- DPI-C export of a task defined inside a SystemVerilog class
- How to connect 2 ports(input) to same wire in verilog
- DPI-C and SystemVerilog External Compilation flow issue
- System Verilog DPI Checker masking 128-bit value
Related Questions in VPI
- Is it possible to iterate systemverilog associative array with non-int index type through VPI c function?
- How to read memory value at a specific location using VPI and verilator?
- What API to use for a Verilator test harness?
- Time unit for VPI call back on signal value change
- Reading array of regs using Verilator and VPI
- In Verilog Procedural Interface, is it possible to scan through iteration loop several times?
- How to add a new key to a Systemverilog associative array using VPI
- How to check if a Systemverilog associative array has a key using VPI
- Obtaining signal names in the design (using VPI calls)
- Allocated structure for value_p to be used with VPI vpi_put_value()
- How to get dimensions of a verilog vector port using PLI routines?
- Active direction of inout port during simulation using PLI
- Is it possible to call export function in VPI callback
- SystemVerilog VPI release a callback handle after a vpiForceFlag
- SystemVerilog looping through hierarchy
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Calling an DPI exported routine from a routine that has not been DPI imported is left undefined by the 1800-2012 LRM (See section 35.5.3 Context tasks and functions)
The exported DPI routine when called needs two key pieces of information to behave like any other routine that would have been called by SystemVerilog instead of C. It needs a scope context and a process context.
For the scope, it’s possible to have multiple DPI exports with the same name. In fact, it is possible to have a DPI import/export pair in a module, and that module gets instantiated multiple times. Even though the import calls the same C code, its context gets set from the caller’s scope and that scope gets matched with the exported scope. The DPI provides a
svSetScoperoutine to do this explicitly if the implicit DPI imported routine does not.For the process, there are many things you can do like
disable, or suspend it. The DPI provides no mechanism to set this explicitly.Some tools(like Questa) do provide a mechanism to do this for a limited set of use cases. For example, you can only call a DPI exported
functionfrom non-DPI imported C/C++ code. A task cannot be called because it has the potential to block, and that interferes with any process context.