Set VPI_MODULE_PATH in the target code, if desired.

This commit is contained in:
steve 1999-11-28 18:05:37 +00:00
parent 48b6726cf4
commit fa088f8baa
4 changed files with 31 additions and 7 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: t-vvm.cc,v 1.82 1999/11/28 01:16:19 steve Exp $"
#ident "$Id: t-vvm.cc,v 1.83 1999/11/28 18:05:37 steve Exp $"
#endif
# include <iostream>
@ -696,6 +696,10 @@ void target_vvm::end_design(ostream&os, const Design*mod)
os << "main()" << endl << "{" << endl;
string vpi_module_path = mod->get_flag("VPI_MODULE_PATH");
if (vpi_module_path.length() > 0)
os << " vvm_set_module_path(\"" << vpi_module_path <<
"\");" << endl;
os << " vvm_load_vpi_module(\"system.vpi\");" << endl;
os << " vvm_simulation sim;" << endl;
os << " design_init(sim);" << endl;
@ -1975,6 +1979,9 @@ extern const struct target tgt_vvm = {
};
/*
* $Log: t-vvm.cc,v $
* Revision 1.83 1999/11/28 18:05:37 steve
* Set VPI_MODULE_PATH in the target code, if desired.
*
* Revision 1.82 1999/11/28 01:16:19 steve
* gate outputs need to set signal values.
*

View File

@ -40,10 +40,10 @@ functors=""
flags=""
# If VPI module path aren't set up, warn at least
if test -z "${VPI_MODULE_PATH}" ; then
echo "Missing environment variable VPI_MODULE_PATH.";
echo "To be able to execute, set VPI_MODULE_PATH to ${VPIModulePath}";
fi
#if test -z "${VPI_MODULE_PATH}" ; then
# echo "Missing environment variable VPI_MODULE_PATH.";
# echo "To be able to execute, set VPI_MODULE_PATH to ${VPIModulePath}";
#fi
# Try to extract given parameters
parameter=`getopt D:I:Xxf:o:s:t: "$@"`
@ -68,6 +68,8 @@ done
# The rest is filenames
verilogFile=$@;
flags="$flags -fVPI_MODULE_PATH=${VPIModulePath}"
if test -z "${verilogFile}" ; then
echo "Missing infile";
echo "verilog [-Dmacro[=defn]] [-Iincludepath] [-X] [-x] [-o outputfilename] [-s topmodule] sourcefile[s]" ;

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vvm_calltf.cc,v 1.8 1999/10/28 00:47:25 steve Exp $"
#ident "$Id: vvm_calltf.cc,v 1.9 1999/11/28 18:05:37 steve Exp $"
#endif
# include "vvm_calltf.h"
@ -34,6 +34,13 @@
# define MAX_PATHLEN 1024
static char*module_path = 0;
void vvm_set_module_path(const char*path)
{
if (module_path) free(module_path);
module_path = strdup(path);
}
/*
* The load_vpi_module function attempts to locate and load the named
@ -57,6 +64,7 @@ void vvm_load_vpi_module(const char*name)
{
void*mod = 0;
const char*path = getenv("VPI_MODULE_PATH");
if (path == 0) path = module_path;
if ((path == 0) || (strchr(name, '/'))) {
mod = dlopen(name, RTLD_NOW);
@ -108,6 +116,9 @@ void vvm_load_vpi_module(const char*name)
/*
* $Log: vvm_calltf.cc,v $
* Revision 1.9 1999/11/28 18:05:37 steve
* Set VPI_MODULE_PATH in the target code, if desired.
*
* Revision 1.8 1999/10/28 00:47:25 steve
* Rewrite vvm VPI support to make objects more
* persistent, rewrite the simulation scheduler

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vvm_calltf.h,v 1.3 1999/10/28 00:47:25 steve Exp $"
#ident "$Id: vvm_calltf.h,v 1.4 1999/11/28 18:05:37 steve Exp $"
#endif
# include "vvm.h"
@ -29,11 +29,15 @@
/*
* This function loads a vpi module by name.
*/
extern void vvm_set_module_path(const char*path);
extern void vvm_load_vpi_module(const char*path);
/*
* $Log: vvm_calltf.h,v $
* Revision 1.4 1999/11/28 18:05:37 steve
* Set VPI_MODULE_PATH in the target code, if desired.
*
* Revision 1.3 1999/10/28 00:47:25 steve
* Rewrite vvm VPI support to make objects more
* persistent, rewrite the simulation scheduler