mirror of
https://github.com/verilator/verilator.git
synced 2025-01-21 05:44:03 +00:00
Tests: Fix illegal dpi return types, and other cleanups
This commit is contained in:
parent
345657ab32
commit
08da777b33
@ -11,12 +11,12 @@
|
||||
// Accessor macros, to keep stuff concise
|
||||
`define R_ACCESS(type_spec, name, expr) \
|
||||
export "DPI-C" function name``_read; \
|
||||
function type_spec name``_read; \
|
||||
function bit type_spec name``_read; \
|
||||
name``_read = (expr); \
|
||||
endfunction
|
||||
|
||||
`define W_ACCESS(type_spec, name, expr) \
|
||||
export "DPI-C" function name``_write; \
|
||||
export "DPI-C" task name``_write; \
|
||||
task name``_write; \
|
||||
input bit type_spec in; \
|
||||
expr = in; \
|
||||
|
@ -6,8 +6,8 @@
|
||||
// Version 2.0.
|
||||
|
||||
// Global is the most likely usage scenario
|
||||
import "DPI-C" dpii_sys_task = function void \$dpii_sys (integer i);
|
||||
import "DPI-C" dpii_sys_func = function int \$dpii_func (integer i);
|
||||
import "DPI-C" dpii_sys_task = function void \$dpii_sys (int i);
|
||||
import "DPI-C" dpii_sys_func = function int \$dpii_func (int i);
|
||||
|
||||
module t ();
|
||||
|
||||
|
@ -63,14 +63,14 @@ unsigned int main_time = false;
|
||||
|
||||
// Use cout to avoid issues with %d/%lx etc
|
||||
#define CHECK_RESULT(got, exp) \
|
||||
if ((got != exp)) { \
|
||||
if ((got) != (exp)) { \
|
||||
cout<<dec<<"%Error: "<<FILENM<<":"<<__LINE__ \
|
||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<endl; \
|
||||
return __LINE__; \
|
||||
}
|
||||
|
||||
#define CHECK_RESULT_HEX(got, exp) \
|
||||
if ((got != exp)) { \
|
||||
if ((got) != (exp)) { \
|
||||
cout<<dec<<"%Error: "<<FILENM<<":"<<__LINE__<<hex \
|
||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<endl; \
|
||||
return __LINE__; \
|
||||
|
@ -51,14 +51,14 @@ unsigned int callback_count = false;
|
||||
|
||||
// Use cout to avoid issues with %d/%lx etc
|
||||
#define CHECK_RESULT(got, exp) \
|
||||
if ((got != exp)) { \
|
||||
if ((got) != (exp)) { \
|
||||
std::cout<<std::dec<<"%Error: "<<FILENM<<":"<<__LINE__ \
|
||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<std::endl; \
|
||||
return __LINE__; \
|
||||
}
|
||||
|
||||
#define CHECK_RESULT_HEX(got, exp) \
|
||||
if ((got != exp)) { \
|
||||
if ((got) != (exp)) { \
|
||||
std::cout<<std::dec<<"%Error: "<<FILENM<<":"<<__LINE__<<std::hex \
|
||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<std::endl; \
|
||||
return __LINE__; \
|
||||
|
Loading…
Reference in New Issue
Block a user