00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2006 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 Version 2.4 (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.systemc.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.1.1.1 2006/12/15 20:31:36 acg 00046 // SystemC 2.2 00047 // 00048 // Revision 1.3 2006/01/13 18:49:32 acg 00049 // Added $Log command so that CVS check in comments are reproduced in the 00050 // source. 00051 // 00052 00053 #ifndef SC_NBEXTERNS_H 00054 #define SC_NBEXTERNS_H 00055 00056 00057 #include "sysc/datatypes/int/sc_nbutils.h" 00058 00059 00060 namespace sc_dt 00061 { 00062 00063 extern 00064 void add_on_help(small_type &us, 00065 int unb, int und, sc_digit *ud, 00066 small_type vs, 00067 int vnb, int vnd, const sc_digit *vd); 00068 00069 extern 00070 void mul_on_help_signed(small_type &us, 00071 int unb, int und, sc_digit *ud, 00072 int vnb, int vnd, const sc_digit *vd); 00073 00074 void div_on_help_signed(small_type &us, 00075 int unb, int und, sc_digit *ud, 00076 int vnb, int vnd, const sc_digit *vd); 00077 00078 extern 00079 void mod_on_help_signed(small_type &us, 00080 int unb, int und, sc_digit *ud, 00081 int vnb, int vnd, const sc_digit *vd); 00082 00083 extern 00084 void mul_on_help_unsigned(small_type &us, 00085 int unb, int und, sc_digit *ud, 00086 int vnb, int vnd, const sc_digit *vd); 00087 00088 void div_on_help_unsigned(small_type &us, 00089 int unb, int und, sc_digit *ud, 00090 int vnb, int vnd, const sc_digit *vd); 00091 00092 extern 00093 void mod_on_help_unsigned(small_type &us, 00094 int unb, int und, sc_digit *ud, 00095 int vnb, int vnd, const sc_digit *vd); 00096 00097 extern 00098 void and_on_help(small_type us, 00099 int unb, int und, sc_digit *ud, 00100 small_type vs, 00101 int vnb, int vnd, const sc_digit *vd); 00102 00103 extern 00104 void or_on_help(small_type us, 00105 int unb, int und, sc_digit *ud, 00106 small_type vs, 00107 int vnb, int vnd, const sc_digit *vd); 00108 00109 extern 00110 void xor_on_help(small_type us, 00111 int unb, int und, sc_digit *ud, 00112 small_type vs, 00113 int vnb, int vnd, const sc_digit *vd); 00114 00115 } // namespace sc_dt 00116 00117 00118 #endif