Skip to content

Commit

Permalink
Merge pull request #281 from barnasc/accellera-remove-sc_any_value
Browse files Browse the repository at this point in the history
remove references and implementation for obsolete SystemC sc_any_value
  • Loading branch information
oladahl authored Apr 19, 2022
2 parents e185ca7 + eb403bd commit ebe94a8
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 63 deletions.
7 changes: 0 additions & 7 deletions src/cci/cfg/cci_param_typed.h
Original file line number Diff line number Diff line change
Expand Up @@ -882,14 +882,7 @@ CCI_PARAM_TYPED_CALLBACK_IMPL_(post_read)

/// Constructors

#ifdef CCI_HAS_SC_ANY_VALUE
# define CCI_PARAM_CHECK_ANY_VALUE_FAILURE(rpt) \
if( sc_core::sc_string_view(rpt.get_msg_type()) \
== sc_core::SC_ID_ANY_VALUE_CONVERSION_FAILED_) \
cci_report_handler::cci_value_failure("conversion from cci_value failed")
#else
# define CCI_PARAM_CHECK_ANY_VALUE_FAILURE(rpt) ((void)0)
#endif // CCI_HAS_SC_ANY_VALUE

#define CCI_PARAM_CONSTRUCTOR_CCI_VALUE_IMPL(signature, broker) \
template <typename T, cci_param_mutable_type TM> \
Expand Down
9 changes: 0 additions & 9 deletions src/cci/cfg/cci_report_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,6 @@ cci_report_handler::decode_param_failure(const sc_core::sc_report& rpt)
return cci_type->val;
}

#ifdef CCI_HAS_SC_ANY_VALUE
sc_core::sc_string_view rpt_msg_type_s = rpt_msg_type;
if ( rpt_msg_type_s == sc_core::SC_ID_ANY_VALUE_ACCESS_FAILED_
|| rpt_msg_type_s == sc_core::SC_ID_ANY_VALUE_CONVERSION_FAILED_
|| rpt_msg_type_s == sc_core::SC_ID_ANY_VALUE_PARSING_FAILED_
|| rpt_msg_type_s == sc_core::SC_ID_ANY_VALUE_ASSERTION_FAILED_ )
return CCI_VALUE_FAILURE;
#endif // CCI_HAS_SC_ANY_VALUE

//not a CCI failure report
return CCI_NOT_FAILURE;
}
Expand Down
3 changes: 1 addition & 2 deletions src/cci/core/cci_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "cci/core/cci_cmnhdr.h"
#include "cci/core/cci_value.h"

#ifndef CCI_HAS_SC_ANY_VALUE
#include "cci/core/rapidjson.h"
#include "cci/cfg/cci_report_handler.h"

Expand Down Expand Up @@ -989,4 +988,4 @@ cci_value_cref::to_json() const
}

CCI_CLOSE_NAMESPACE_
#endif // CCI_HAS_SC_ANY_VALUE

20 changes: 0 additions & 20 deletions src/cci/core/cci_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
#include "cci/core/cci_cmnhdr.h"
#include "cci/core/cci_core_types.h"

#ifndef CCI_HAS_SC_ANY_VALUE
# include "cci/core/cci_value_iterator.h"
# include <cstring> // std::strlen
#endif // CCI_HAS_SC_ANY_VALUE

#ifdef _MSC_VER
#pragma warning(push)
Expand All @@ -43,23 +41,6 @@ CCI_OPEN_NAMESPACE_
using sc_dt::int64;
using sc_dt::uint64;

#ifdef CCI_HAS_SC_ANY_VALUE

typedef sc_dt::sc_any_value cci_value;
typedef sc_dt::sc_any_value_list cci_value_list;
typedef sc_dt::sc_any_value_map cci_value_map;
typedef sc_dt::sc_any_value_category cci_value_category;

static const cci_value_category CCI_NULL_VALUE = sc_dt::SC_ANY_VALUE_NULL;
static const cci_value_category CCI_BOOL_VALUE = sc_dt::SC_ANY_VALUE_BOOL;
static const cci_value_category CCI_INTEGRAL_VALUE = sc_dt::SC_ANY_VALUE_INT;
static const cci_value_category CCI_REAL_VALUE = sc_dt::SC_ANY_VALUE_REAL;
static const cci_value_category CCI_STRING_VALUE = sc_dt::SC_ANY_VALUE_STRING;
static const cci_value_category CCI_LIST_VALUE = sc_dt::SC_ANY_VALUE_LIST;
static const cci_value_category CCI_OTHER_VALUE = sc_dt::SC_ANY_VALUE_MAP;

#else // CCI_HAS_SC_ANY_VALUE

// forward declarations
class cci_value;
class cci_value_cref;
Expand Down Expand Up @@ -1536,7 +1517,6 @@ cci_value_list_ref::insert( const_iterator pos, InputIt first, InputIt last )
#undef CCI_VALUE_REQUIRES_CONVERTER_
#undef CCI_VALUE_MOVE_

#endif // CCI_HAS_SC_ANY_VALUE
CCI_CLOSE_NAMESPACE_

#ifdef _MSC_VER
Expand Down
2 changes: 0 additions & 2 deletions src/cci/core/cci_value_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @author Philipp A. Hartmann, OFFIS/Intel
*/

#ifndef CCI_HAS_SC_ANY_VALUE
CCI_OPEN_NAMESPACE_

#define DEFINE_PACK_( Type ) \
Expand Down Expand Up @@ -451,4 +450,3 @@ template struct cci_value_converter<sc_dt::sc_ufix_fast>;
#endif // SC_INCLUDE_FX

CCI_CLOSE_NAMESPACE_
#endif // CCI_HAS_SC_ANY_VALUE
21 changes: 2 additions & 19 deletions src/cci/core/cci_value_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,6 @@ struct value_converter_enable_if
//@endcond
CCI_CLOSE_NAMESPACE_

#ifdef CCI_HAS_SC_ANY_VALUE
namespace sc_dt {

template<typename T>
typename CCI_NAMESPACE::cci_impl::value_converter_enable_if<T,bool>::type
sc_any_value_pack( CCI_NAMESPACE::cci_value::reference dst, T const & src )
{ return CCI_NAMESPACE::cci_value_converter<T>::pack( dst, src ); }

template<typename T>
typename CCI_NAMESPACE::cci_impl::value_converter_enable_if<T,bool>::type
sc_any_value_unpack( T& dst, CCI_NAMESPACE::cci_value::const_reference src )
{ return CCI_NAMESPACE::cci_value_converter<T>::unpack( dst, src ); }

} // namespace sc_dt

#else // CCI_HAS_SC_ANY_VALUE
///@cond CCI_HIDDEN_FROM_DOXYGEN
CCI_OPEN_NAMESPACE_

Expand Down Expand Up @@ -448,13 +432,12 @@ struct cci_value_converter< sc_dt::sc_lv<N> >
};

CCI_CLOSE_NAMESPACE_
#endif // CCI_HAS_SC_ANY_VALUE
#endif // CCI_CCI_VALUE_CONVERTER_H_INCLUDED_

///@todo add support for SystemC fixpoint types
#if defined(SC_INCLUDE_FX) && !defined(CCI_CNF_CCI_VALUE_CONVERTER_H_INCLUDED_FX_)
#define CCI_CNF_CCI_VALUE_CONVERTER_H_INCLUDED_FX_
#ifndef CCI_HAS_SC_ANY_VALUE

CCI_OPEN_NAMESPACE_

CCI_VALUE_HAS_CONVERTER_(sc_dt::sc_fxval);
Expand Down Expand Up @@ -502,7 +485,7 @@ struct cci_value_converter< sc_dt::sc_ufixed_fast<W,I,Q,O,N> >
};

CCI_CLOSE_NAMESPACE_
#endif // CCI_HAS_SC_ANY_VALUE

#endif // SC_INCLUDE_FX && ! CCI_CNF_CCI_VALUE_CONVERTER_H_INCLUDED_FX_

#undef CCI_VALUE_HAS_CONVERTER_
Expand Down
4 changes: 0 additions & 4 deletions src/cci/core/systemc.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,4 @@ inline sc_object* sc_get_current_object()
} // namespace sc_core
#endif // sc_core::sc_get_current_object

#if CCI_SYSTEMC_VERSION_CODE_ >= CCI_VERSION_HELPER_(2,4,0)
# define CCI_HAS_SC_ANY_VALUE 1
#endif // sc_core::sc_any_value

#endif // CCI_CORE_SYSTEMC_H_INCLUDED_

0 comments on commit ebe94a8

Please sign in to comment.