2013-08-15 01:37:13 +00:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
|
|
|
//*************************************************************************
|
|
|
|
//
|
|
|
|
// Copyright 2009-2009 by Wilson Snyder. This program is free software; you can
|
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
2020-03-21 15:24:24 +00:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
2013-08-15 01:37:13 +00:00
|
|
|
// Version 2.0.
|
2020-03-21 15:24:24 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2013-08-15 01:37:13 +00:00
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
|
|
|
|
#include <cstdio>
|
2013-10-14 00:05:57 +00:00
|
|
|
#include <cstring>
|
2013-08-15 01:37:13 +00:00
|
|
|
#include "svdpi.h"
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
|
|
|
|
#if defined(VERILATOR)
|
|
|
|
# include "Vt_dpi_string__Dpi.h"
|
|
|
|
#elif defined(VCS)
|
|
|
|
# include "../vc_hdrs.h"
|
|
|
|
#elif defined(CADENCE)
|
|
|
|
# define NEED_EXTERNS
|
|
|
|
#else
|
|
|
|
# error "Unknown simulator for DPI test"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NEED_EXTERNS
|
|
|
|
extern "C" {
|
|
|
|
|
2020-10-28 00:03:17 +00:00
|
|
|
extern int dpii_string(const char* s);
|
2013-08-15 01:37:13 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
|
|
|
|
int dpii_string(const char* s) {
|
2020-10-28 00:03:17 +00:00
|
|
|
printf("dpii_string: %s\n", s);
|
2013-08-15 01:37:13 +00:00
|
|
|
return strlen(s);
|
|
|
|
}
|