summaryrefslogtreecommitdiff
path: root/src/systemc/dt/misc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-05-24 01:29:36 -0700
committerGabe Black <gabeblack@google.com>2018-08-08 10:09:06 +0000
commit7235d3b5211d0ba8f528d930a4c1e7ad62eec51a (patch)
treec2827b177216f929c502c770ab577f1c73e61318 /src/systemc/dt/misc
parent5ee040a534d422ee08918ef49d55620184df7120 (diff)
downloadgem5-7235d3b5211d0ba8f528d930a4c1e7ad62eec51a.tar.xz
systemc: Add the Accellera implementation for the data type classes.
These files have been cleaned up style wise, and some macros have been resolved like they were for the header files. Change-Id: I447e5311961036847e7da0c5a86c0da25a633010 Reviewed-on: https://gem5-review.googlesource.com/10844 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/dt/misc')
-rw-r--r--src/systemc/dt/misc/SConscript32
-rw-r--r--src/systemc/dt/misc/sc_concatref.cc66
-rw-r--r--src/systemc/dt/misc/sc_value_base.cc137
3 files changed, 235 insertions, 0 deletions
diff --git a/src/systemc/dt/misc/SConscript b/src/systemc/dt/misc/SConscript
new file mode 100644
index 000000000..6f6d8191e
--- /dev/null
+++ b/src/systemc/dt/misc/SConscript
@@ -0,0 +1,32 @@
+# Copyright 2018 Google, Inc.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Authors: Gabe Black
+
+Import('*')
+
+if env['USE_SYSTEMC']:
+ Source('sc_concatref.cc')
+ Source('sc_value_base.cc')
diff --git a/src/systemc/dt/misc/sc_concatref.cc b/src/systemc/dt/misc/sc_concatref.cc
new file mode 100644
index 000000000..cb31efbaa
--- /dev/null
+++ b/src/systemc/dt/misc/sc_concatref.cc
@@ -0,0 +1,66 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ sc_concatref.cpp -- Concatenation support.
+
+ Original Author: Andy Goodrich, Forte Design Systems, Inc.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+// $Log: sc_concatref.cpp,v $
+// Revision 1.1.1.1 2006/12/15 20:20:05 acg
+// SystemC 2.3
+//
+// Revision 1.3 2006/01/13 18:54:01 acg
+// Andy Goodrich: added $Log command so that CVS comments are reproduced in
+// the source.
+//
+
+#include "systemc/ext/dt/misc/sc_concatref.hh"
+#include "systemc/ext/dt/sc_temporary.hh"
+
+// STORAGE POOLS USED BY sc_concatref:
+namespace sc_core
+{
+
+template class sc_vpool<sc_dt::sc_concatref>;
+template class sc_vpool<sc_dt::sc_concat_bool>;
+sc_byte_heap sc_temp_heap(0x300000);
+
+} // namespace sc_core
+
+namespace sc_dt
+{
+
+sc_core::sc_vpool<sc_concat_bool> sc_concat_bool::m_pool(9);
+sc_core::sc_vpool<sc_concatref> sc_concatref::m_pool(9);
+
+} // namespace sc_dt
diff --git a/src/systemc/dt/misc/sc_value_base.cc b/src/systemc/dt/misc/sc_value_base.cc
new file mode 100644
index 000000000..774f58391
--- /dev/null
+++ b/src/systemc/dt/misc/sc_value_base.cc
@@ -0,0 +1,137 @@
+/*****************************************************************************
+
+ Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
+ more contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright ownership.
+ Accellera licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ sc_value_base.cpp -- Base class for all SystemC data values.
+
+ Original Author: Andy Goodrich, Forte Design Systems
+
+ *****************************************************************************/
+
+/*****************************************************************************
+
+ MODIFICATION LOG - modifiers, enter your name, affiliation, date and
+ changes you are making here.
+
+ Name, Affiliation, Date:
+ Description of Modification:
+
+ *****************************************************************************/
+
+
+// $Log: sc_value_base.cpp,v $
+// Revision 1.2 2011/08/15 16:43:24 acg
+// Torsten Maehne: changes to remove unused argument warnings.
+//
+// Revision 1.1.1.1 2006/12/15 20:20:05 acg
+// SystemC 2.3
+//
+// Revision 1.3 2006/01/13 18:54:01 acg
+// Andy Goodrich: added $Log command so that CVS comments are reproduced in
+// the source.
+//
+
+#include <cctype>
+#include <cstdio>
+#include <cstdlib>
+
+#include "systemc/ext/dt/misc/sc_value_base.hh"
+#include "systemc/ext/utils/sc_report_handler.hh"
+
+namespace sc_dt
+{
+
+void
+sc_value_base::concat_clear_data(bool /* to_ones */)
+{
+ static const char error_message[] =
+ "concat_clear_data method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+}
+
+bool
+sc_value_base::concat_get_ctrl(sc_digit * /*dst_p*/, int /*low_i*/) const
+{
+ static const char error_message[] =
+ "concat_get_ctrl method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+ return false;
+}
+
+bool
+sc_value_base::concat_get_data(sc_digit * /*dst_p*/, int /*low_i*/) const
+{
+ static const char error_message[] =
+ "concat_get_data method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+ return false;
+}
+
+sc_dt::uint64
+sc_value_base::concat_get_uint64() const
+{
+ static const char error_message[] =
+ "concat_get_uint64 method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+ return 0;
+}
+
+int
+sc_value_base::concat_length(bool * /*xz_present_p*/) const
+{
+ static const char error_message[] =
+ "concat_length method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+ return 0;
+}
+
+void
+sc_value_base::concat_set(int64 /*src*/, int /*low_i*/)
+{
+ static const char error_message[] =
+ "concat_set(int64) method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+}
+
+void
+sc_value_base::concat_set(const sc_signed &/*src*/, int /*low_i*/)
+{
+ static const char error_message[] =
+ "concat_set(sc_signed) method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+}
+
+void
+sc_value_base::concat_set(const sc_unsigned &/*src*/, int /*low_i*/)
+{
+ static const char error_message[] =
+ "concat_set(sc_unsigned) method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+}
+
+void
+sc_value_base::concat_set(uint64 /*src*/, int /*low_i*/)
+{
+ static const char error_message[] =
+ "concat_set(uint64) method not supported by this type";
+ SC_REPORT_ERROR("operation failed", error_message);
+}
+
+} // namespace sc_dt