clang-format of test_regress. No functional change.
This commit is contained in:
parent
f670eccf8c
commit
0c328b6eaf
|
|
@ -462,11 +462,12 @@ analyzer-include:
|
||||||
|
|
||||||
CLANGFORMAT = clang-format
|
CLANGFORMAT = clang-format
|
||||||
CLANGFORMAT_FLAGS = -i
|
CLANGFORMAT_FLAGS = -i
|
||||||
|
CLANGFORMAT_FILES = $(CPPCHECK_CPP) $(CPPCHECK_H) $(CPPCHECK_YL) test_regress/t/*.c*
|
||||||
|
|
||||||
clang-format:
|
clang-format:
|
||||||
@$(CLANGFORMAT) --version | egrep 10.0 > /dev/null \
|
@$(CLANGFORMAT) --version | egrep 10.0 > /dev/null \
|
||||||
|| echo "*** You are not using clang-format 10.0, indents may differ from master's ***"
|
|| echo "*** You are not using clang-format 10.0, indents may differ from master's ***"
|
||||||
$(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CPPCHECK_CPP) $(CPPCHECK_H) $(CPPCHECK_YL)
|
$(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES)
|
||||||
|
|
||||||
ftp: info
|
ftp: info
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(NCSC)
|
#if defined(NCSC)
|
||||||
// Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields,
|
// Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields,
|
||||||
// rather than the IEEE 1800-2005 version which has _.a and _.b fields.
|
// rather than the IEEE 1800-2005 version which has _.a and _.b fields.
|
||||||
|
|
@ -46,6 +47,7 @@ typedef uint64_t sv_longint_unsigned_t;
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// Implementations of imported functions
|
// Implementations of imported functions
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(NCSC)
|
#if defined(NCSC)
|
||||||
// Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields,
|
// Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields,
|
||||||
// rather than the IEEE 1800-2005 version which has _.a and _.b fields.
|
// rather than the IEEE 1800-2005 version which has _.a and _.b fields.
|
||||||
|
|
@ -51,6 +52,7 @@ typedef uint64_t sv_longint_unsigned_t;
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// Implementations of imported functions
|
// Implementations of imported functions
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(NCSC)
|
#if defined(NCSC)
|
||||||
// Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields,
|
// Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields,
|
||||||
// rather than the IEEE 1800-2005 version which has _.a and _.b fields.
|
// rather than the IEEE 1800-2005 version which has _.a and _.b fields.
|
||||||
|
|
@ -46,6 +47,7 @@ typedef uint64_t sv_longint_unsigned_t;
|
||||||
# else
|
# else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// Implementations of imported functions
|
// Implementations of imported functions
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# ifdef T_DPI_CONTEXT_NOOPT
|
# ifdef T_DPI_CONTEXT_NOOPT
|
||||||
# include "Vt_dpi_context_noopt__Dpi.h"
|
# include "Vt_dpi_context_noopt__Dpi.h"
|
||||||
|
|
@ -31,6 +32,7 @@
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
# include "verilated.h"
|
# include "verilated.h"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -126,7 +128,7 @@ int dpic_restore() {
|
||||||
|
|
||||||
unsigned dpic_getcontext() {
|
unsigned dpic_getcontext() {
|
||||||
svScope scope = svGetScope();
|
svScope scope = svGetScope();
|
||||||
printf("%%Info: svGetScope returned scope (%p) with name %s\n",
|
printf("%%Info: svGetScope returned scope (%p) with name %s\n", //
|
||||||
scope, svGetNameFromScope(scope));
|
scope, svGetNameFromScope(scope));
|
||||||
return (unsigned)(uintptr_t)scope;
|
return (unsigned)(uintptr_t)scope;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_display__Dpi.h"
|
# include "Vt_dpi_display__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -23,6 +24,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -31,12 +33,12 @@ extern void dpii_display_call(const char* c);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifndef VL_PRINTF
|
#ifndef VL_PRINTF
|
||||||
# define VL_PRINTF printf
|
# define VL_PRINTF printf
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
void dpii_display_call(const char* c) {
|
void dpii_display_call(const char* c) { VL_PRINTF("dpii_display_call: '%s'\n", c); }
|
||||||
VL_PRINTF("dpii_display_call: '%s'\n", c);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "svdpi.h"
|
#include "svdpi.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define T_PRI64 "I64"
|
# define T_PRI64 "I64"
|
||||||
#else // Linux or compliant Unix flavors
|
#else // Linux or compliant Unix flavors
|
||||||
|
|
@ -34,6 +35,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
|
|
||||||
|
|
@ -67,6 +69,7 @@ extern void dpix_t_time(const svLogicVecVal* i, svLogicVecVal* o);
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#define CHECK_RESULT(type, got, exp) \
|
#define CHECK_RESULT(type, got, exp) \
|
||||||
if ((got) != (exp)) { \
|
if ((got) != (exp)) { \
|
||||||
printf("%%Error: %s:%d:", __FILE__, __LINE__); \
|
printf("%%Error: %s:%d:", __FILE__, __LINE__); \
|
||||||
|
|
@ -77,6 +80,7 @@ extern void dpix_t_time(const svLogicVecVal* i, svLogicVecVal* o);
|
||||||
printf(" EXP = %" T_PRI64 "x\n", u.l); \
|
printf(" EXP = %" T_PRI64 "x\n", u.l); \
|
||||||
return __LINE__; \
|
return __LINE__; \
|
||||||
}
|
}
|
||||||
|
// clang-format on
|
||||||
#define CHECK_RESULT_NNULL(got) \
|
#define CHECK_RESULT_NNULL(got) \
|
||||||
if (!(got)) { \
|
if (!(got)) { \
|
||||||
printf("%%Error: %s:%d: GOT = %p EXP = !NULL\n", __FILE__, __LINE__, (got)); \
|
printf("%%Error: %s:%d: GOT = %p EXP = !NULL\n", __FILE__, __LINE__, (got)); \
|
||||||
|
|
@ -183,7 +187,9 @@ int dpix_run_tests() {
|
||||||
CHECK_RESULT(svLogic, o, 0);
|
CHECK_RESULT(svLogic, o, 0);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
svLogicVecVal i[1]; i[0].aval = 0x12; i[0].bval = 0;
|
svLogicVecVal i[1];
|
||||||
|
i[0].aval = 0x12;
|
||||||
|
i[0].bval = 0;
|
||||||
svLogicVecVal o[1];
|
svLogicVecVal o[1];
|
||||||
dpix_t_reg15(i, o);
|
dpix_t_reg15(i, o);
|
||||||
CHECK_RESULT(int, o[0].aval, (~i[0].aval) & 0x7fff);
|
CHECK_RESULT(int, o[0].aval, (~i[0].aval) & 0x7fff);
|
||||||
|
|
@ -191,9 +197,12 @@ int dpix_run_tests() {
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
svLogicVecVal i[3];
|
svLogicVecVal i[3];
|
||||||
i[0].aval = 0x72912312; i[0].bval = 0;
|
i[0].aval = 0x72912312;
|
||||||
i[1].aval = 0xab782a12; i[1].bval = 0;
|
i[0].bval = 0;
|
||||||
i[2].aval = 0x8a413bd9; i[2].bval = 0;
|
i[1].aval = 0xab782a12;
|
||||||
|
i[1].bval = 0;
|
||||||
|
i[2].aval = 0x8a413bd9;
|
||||||
|
i[2].bval = 0;
|
||||||
svLogicVecVal o[3];
|
svLogicVecVal o[3];
|
||||||
dpix_t_reg95(i, o);
|
dpix_t_reg95(i, o);
|
||||||
CHECK_RESULT(int, o[0].aval, ~i[0].aval);
|
CHECK_RESULT(int, o[0].aval, ~i[0].aval);
|
||||||
|
|
@ -206,8 +215,10 @@ int dpix_run_tests() {
|
||||||
#if !defined(VCS) && !defined(CADENCE)
|
#if !defined(VCS) && !defined(CADENCE)
|
||||||
{
|
{
|
||||||
svLogicVecVal i[2];
|
svLogicVecVal i[2];
|
||||||
i[0].aval = 0x72912312; i[0].bval = 0;
|
i[0].aval = 0x72912312;
|
||||||
i[1].aval = 0xab782a12; i[1].bval = 0;
|
i[0].bval = 0;
|
||||||
|
i[1].aval = 0xab782a12;
|
||||||
|
i[1].bval = 0;
|
||||||
svLogicVecVal o[2];
|
svLogicVecVal o[2];
|
||||||
dpix_t_time(i, o);
|
dpix_t_time(i, o);
|
||||||
CHECK_RESULT(int, o[0].aval, ~i[0].aval);
|
CHECK_RESULT(int, o[0].aval, ~i[0].aval);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_export_context_bad__Dpi.h"
|
# include "Vt_dpi_export_context_bad__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -20,6 +21,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_imp_gen__Dpi.h"
|
# include "Vt_dpi_imp_gen__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -24,6 +25,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_import__Dpi.h"
|
# include "Vt_dpi_import__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -24,6 +25,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int a;
|
int a;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_lib__Dpi.h"
|
# include "Vt_dpi_lib__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -25,6 +26,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_open__Dpi.h"
|
# include "Vt_dpi_open__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -27,6 +28,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
@ -90,11 +92,13 @@ extern int dpii_failure();
|
||||||
int failure = 0;
|
int failure = 0;
|
||||||
int dpii_failure() { return failure; }
|
int dpii_failure() { return failure; }
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define T_PRI64 "I64"
|
# define T_PRI64 "I64"
|
||||||
#else // Linux or compliant Unix flavors
|
#else // Linux or compliant Unix flavors
|
||||||
# define T_PRI64 "ll"
|
# define T_PRI64 "ll"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#define CHECK_RESULT_HEX(got, exp) \
|
#define CHECK_RESULT_HEX(got, exp) \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,9 @@
|
||||||
//
|
//
|
||||||
//*************************************************************************
|
//*************************************************************************
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
#include "svdpi.h"
|
#include "svdpi.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR) // Verilator
|
#if defined(VERILATOR) // Verilator
|
||||||
# include "Vt_dpi_open_query__Dpi.h"
|
# include "Vt_dpi_open_query__Dpi.h"
|
||||||
#elif defined(VCS) // VCS
|
#elif defined(VCS) // VCS
|
||||||
|
|
@ -24,7 +23,6 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_openfirst__Dpi.h"
|
# include "Vt_dpi_openfirst__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -25,6 +26,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
void poke_value(int i) {
|
void poke_value(int i) {
|
||||||
printf("poke_value(%d)\n", i);
|
printf("poke_value(%d)\n", i);
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
static int didDump = 0;
|
static int didDump = 0;
|
||||||
if (didDump++ == 0) {
|
if (didDump++ == 0) {
|
||||||
|
|
@ -31,6 +32,7 @@ void poke_value(int i) {
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
svScope scope = svGetScopeFromName("top.t.a");
|
svScope scope = svGetScopeFromName("top.t.a");
|
||||||
if (scope == NULL) {
|
if (scope == NULL) {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "svdpi.h"
|
#include "svdpi.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR) // Verilator
|
#if defined(VERILATOR) // Verilator
|
||||||
# include "Vt_dpi_result_type__Dpi.h"
|
# include "Vt_dpi_result_type__Dpi.h"
|
||||||
typedef long long sv_longint_t;
|
typedef long long sv_longint_t;
|
||||||
|
|
@ -41,6 +42,7 @@ typedef uint64_t sv_longint_unsigned_t;
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// Implementations of imported functions
|
// Implementations of imported functions
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# if defined(T_DPI_SHORTCIRCUIT)
|
# if defined(T_DPI_SHORTCIRCUIT)
|
||||||
# include "Vt_dpi_shortcircuit__Dpi.h"
|
# include "Vt_dpi_shortcircuit__Dpi.h"
|
||||||
|
|
@ -30,6 +31,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_string__Dpi.h"
|
# include "Vt_dpi_string__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -24,6 +25,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_sys__Dpi.h"
|
# include "Vt_dpi_sys__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -23,6 +24,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# ifdef T_DPI_THREADS_COLLIDE
|
# ifdef T_DPI_THREADS_COLLIDE
|
||||||
# include "Vt_dpi_threads_collide__Dpi.h"
|
# include "Vt_dpi_threads_collide__Dpi.h"
|
||||||
|
|
@ -30,6 +31,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_dpi_vams__Dpi.h"
|
# include "Vt_dpi_vams__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -20,6 +21,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
||||||
|
|
@ -120,11 +120,13 @@ int main(int argc, char** argv, char** env) {
|
||||||
|
|
||||||
VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out
|
VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
# ifdef TEST_VERBOSE
|
# ifdef TEST_VERBOSE
|
||||||
Verilated::scopesDump();
|
Verilated::scopesDump();
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
topp->eval();
|
topp->eval();
|
||||||
topp->clk = 0;
|
topp->clk = 0;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_embed1__Dpi.h"
|
# include "Vt_embed1__Dpi.h"
|
||||||
#elif defined(VCS)
|
#elif defined(VCS)
|
||||||
|
|
@ -25,6 +26,7 @@
|
||||||
#else
|
#else
|
||||||
# error "Unknown simulator for DPI test"
|
# error "Unknown simulator for DPI test"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#include "verilated.h"
|
#include "verilated.h"
|
||||||
|
|
||||||
|
|
@ -80,14 +82,9 @@ void t_embed_child_eval() {
|
||||||
__modelp->eval();
|
__modelp->eval();
|
||||||
}
|
}
|
||||||
|
|
||||||
void t_embed_child_io_eval(unsigned char clk,
|
void t_embed_child_io_eval(unsigned char clk, unsigned char bit_in, const svBitVecVal* vec_in,
|
||||||
unsigned char bit_in,
|
const svBitVecVal* wide_in, unsigned char is_ref,
|
||||||
const svBitVecVal* vec_in,
|
unsigned char* bit_out, svBitVecVal* vec_out, svBitVecVal* wide_out,
|
||||||
const svBitVecVal* wide_in,
|
|
||||||
unsigned char is_ref,
|
|
||||||
unsigned char* bit_out,
|
|
||||||
svBitVecVal* vec_out,
|
|
||||||
svBitVecVal* wide_out,
|
|
||||||
unsigned char* did_init_out) {
|
unsigned char* did_init_out) {
|
||||||
VL_DEBUG_IF(VL_PRINTF(" t_embed1_child_io_eval\n"););
|
VL_DEBUG_IF(VL_PRINTF(" t_embed1_child_io_eval\n"););
|
||||||
Vt_embed1_child* __modelp = __get_modelp();
|
Vt_embed1_child* __modelp = __get_modelp();
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# include "Vt_flag_ldflags__Dpi.h"
|
# include "Vt_flag_ldflags__Dpi.h"
|
||||||
#else
|
#else
|
||||||
|
|
@ -28,5 +29,6 @@
|
||||||
#ifndef CFLAGS2_FROM_CMDLINE
|
#ifndef CFLAGS2_FROM_CMDLINE
|
||||||
# error "CFLAGS2_FROM_CMDLINE not set - not passed down?"
|
# error "CFLAGS2_FROM_CMDLINE not set - not passed down?"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
void dpii_c_library() {}
|
void dpii_c_library() {}
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,12 @@ long long get_memory_usage() {
|
||||||
|
|
||||||
int ps_ign;
|
int ps_ign;
|
||||||
vluint64_t ps_vsize, ps_rss;
|
vluint64_t ps_vsize, ps_rss;
|
||||||
int items = fscanf(fp, ("%d (%*[^) ]) %*1s %d %*d %*d %*d %*d %u"
|
int items = fscanf(fp,
|
||||||
|
("%d (%*[^) ]) %*1s %d %*d %*d %*d %*d %u"
|
||||||
" %u %u %u %u %d %d %d %d"
|
" %u %u %u %u %d %d %d %d"
|
||||||
" %*d %*d %*u %*u %d %" VL_PRI64 "u %" VL_PRI64 "u "),
|
" %*d %*d %*u %*u %d %" VL_PRI64 "u %" VL_PRI64 "u "),
|
||||||
&ps_ign, &ps_ign, &ps_ign,
|
&ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign,
|
||||||
&ps_ign, &ps_ign, &ps_ign, &ps_ign,
|
&ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_vsize, &ps_rss);
|
||||||
&ps_ign, &ps_ign, &ps_ign, &ps_ign,
|
|
||||||
&ps_ign, &ps_vsize, &ps_rss);
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (items >= 14) {
|
if (items >= 14) {
|
||||||
return ps_vsize;
|
return ps_vsize;
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ int main()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// loop through every possibility and check the result
|
// loop through every possibility and check the result
|
||||||
|
// clang-format off
|
||||||
#ifdef SYSTEMC_VERSION
|
#ifdef SYSTEMC_VERSION
|
||||||
sc_start(1, SC_NS);
|
sc_start(1, SC_NS);
|
||||||
# define ASSIGN(s, v) s.write(v)
|
# define ASSIGN(s, v) s.write(v)
|
||||||
|
|
@ -57,6 +58,7 @@ int main()
|
||||||
# define ASSIGN(s, v) tb->s = (v)
|
# define ASSIGN(s, v) tb->s = (v)
|
||||||
# define READ(s) tb->s
|
# define READ(s) tb->s
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
ASSIGN(i3, 13);
|
ASSIGN(i3, 13);
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,9 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
Verilated::debug(0);
|
Verilated::debug(0);
|
||||||
|
|
||||||
/* clear all bits in the array */
|
// clear all bits in the array
|
||||||
for (slot = 0; slot < 3; slot++)
|
for (slot = 0; slot < 3; slot++)
|
||||||
for (bit = 0; bit < 2; bit++)
|
for (bit = 0; bit < 2; bit++) //
|
||||||
StepSim(sim, slot, bit, 0, 0);
|
StepSim(sim, slot, bit, 0, 0);
|
||||||
|
|
||||||
printf("\nTesting\n");
|
printf("\nTesting\n");
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#if defined(VERILATOR)
|
#if defined(VERILATOR)
|
||||||
# ifdef T_PROTECT_IDS_KEY
|
# ifdef T_PROTECT_IDS_KEY
|
||||||
# include "Vt_protect_ids_key__Dpi.h"
|
# include "Vt_protect_ids_key__Dpi.h"
|
||||||
|
|
@ -32,6 +33,7 @@
|
||||||
#ifdef NEED_EXTERNS
|
#ifdef NEED_EXTERNS
|
||||||
# error "Not supported"
|
# error "Not supported"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include <verilated.h>
|
#include <verilated.h>
|
||||||
#include <verilated_vcd_c.h>
|
#include <verilated_vcd_c.h>
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#include VM_PREFIX_INCLUDE
|
#include VM_PREFIX_INCLUDE
|
||||||
#ifdef T_TRACE_PUBLIC_FUNC_VLT
|
#ifdef T_TRACE_PUBLIC_FUNC_VLT
|
||||||
# include "Vt_trace_public_func_vlt_t.h"
|
# include "Vt_trace_public_func_vlt_t.h"
|
||||||
|
|
@ -17,6 +18,7 @@
|
||||||
# include "Vt_trace_public_func_t.h"
|
# include "Vt_trace_public_func_t.h"
|
||||||
# include "Vt_trace_public_func_glbl.h"
|
# include "Vt_trace_public_func_glbl.h"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
unsigned long long main_time = 0;
|
unsigned long long main_time = 0;
|
||||||
double sc_time_stamp() { return (double)main_time; }
|
double sc_time_stamp() { return (double)main_time; }
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include <verilated.h>
|
#include <verilated.h>
|
||||||
#include <verilated_vcd_c.h>
|
#include <verilated_vcd_c.h>
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#include VM_PREFIX_INCLUDE
|
#include VM_PREFIX_INCLUDE
|
||||||
#ifdef T_TRACE_PUBLIC_SIG_VLT
|
#ifdef T_TRACE_PUBLIC_SIG_VLT
|
||||||
# include "Vt_trace_public_sig_vlt_t.h"
|
# include "Vt_trace_public_sig_vlt_t.h"
|
||||||
|
|
@ -17,6 +18,7 @@
|
||||||
# include "Vt_trace_public_sig_t.h"
|
# include "Vt_trace_public_sig_t.h"
|
||||||
# include "Vt_trace_public_sig_glbl.h"
|
# include "Vt_trace_public_sig_glbl.h"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
unsigned long long main_time = 0;
|
unsigned long long main_time = 0;
|
||||||
double sc_time_stamp() { return (double)main_time; }
|
double sc_time_stamp() { return (double)main_time; }
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#include "verilatedos.h"
|
#include "verilatedos.h"
|
||||||
#include VM_PREFIX_INCLUDE
|
#include VM_PREFIX_INCLUDE
|
||||||
#include "Vt_trace_two_b.h"
|
#include "Vt_trace_two_b.h"
|
||||||
|
|
@ -17,6 +18,7 @@
|
||||||
# include "verilated_vcd_c.h"
|
# include "verilated_vcd_c.h"
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
// Compile in place
|
// Compile in place
|
||||||
#include "Vt_trace_two_b.cpp"
|
#include "Vt_trace_two_b.cpp"
|
||||||
|
|
@ -39,6 +41,7 @@ int main(int argc, char** argv, char** env) {
|
||||||
ap = new VM_PREFIX("topa");
|
ap = new VM_PREFIX("topa");
|
||||||
bp = new Vt_trace_two_b("topb");
|
bp = new Vt_trace_two_b("topb");
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef TEST_HDR_TRACE
|
#ifdef TEST_HDR_TRACE
|
||||||
Verilated::traceEverOn(true);
|
Verilated::traceEverOn(true);
|
||||||
# ifdef TEST_FST
|
# ifdef TEST_FST
|
||||||
|
|
@ -53,6 +56,7 @@ int main(int argc, char** argv, char** env) {
|
||||||
tfp->open(VL_STRINGIFY(TEST_OBJ_DIR) "/simx.vcd");
|
tfp->open(VL_STRINGIFY(TEST_OBJ_DIR) "/simx.vcd");
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#ifdef TEST_HDR_TRACE
|
#ifdef TEST_HDR_TRACE
|
||||||
ap->eval_step();
|
ap->eval_step();
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
// Version 2.0.
|
// Version 2.0.
|
||||||
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#include "verilatedos.h"
|
#include "verilatedos.h"
|
||||||
#include VM_PREFIX_INCLUDE
|
#include VM_PREFIX_INCLUDE
|
||||||
#include "Vt_trace_two_b.h"
|
#include "Vt_trace_two_b.h"
|
||||||
|
|
@ -13,6 +14,7 @@
|
||||||
#ifdef TEST_HDR_TRACE
|
#ifdef TEST_HDR_TRACE
|
||||||
# include "verilated_vcd_sc.h"
|
# include "verilated_vcd_sc.h"
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
// Compile in place
|
// Compile in place
|
||||||
#include "Vt_trace_two_b.cpp"
|
#include "Vt_trace_two_b.cpp"
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,9 @@ static int _end_of_sim_cb(p_cb_data cb_data) {
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
void vpi_compat_bootstrap(void) {
|
void vpi_compat_bootstrap(void) {
|
||||||
|
// clang-format on
|
||||||
t_cb_data cb_data;
|
t_cb_data cb_data;
|
||||||
bzero(&cb_data, sizeof(cb_data));
|
bzero(&cb_data, sizeof(cb_data));
|
||||||
|
|
||||||
|
|
@ -197,11 +199,13 @@ int main(int argc, char** argv, char** env) {
|
||||||
|
|
||||||
VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out
|
VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
# ifdef TEST_VERBOSE
|
# ifdef TEST_VERBOSE
|
||||||
Verilated::scopesDump();
|
Verilated::scopesDump();
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#if VM_TRACE
|
#if VM_TRACE
|
||||||
Verilated::traceEverOn(true);
|
Verilated::traceEverOn(true);
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,9 @@ static int _end_of_sim_cb(p_cb_data cb_data) {
|
||||||
extern "C"
|
extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
void vpi_compat_bootstrap(void) {
|
void vpi_compat_bootstrap(void) {
|
||||||
|
// clang-format on
|
||||||
t_cb_data cb_data;
|
t_cb_data cb_data;
|
||||||
bzero(&cb_data, sizeof(cb_data));
|
bzero(&cb_data, sizeof(cb_data));
|
||||||
|
|
||||||
|
|
@ -147,11 +149,13 @@ int main(int argc, char** argv, char** env) {
|
||||||
|
|
||||||
VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out
|
VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
# ifdef TEST_VERBOSE
|
# ifdef TEST_VERBOSE
|
||||||
Verilated::scopesDump();
|
Verilated::scopesDump();
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
#if VM_TRACE
|
#if VM_TRACE
|
||||||
Verilated::traceEverOn(true);
|
Verilated::traceEverOn(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue