Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Multiplier/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Multiplier/SelfTest/src/test.cpp	(revision 112)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Multiplier/SelfTest/src/test.cpp	(revision 116)
@@ -9,4 +9,5 @@
 #include "Behavioural/Generic/Multiplier/SelfTest/include/test.h"
 #include "Behavioural/include/Allocation.h"
+#include "Common/include/BitManipulation.h"
 
 void test (string name,
@@ -50,5 +51,20 @@
   sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);	 
   sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
-  
+
+  sc_signal<Tdata_t   > *  in_MULTIPLIER_DATA_IN_0;
+  sc_signal<Tdata_t   > *  in_MULTIPLIER_DATA_IN_1;
+  sc_signal<Tcontrol_t> *  in_MULTIPLIER_NSTALL   ;
+
+  sc_signal<Tdata_t   > * out_MULTIPLIER_DATA_LSB_OUT;
+  sc_signal<Tdata_t   > * out_MULTIPLIER_DATA_MSB_OUT;
+
+
+  ALLOC0_SC_SIGNAL( in_MULTIPLIER_DATA_IN_0,"in_MULTIPLIER_DATA_IN_0",Tdata_t   );
+  ALLOC0_SC_SIGNAL( in_MULTIPLIER_DATA_IN_1,"in_MULTIPLIER_DATA_IN_1",Tdata_t   );
+  ALLOC0_SC_SIGNAL( in_MULTIPLIER_NSTALL   ,"in_MULTIPLIER_NSTALL   ",Tcontrol_t);
+
+  ALLOC0_SC_SIGNAL(out_MULTIPLIER_DATA_LSB_OUT,"out_MULTIPLIER_DATA_LSB_OUT",Tdata_t   );
+  ALLOC0_SC_SIGNAL(out_MULTIPLIER_DATA_MSB_OUT,"out_MULTIPLIER_DATA_MSB_OUT",Tdata_t   );
+
   /********************************************************
    * Instanciation
@@ -60,4 +76,10 @@
   (*(_Multiplier->in_NRESET))       (*(in_NRESET));
 
+  INSTANCE0_SC_SIGNAL(_Multiplier, in_MULTIPLIER_DATA_IN_0);
+  INSTANCE0_SC_SIGNAL(_Multiplier, in_MULTIPLIER_DATA_IN_1);
+  INSTANCE0_SC_SIGNAL(_Multiplier, in_MULTIPLIER_NSTALL);
+
+  INSTANCE0_SC_SIGNAL(_Multiplier,out_MULTIPLIER_DATA_LSB_OUT);
+  INSTANCE0_SC_SIGNAL(_Multiplier,out_MULTIPLIER_DATA_MSB_OUT);
 
   msg(_("<%s> : Start Simulation ............\n"),name.c_str());
@@ -89,4 +111,107 @@
     {
       LABEL("Iteration %d",iteration);
+      
+      uint64_t data0 = range<uint64_t>(rand(),_param->_size_data);
+      uint64_t data1 = range<uint64_t>(rand(),_param->_size_data);
+      
+      in_MULTIPLIER_DATA_IN_0->write(static_cast<Tdata_t>(data0));
+      in_MULTIPLIER_DATA_IN_1->write(static_cast<Tdata_t>(data1));
+      in_MULTIPLIER_NSTALL->write(static_cast<Tcontrol_t>(1));
+      
+      sc_uint<32> res_lsb = 0;
+      sc_uint<32> res_msb = 0;
+      
+      switch (_param->_size_data)
+        {
+        case 8 :
+          {
+            if (_param->_sign){ // 0 = signed, 1 = unsigned
+              sc_uint<16> mask = 0xff;
+              sc_uint<16> tmp = (static_cast<sc_uint<16> >(data0)) * (static_cast<sc_uint<16> >(data1));
+              res_lsb = tmp.range(7,0);
+              res_msb = tmp.range(15,8);
+            }
+            else{
+              sc_int<8> data_0 = static_cast<sc_int<8> >(data0);
+              sc_int<8> data_1 = static_cast<sc_int<8> >(data1);
+              sc_int<16> tmp   = (static_cast<sc_int<16> >(data_0) * 
+                                  static_cast<sc_int<16> >(data_1));
+              res_lsb = static_cast<Tdata_t>(_param->_mask &  tmp);
+              res_msb = static_cast<Tdata_t>(_param->_mask &  (tmp>>8));
+            }
+            break;
+          }
+        case 16 :
+          {
+            if (_param->_sign){ // 0 = signed, 1 = unsigned
+              sc_uint<32> mask = 0xffff;
+              sc_uint<32> tmp = (static_cast<sc_uint<32> >(data0)) * (static_cast<sc_uint<32> >(data1));
+              res_lsb = tmp.range(15,0);
+              res_msb = tmp.range(31,16);
+            }
+            else{
+              sc_int<16> data_0 = static_cast<sc_int<16> >(data0);
+              sc_int<16> data_1 = static_cast<sc_int<16> >(data1);
+              sc_int<32> tmp    = (static_cast<sc_int<32> >(data_0) * 
+                                   static_cast<sc_int<32> >(data_1));
+              res_lsb = static_cast<Tdata_t>(_param->_mask &  tmp);
+              res_msb = static_cast<Tdata_t>(_param->_mask &  (tmp>>16));
+              
+              cout << "data_0  : " << std::hex << data_0 << std::dec << " - dec : " << data_0<< endl;
+              cout << "data_1  : " << std::hex << data_1 << std::dec << " - dec : " << data_1<< endl;
+              cout << "tmp     : " << std::hex << tmp    << std::dec << " - dec : " << tmp   << endl;
+              cout << "res_lsb : " << std::hex << res_lsb << std::dec << endl;
+              cout << "res_msb : " << std::hex << res_msb << std::dec << endl;
+            }
+            break;
+          }
+        case 32 :
+          {
+            if (_param->_sign){ // 0 = signed, 1 = unsigned
+              sc_uint<32> data_0 = static_cast<sc_uint<32> >(data0);
+              sc_uint<32> data_1 = static_cast<sc_uint<32> >(data1);
+              sc_uint<64> tmp = (data0) * (data1);
+              res_lsb = static_cast<Tdata_t>(_param->_mask &  tmp);
+              res_msb = static_cast<Tdata_t>(_param->_mask &  (tmp>>32));
+
+              cout << "tmp : " << std::hex << tmp << std::dec << endl;
+            }
+            else{
+              sc_int<32> data_0 = static_cast<sc_int<32> >(data0);
+              sc_int<32> data_1 = static_cast<sc_int<32> >(data1);
+              sc_int<64> tmp = (data0) * (data1);
+              res_lsb = static_cast<Tdata_t>(_param->_mask &  tmp);
+              res_msb = static_cast<Tdata_t>(_param->_mask &  (tmp>>32));
+
+              cout << "data_0  : " << std::hex << data_0 << std::dec << endl;
+              cout << "data_1  : " << std::hex << data_1 << std::dec << endl;
+              cout << "tmp     : " << std::hex << tmp << std::dec << endl;
+              cout << "res_lsb : " << std::hex << res_lsb << std::dec << endl;
+              cout << "res_msb : " << std::hex << res_msb << std::dec << endl;
+
+
+            }
+            break;
+          }
+//         case 64 :
+//           {
+//             if (_param->_sign){ 0 = signed, 1 = unsigned
+//               uint64_t tmp = static_cast<uint64_t>(data0) * static_cast<uint64_t>(data1);
+//               res_lsb = tmp;
+//             }
+//             else{
+//               int64_t tmp = static_cast< int64_t>(data0) * static_cast< int64_t>(data1);
+//               res_lsb = 0xffffffffffffffff&tmp;
+//             }
+//             break;
+//           }
+        default :
+          {
+            TEST_KO("Invalid size for the test.");
+          }
+        }
+      SC_START(_param->_latency);
+      TEST(Tdata_t,out_MULTIPLIER_DATA_LSB_OUT->read(),res_lsb);
+      TEST(Tdata_t,out_MULTIPLIER_DATA_MSB_OUT->read(),res_msb);
 
       SC_START(1);
@@ -104,4 +229,11 @@
   delete in_CLOCK;
   delete in_NRESET;
+
+  DELETE0_SC_SIGNAL( in_MULTIPLIER_DATA_IN_0);
+  DELETE0_SC_SIGNAL( in_MULTIPLIER_DATA_IN_1);
+  DELETE0_SC_SIGNAL( in_MULTIPLIER_NSTALL);
+  DELETE0_SC_SIGNAL(out_MULTIPLIER_DATA_LSB_OUT);
+  DELETE0_SC_SIGNAL(out_MULTIPLIER_DATA_MSB_OUT);
+
     }
 #endif
