00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.accellera.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 sc_nbexterns.h -- External functions for both sc_signed and sc_unsigned 00021 classes. These functions work on two parameters u and 00022 v, and copy the result to the first parameter u. This 00023 is also the reason that they are suffixed with _on_help. 00024 00025 The vec_* functions are called through either these 00026 functions or those in sc_nbfriends.cpp. The functions in 00027 sc_nbfriends.cpp perform their work on two inputs u and v, 00028 and return the result object. 00029 00030 Original Author: Ali Dasdan, Synopsys, Inc. 00031 00032 *****************************************************************************/ 00033 00034 /***************************************************************************** 00035 00036 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00037 changes you are making here. 00038 00039 Name, Affiliation, Date: 00040 Description of Modification: 00041 00042 *****************************************************************************/ 00043 00044 // $Log: sc_nbexterns.h,v $ 00045 // Revision 1.2 2011/02/18 20:19:15 acg 00046 // Andy Goodrich: updating Copyright notice. 00047 // 00048 // Revision 1.1.1.1 2006/12/15 20:20:05 acg 00049 // SystemC 2.3 00050 // 00051 // Revision 1.3 2006/01/13 18:49:32 acg 00052 // Added $Log command so that CVS check in comments are reproduced in the 00053 // source. 00054 // 00055 00056 #ifndef SC_NBEXTERNS_H 00057 #define SC_NBEXTERNS_H 00058 00059 00060 #include "sysc/datatypes/int/sc_nbutils.h" 00061 00062 00063 namespace sc_dt 00064 { 00065 00066 extern 00067 void add_on_help(small_type &us, 00068 int unb, int und, sc_digit *ud, 00069 small_type vs, 00070 int vnb, int vnd, const sc_digit *vd); 00071 00072 extern 00073 void mul_on_help_signed(small_type &us, 00074 int unb, int und, sc_digit *ud, 00075 int vnb, int vnd, const sc_digit *vd); 00076 00077 void div_on_help_signed(small_type &us, 00078 int unb, int und, sc_digit *ud, 00079 int vnb, int vnd, const sc_digit *vd); 00080 00081 extern 00082 void mod_on_help_signed(small_type &us, 00083 int unb, int und, sc_digit *ud, 00084 int vnb, int vnd, const sc_digit *vd); 00085 00086 extern 00087 void mul_on_help_unsigned(small_type &us, 00088 int unb, int und, sc_digit *ud, 00089 int vnb, int vnd, const sc_digit *vd); 00090 00091 void div_on_help_unsigned(small_type &us, 00092 int unb, int und, sc_digit *ud, 00093 int vnb, int vnd, const sc_digit *vd); 00094 00095 extern 00096 void mod_on_help_unsigned(small_type &us, 00097 int unb, int und, sc_digit *ud, 00098 int vnb, int vnd, const sc_digit *vd); 00099 00100 extern 00101 void and_on_help(small_type us, 00102 int unb, int und, sc_digit *ud, 00103 small_type vs, 00104 int vnb, int vnd, const sc_digit *vd); 00105 00106 extern 00107 void or_on_help(small_type us, 00108 int unb, int und, sc_digit *ud, 00109 small_type vs, 00110 int vnb, int vnd, const sc_digit *vd); 00111 00112 extern 00113 void xor_on_help(small_type us, 00114 int unb, int und, sc_digit *ud, 00115 small_type vs, 00116 int vnb, int vnd, const sc_digit *vd); 00117 00118 } // namespace sc_dt 00119 00120 00121 #endif