Tests: Fix illegal dpi return types, and other cleanups

This commit is contained in:
Wilson Snyder 2017-12-09 14:44:25 -05:00
parent 345657ab32
commit 08da777b33
4 changed files with 8 additions and 8 deletions

View File

@ -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; \

View File

@ -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 ();

View File

@ -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__; \

View File

@ -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__; \