2012-04-13 03:08:20 +02:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2010-12-25 20:39:41 +01:00
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2020-01-07 00:05:53 +01:00
|
|
|
// Copyright 2009-2020 by Wilson Snyder. This program is free software; you can
|
2010-12-25 20:39:41 +01:00
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
2020-03-21 16:24:24 +01:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
2010-12-25 20:39:41 +01:00
|
|
|
// Version 2.0.
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2010-12-25 20:39:41 +01:00
|
|
|
//
|
|
|
|
|
//=========================================================================
|
|
|
|
|
///
|
|
|
|
|
/// \file
|
|
|
|
|
/// \brief Verilator: VPI implementation code
|
|
|
|
|
///
|
2017-10-20 03:33:22 +02: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 20:39:41 +01:00
|
|
|
///
|
2019-11-08 04:33:59 +01:00
|
|
|
/// Code available from: https://verilator.org
|
2010-12-25 20:39:41 +01:00
|
|
|
///
|
|
|
|
|
//=========================================================================
|
2019-10-05 02:17:11 +02:00
|
|
|
|
2015-09-26 04:57:28 +02:00
|
|
|
#ifndef _VERILATED_VPI_H_
|
2018-11-29 01:59:10 +01:00
|
|
|
#define _VERILATED_VPI_H_ 1 ///< Header Guard
|
2010-12-25 20:39:41 +01:00
|
|
|
|
2018-10-14 19:43:24 +02:00
|
|
|
#include "verilatedos.h"
|
2010-12-25 20:39:41 +01:00
|
|
|
#include "verilated.h"
|
|
|
|
|
#include "verilated_syms.h"
|
|
|
|
|
|
|
|
|
|
//======================================================================
|
|
|
|
|
// From IEEE 1800-2009 annex K
|
|
|
|
|
|
|
|
|
|
#include "vltstd/vpi_user.h"
|
|
|
|
|
|
2015-09-26 04:57:28 +02:00
|
|
|
//======================================================================
|
2013-01-18 03:40:37 +01:00
|
|
|
|
2010-12-25 20:39:41 +01:00
|
|
|
class VerilatedVpi {
|
|
|
|
|
public:
|
2017-10-20 03:33:22 +02:00
|
|
|
/// Call timed callbacks
|
|
|
|
|
/// Users should call this from their main loops
|
2017-10-27 03:51:51 +02:00
|
|
|
static void callTimedCbs() VL_MT_UNSAFE_ONE;
|
2017-10-20 03:33:22 +02:00
|
|
|
/// Call value based callbacks
|
|
|
|
|
/// Users should call this from their main loops
|
2017-10-27 03:51:51 +02:00
|
|
|
static void callValueCbs() VL_MT_UNSAFE_ONE;
|
2019-09-21 13:43:20 +02:00
|
|
|
/// Call callbacks of arbitrary types
|
|
|
|
|
/// Users can call this from their application code
|
|
|
|
|
static bool callCbs(vluint32_t reason) VL_MT_UNSAFE_ONE;
|
2017-10-20 03:33:22 +02:00
|
|
|
/// Self test, for internal use only
|
2017-10-27 03:51:51 +02:00
|
|
|
static void selfTest() VL_MT_UNSAFE_ONE;
|
2010-12-25 20:39:41 +01:00
|
|
|
};
|
|
|
|
|
|
2018-11-29 01:59:10 +01:00
|
|
|
#endif // Guard
|