2012-04-13 01:08:20 +00:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2009-07-07 21:51:00 +00:00
|
|
|
//*************************************************************************
|
|
|
|
//
|
2019-01-04 00:17:22 +00:00
|
|
|
// Copyright 2009-2019 by Wilson Snyder. This program is free software; you can
|
2009-07-07 21:51:00 +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: Common include for all Verilated SystemC files
|
|
|
|
///
|
2017-10-10 11:18:01 +00:00
|
|
|
/// This file is included automatically by Verilator at the top of
|
|
|
|
/// all SystemC files it generates.
|
2009-07-07 21:51:00 +00:00
|
|
|
///
|
2019-11-08 03:33:59 +00:00
|
|
|
/// Code available from: https://verilator.org
|
2009-07-07 21:51:00 +00:00
|
|
|
///
|
|
|
|
//*************************************************************************
|
2019-10-05 00:17:11 +00:00
|
|
|
|
2010-01-24 13:38:17 +00:00
|
|
|
#ifndef _VERILATED_SC_H_
|
2018-11-29 00:59:10 +00:00
|
|
|
#define _VERILATED_SC_H_ 1 ///< Header Guard
|
2009-07-07 21:51:00 +00:00
|
|
|
|
|
|
|
#include "verilatedos.h"
|
2018-10-14 17:43:24 +00:00
|
|
|
|
2009-07-07 21:51:00 +00:00
|
|
|
#include "systemc.h"
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// VL_SC_BV_DATAP
|
|
|
|
// We want to get a pointer to m_data in the sc_bv_base class,
|
|
|
|
// but it is protected. So make an exposing class, then use
|
|
|
|
// cast magic to get at it. Saves patching get_datap in SystemC.
|
2017-10-27 01:51:51 +00:00
|
|
|
// This class is thread safe (though most of SystemC is not).
|
2009-07-07 21:51:00 +00:00
|
|
|
|
|
|
|
#define VL_SC_BV_DATAP(bv) (VlScBvExposer::sp_datap(bv))
|
|
|
|
class VlScBvExposer : public sc_bv_base {
|
|
|
|
public:
|
2017-10-27 01:51:51 +00:00
|
|
|
static const vluint32_t* sp_datap(const sc_bv_base& base) VL_MT_SAFE {
|
2017-10-10 11:18:01 +00:00
|
|
|
return static_cast<const VlScBvExposer*>(&base)->sp_datatp(); }
|
2017-10-11 22:55:31 +00:00
|
|
|
const vluint32_t* sp_datatp() const { return reinterpret_cast<vluint32_t*>(m_data); }
|
2009-07-07 21:51:00 +00:00
|
|
|
// Above reads this protected element in sc_bv_base:
|
|
|
|
// sc_digit* m_data; // data array
|
|
|
|
};
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
|
2018-11-29 00:59:10 +00:00
|
|
|
#endif // Guard
|