2012-04-13 01:08:20 +00:00
|
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2010-12-25 19:39:41 +00:00
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2017-01-15 17:09:59 +00:00
|
|
|
|
// Copyright 2009-2017 by Wilson Snyder. This program is free software; you can
|
2010-12-25 19:39:41 +00:00
|
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
|
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License.
|
|
|
|
|
// Version 2.0.
|
|
|
|
|
//
|
|
|
|
|
// Verilator is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
//=========================================================================
|
|
|
|
|
///
|
|
|
|
|
/// \file
|
|
|
|
|
/// \brief Verilator: VPI implementation code
|
|
|
|
|
///
|
2017-10-20 01:33:22 +00:00
|
|
|
|
/// This file must be compiled and linked against all objects
|
|
|
|
|
/// created from Verilator or called by Verilator that use the VPI.
|
2010-12-25 19:39:41 +00:00
|
|
|
|
///
|
|
|
|
|
/// Code available from: http://www.veripool.org/verilator
|
|
|
|
|
///
|
|
|
|
|
//=========================================================================
|
|
|
|
|
|
2015-09-26 02:57:28 +00:00
|
|
|
|
#ifndef _VERILATED_VPI_H_
|
|
|
|
|
#define _VERILATED_VPI_H_ 1 ///< Header Guard
|
2010-12-25 19:39:41 +00:00
|
|
|
|
|
|
|
|
|
#include "verilated.h"
|
|
|
|
|
#include "verilated_syms.h"
|
|
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
|
// From IEEE 1800-2009 annex K
|
|
|
|
|
|
|
|
|
|
#include "vltstd/vpi_user.h"
|
|
|
|
|
|
2015-09-26 02:57:28 +00:00
|
|
|
|
//======================================================================
|
2013-01-18 02:40:37 +00:00
|
|
|
|
|
2010-12-25 19:39:41 +00:00
|
|
|
|
class VerilatedVpi {
|
|
|
|
|
public:
|
2017-10-20 01:33:22 +00:00
|
|
|
|
/// Call timed callbacks
|
|
|
|
|
/// Users should call this from their main loops
|
|
|
|
|
static void callTimedCbs();
|
|
|
|
|
/// Call value based callbacks
|
|
|
|
|
/// Users should call this from their main loops
|
|
|
|
|
static void callValueCbs();
|
|
|
|
|
/// Self test, for internal use only
|
2015-09-26 02:57:28 +00:00
|
|
|
|
static void selfTest();
|
2010-12-25 19:39:41 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // Guard
|