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
|
// Accessor macros, to keep stuff concise
|
||||||
`define R_ACCESS(type_spec, name, expr) \
|
`define R_ACCESS(type_spec, name, expr) \
|
||||||
export "DPI-C" function name``_read; \
|
export "DPI-C" function name``_read; \
|
||||||
function type_spec name``_read; \
|
function bit type_spec name``_read; \
|
||||||
name``_read = (expr); \
|
name``_read = (expr); \
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
`define W_ACCESS(type_spec, name, expr) \
|
`define W_ACCESS(type_spec, name, expr) \
|
||||||
export "DPI-C" function name``_write; \
|
export "DPI-C" task name``_write; \
|
||||||
task name``_write; \
|
task name``_write; \
|
||||||
input bit type_spec in; \
|
input bit type_spec in; \
|
||||||
expr = in; \
|
expr = in; \
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
|
|
||||||
// Global is the most likely usage scenario
|
// Global is the most likely usage scenario
|
||||||
import "DPI-C" dpii_sys_task = function void \$dpii_sys (integer i);
|
import "DPI-C" dpii_sys_task = function void \$dpii_sys (int i);
|
||||||
import "DPI-C" dpii_sys_func = function int \$dpii_func (integer i);
|
import "DPI-C" dpii_sys_func = function int \$dpii_func (int i);
|
||||||
|
|
||||||
module t ();
|
module t ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,14 +63,14 @@ unsigned int main_time = false;
|
||||||
|
|
||||||
// Use cout to avoid issues with %d/%lx etc
|
// Use cout to avoid issues with %d/%lx etc
|
||||||
#define CHECK_RESULT(got, exp) \
|
#define CHECK_RESULT(got, exp) \
|
||||||
if ((got != exp)) { \
|
if ((got) != (exp)) { \
|
||||||
cout<<dec<<"%Error: "<<FILENM<<":"<<__LINE__ \
|
cout<<dec<<"%Error: "<<FILENM<<":"<<__LINE__ \
|
||||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<endl; \
|
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<endl; \
|
||||||
return __LINE__; \
|
return __LINE__; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_RESULT_HEX(got, exp) \
|
#define CHECK_RESULT_HEX(got, exp) \
|
||||||
if ((got != exp)) { \
|
if ((got) != (exp)) { \
|
||||||
cout<<dec<<"%Error: "<<FILENM<<":"<<__LINE__<<hex \
|
cout<<dec<<"%Error: "<<FILENM<<":"<<__LINE__<<hex \
|
||||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<endl; \
|
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<endl; \
|
||||||
return __LINE__; \
|
return __LINE__; \
|
||||||
|
|
|
||||||
|
|
@ -51,14 +51,14 @@ unsigned int callback_count = false;
|
||||||
|
|
||||||
// Use cout to avoid issues with %d/%lx etc
|
// Use cout to avoid issues with %d/%lx etc
|
||||||
#define CHECK_RESULT(got, exp) \
|
#define CHECK_RESULT(got, exp) \
|
||||||
if ((got != exp)) { \
|
if ((got) != (exp)) { \
|
||||||
std::cout<<std::dec<<"%Error: "<<FILENM<<":"<<__LINE__ \
|
std::cout<<std::dec<<"%Error: "<<FILENM<<":"<<__LINE__ \
|
||||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<std::endl; \
|
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<std::endl; \
|
||||||
return __LINE__; \
|
return __LINE__; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_RESULT_HEX(got, exp) \
|
#define CHECK_RESULT_HEX(got, exp) \
|
||||||
if ((got != exp)) { \
|
if ((got) != (exp)) { \
|
||||||
std::cout<<std::dec<<"%Error: "<<FILENM<<":"<<__LINE__<<std::hex \
|
std::cout<<std::dec<<"%Error: "<<FILENM<<":"<<__LINE__<<std::hex \
|
||||||
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<std::endl; \
|
<<": GOT = "<<(got)<<" EXP = "<<(exp)<<std::endl; \
|
||||||
return __LINE__; \
|
return __LINE__; \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue