Index: trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp
===================================================================
--- trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp	(revision 1050)
+++ trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp	(revision 1051)
@@ -15,8 +15,4 @@
 #include "../include/tsar_iob_cluster.h"
 
-#define MWR_COPROC_CPY  0
-#define MWR_COPROC_DCT  1
-#define MWR_COPROC_GCD  2
-
 #define tmpl(x) \
    template<typename vci_param_int      , typename vci_param_ext,\
@@ -51,9 +47,9 @@
                     size_t                             int_memc_tgt_id, // local index
                     size_t                             int_xicu_tgt_id, // local index
-                    size_t                             int_mwmr_tgt_id, // local index
+                    size_t                             int_mdma_tgt_id, // local index
                     size_t                             int_iobx_tgt_id, // local index
 
                     size_t                             int_proc_ini_id, // local index
-                    size_t                             int_mwmr_ini_id, // local index
+                    size_t                             int_mdma_ini_id, // local index
                     size_t                             int_iobx_ini_id, // local index
 
@@ -62,5 +58,5 @@
                     size_t                             ram_iobx_ini_id, // local index
 
-                    bool                               is_io,           // is IO cluster (IOB)?
+                    bool                               is_io,           // is IO cluster (
                     size_t                             iox_iobx_tgt_id, // local_index
                     size_t                             iox_iobx_ini_id, // local index
@@ -213,57 +209,14 @@
                      xcu_nb_out);                         // number of output IRQs
 
-    ////////////  MWMR controller and COPROC  ////////////////////////////////////////
-    std::ostringstream s_mwmr;
-    std::ostringstream s_copro;
-    s_mwmr << "mwmr_" << x_id << "_" << y_id;
-
-    if ( coproc_type ==  MWR_COPROC_CPY) 
-    {
-        s_copro << "cpy_" << x_id << "_" << y_id;
-        cpy = new CoprocCpy( s_copro.str().c_str(), 64 );       // burst size
-
-        mwmr = new VciMwmrDma<vci_param_int>(
-                     s_mwmr.str().c_str(),
+    ////////////  MDMA  //////////////////////////////////////////////////////////////
+    std::ostringstream s_mdma;
+    s_mdma << "mdma_" << x_id << "_" << y_id;
+    mdma = new VciMultiDma<vci_param_int>(
+                     s_mdma.str().c_str(),
                      mt_int,
-                     IntTab(cluster_id, int_mwmr_ini_id), // SRCID
-                     IntTab(cluster_id, int_mwmr_tgt_id), // TGTID
-                     1,                                   // nb to_coproc ports
-                     1,                                   // nb from_coproc ports
-                     1,                                   // nb config registers
-                     0,                                   // nb status registers
-                     64 );                                // burst size (bytes)
-    }
-    if ( coproc_type == MWR_COPROC_DCT ) 
-    {
-        s_copro << "dct_" << x_id << "_" << y_id;
-        dct = new CoprocDct( s_copro.str().c_str(), 64 , 16 );  // burst size / latency
-
-        mwmr = new VciMwmrDma<vci_param_int>(
-                     s_mwmr.str().c_str(),
-                     mt_int,
-                     IntTab(cluster_id, int_mwmr_ini_id), // SRCID
-                     IntTab(cluster_id, int_mwmr_tgt_id), // TGTID
-                     1,                                   // nb to_coproc ports
-                     1,                                   // nb from_coproc ports
-                     1,                                   // nb config registers
-                     0,                                   // nb status registers
-                     64 );                                // burst size (bytes)
-    }
-    if ( coproc_type == MWR_COPROC_GCD ) 
-    {
-        s_copro << "gcd_" << x_id << "_" << y_id;
-        gcd = new CoprocGcd( s_copro.str().c_str(), 64 );       // burst size
-
-        mwmr = new VciMwmrDma<vci_param_int>(
-                     s_mwmr.str().c_str(),
-                     mt_int,
-                     IntTab(cluster_id, int_mwmr_ini_id), // SRCID
-                     IntTab(cluster_id, int_mwmr_tgt_id), // TGTID
-                     2,                                   // nb to_coproc ports
-                     1,                                   // nb from_coproc ports
-                     1,                                   // nb config registers
-                     0,                                   // nb status registers
-                     64 );                                // burst size (bytes)
-    }
+                     IntTab(cluster_id, int_mdma_ini_id), // SRCID
+                     IntTab(cluster_id, int_mdma_tgt_id), // TGTID
+                     64,                                  // burst size
+                     nb_procs );                          // number of channels
 
     ///////////  VCI INT_CMD/RSP LOCAL_XBAR  ////////////////////////////////////// 
@@ -526,7 +479,7 @@
     for ( size_t i=0 ; i < xcu_nb_hwi ; i++)
     {
-        if      ( i == 0 )       xicu->p_hwi[i]  (signal_irq_memc);
-        else if ( i == 1 )       xicu->p_hwi[i]  (signal_irq_mwmr);
-        else                     xicu->p_hwi[i]  (signal_false);
+        if      ( i == 0 )           xicu->p_hwi[i]  (signal_irq_memc);
+        else if ( i < (nb_procs+1) ) xicu->p_hwi[i]  (signal_irq_mdma[i-1]);
+        else                         xicu->p_hwi[i]  (signal_false);
     }
 
@@ -566,64 +519,15 @@
     std::cout << "  - xram connected" << std::endl;
 
-    /////////////////////////////////// GCD coprocessor
-    if ( coproc_type == MWR_COPROC_GCD )
-    {
-        gcd->p_clk                               (this->p_clk);
-        gcd->p_resetn                            (this->p_resetn);
-        gcd->p_opa                               (signal_to_coproc[0]);
-        gcd->p_opb                               (signal_to_coproc[1]);
-        gcd->p_res                               (signal_from_coproc[0]);
-        gcd->p_config                            (signal_config_coproc[0]);
-
-        mwmr->p_clk                              (this->p_clk);
-        mwmr->p_resetn                           (this->p_resetn);
-        mwmr->p_vci_target                       (signal_int_vci_tgt_mwmr);
-        mwmr->p_vci_initiator                    (signal_int_vci_ini_mwmr);
-        mwmr->p_to_coproc[0]                     (signal_to_coproc[0]);
-        mwmr->p_to_coproc[1]                     (signal_to_coproc[1]);
-        mwmr->p_from_coproc[0]                   (signal_from_coproc[0]);
-        mwmr->p_config[0]                        (signal_config_coproc[0]);
-        mwmr->p_irq                              (signal_irq_mwmr);
-    }
-
-    /////////////////////////////////// DCT coprocessor
-    if ( coproc_type == MWR_COPROC_DCT )
-    {
-        dct->p_clk                               (this->p_clk);
-        dct->p_resetn                            (this->p_resetn);
-        dct->p_in                                (signal_to_coproc[0]);
-        dct->p_out                               (signal_from_coproc[0]);
-        dct->p_config                            (signal_config_coproc[0]);
-
-        mwmr->p_clk                              (this->p_clk);
-        mwmr->p_resetn                           (this->p_resetn);
-        mwmr->p_vci_target                       (signal_int_vci_tgt_mwmr);
-        mwmr->p_vci_initiator                    (signal_int_vci_ini_mwmr);
-        mwmr->p_to_coproc[0]                     (signal_to_coproc[0]);
-        mwmr->p_from_coproc[0]                   (signal_from_coproc[0]);
-        mwmr->p_config[0]                        (signal_config_coproc[0]);
-        mwmr->p_irq                              (signal_irq_mwmr);
-    }
-
-    std::cout << "  - coproc connected" << std::endl;
-
-    /////////////////////////////////// CPY coprocessor
-    if ( coproc_type == MWR_COPROC_CPY )
-    {
-        cpy->p_clk                               (this->p_clk);
-        cpy->p_resetn                            (this->p_resetn);
-        cpy->p_load                              (signal_to_coproc[0]);
-        cpy->p_store                             (signal_from_coproc[0]);
-        cpy->p_config                            (signal_config_coproc[0]);
-
-        mwmr->p_clk                              (this->p_clk);
-        mwmr->p_resetn                           (this->p_resetn);
-        mwmr->p_vci_target                       (signal_int_vci_tgt_mwmr);
-        mwmr->p_vci_initiator                    (signal_int_vci_ini_mwmr);
-        mwmr->p_to_coproc[0]                     (signal_to_coproc[0]);
-        mwmr->p_from_coproc[0]                   (signal_from_coproc[0]);
-        mwmr->p_config[0]                        (signal_config_coproc[0]);
-        mwmr->p_irq                              (signal_irq_mwmr);
-    }
+    /////////////////////////////////// MDMA 
+    mdma->p_clk                                  (this->p_clk);
+    mdma->p_resetn                               (this->p_resetn);
+    mdma->p_vci_target                           (signal_int_vci_tgt_mdma);
+    mdma->p_vci_initiator                        (signal_int_vci_ini_mdma);
+    for( size_t i = 0 ; i < nb_procs ; i++ )
+    {
+        mdma->p_irq[i]                           (signal_irq_mdma[i]);
+    }
+
+    std::cout << "  - mdma connected" << std::endl;
 
     //////////////////////////// RAM NETWORK ROUTERS
@@ -712,6 +616,6 @@
     int_xbar_d->p_to_target[int_memc_tgt_id]     (signal_int_vci_tgt_memc);
     int_xbar_d->p_to_target[int_xicu_tgt_id]     (signal_int_vci_tgt_xicu);
-    int_xbar_d->p_to_target[int_mwmr_tgt_id]     (signal_int_vci_tgt_mwmr);
-    int_xbar_d->p_to_initiator[int_mwmr_ini_id]  (signal_int_vci_ini_mwmr);
+    int_xbar_d->p_to_target[int_mdma_tgt_id]     (signal_int_vci_tgt_mdma);
+    int_xbar_d->p_to_initiator[int_mdma_ini_id]  (signal_int_vci_ini_mdma);
     for (size_t p = 0; p < nb_procs; p++)
        int_xbar_d->p_to_initiator[int_proc_ini_id + p] (signal_int_vci_ini_proc[p]);
