2012-04-13 01:08:20 +00:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2009-07-07 21:51:00 +00:00
|
|
|
//*************************************************************************
|
|
|
|
//
|
2021-01-01 15:29:54 +00:00
|
|
|
// Copyright 2009-2021 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
|
2020-03-21 15:24:24 +00:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
2009-07-07 21:51:00 +00:00
|
|
|
// Version 2.0.
|
2020-03-21 15:24:24 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2009-07-07 21:51:00 +00:00
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
///
|
|
|
|
/// \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
|
|
|
|
2021-03-04 02:57:07 +00:00
|
|
|
#ifndef VERILATOR_VERILATED_SC_H_
|
|
|
|
#define VERILATOR_VERILATED_SC_H_ ///< 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))
|
2020-11-19 02:32:16 +00:00
|
|
|
class VlScBvExposer final : public sc_bv_base {
|
2009-07-07 21:51:00 +00:00
|
|
|
public:
|
2017-10-27 01:51:51 +00:00
|
|
|
static const vluint32_t* sp_datap(const sc_bv_base& base) VL_MT_SAFE {
|
2019-12-22 23:09:46 +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
|