Index: trunk/platforms/tsarv4_generic_mmu/tsarv4_cluster_mmu/caba/source/src/tsarv4_cluster_mmu.cpp
===================================================================
--- trunk/platforms/tsarv4_generic_mmu/tsarv4_cluster_mmu/caba/source/src/tsarv4_cluster_mmu.cpp	(revision 261)
+++ trunk/platforms/tsarv4_generic_mmu/tsarv4_cluster_mmu/caba/source/src/tsarv4_cluster_mmu.cpp	(revision 263)
@@ -48,9 +48,10 @@
          size_t                             tgtid_memc,
          size_t                             tgtid_xicu,
+         size_t                             tgtid_mdma,
          size_t                             tgtid_fbuf,
          size_t                             tgtid_mtty,
          size_t                             tgtid_brom,
+         size_t                             tgtid_mnic,
          size_t                             tgtid_bdev,
-         size_t                             tgtid_mdma,
          size_t                             memc_ways,
          size_t                             memc_sets,
@@ -65,4 +66,8 @@
          char*                              disk_name,
          size_t                             block_size,
+         size_t                             nic_channels,
+         char*                              nic_rx_name,
+         char*                              nic_tx_name,
+         uint32_t                           nic_timeout,
          const Loader                      &loader,
          uint32_t                           frozen_cycles,
@@ -182,5 +187,5 @@
     {
         nb_direct_initiators         = nb_procs + 2;
-        nb_direct_targets            = 7;
+        nb_direct_targets            = 8;
     }
     std::ostringstream sd;
@@ -208,5 +213,4 @@
     std::cout << "  - building wrappers in cluster_" << x_id << "_" << y_id << std::endl;
 
-    // direct initiator wrapper
     std::ostringstream wid;
     wid << "iniwrapperd_" << x_id << "_" << y_id;
@@ -216,5 +220,4 @@
                      4);                           // rsp fifo depth
 
-    // direct target wrapper
     std::ostringstream wtd;
     wtd << "tgtwrapperd_" << x_id << "_" << y_id;
@@ -224,5 +227,4 @@
                      4);                           // rsp fifo depth
 
-    // coherence initiator wrapper
     std::ostringstream wic;
     wic << "iniwrapperc_" << x_id << "_" << y_id;
@@ -232,5 +234,4 @@
                      4);                           // rsp fifo depth
 
-    // coherence target wrapper
     std::ostringstream wtc;
     wtc << "tgtwrapperc_" << x_id << "_" << y_id;
@@ -252,5 +253,4 @@
     std::cout << "  - building rsprouter_" << x_id << "_" << y_id << std::endl;
 
-    // RSP router
     std::ostringstream srsp;
     srsp << "rsprouter_" << x_id << "_" << y_id;
@@ -291,4 +291,15 @@
                         64);            // burst size
 
+        std::cout << "  - building mnic" << std::endl;
+
+        mnic = new VciMultiNic<vci_param>(
+                        "mnic",
+                        IntTab(cluster_id, tgtid_mnic),
+                        mtd,
+                        nic_channels,
+                        nic_rx_name,
+                        nic_tx_name,
+                        nic_timeout);
+
         std::cout << "  - building mtty" << std::endl;
 
@@ -391,4 +402,5 @@
         xbard->p_to_target[tgtid_bdev]      (signal_vci_tgt_d_bdev);
         xbard->p_to_target[tgtid_fbuf]      (signal_vci_tgt_d_fbuf);
+        xbard->p_to_target[tgtid_mnic]      (signal_vci_tgt_d_mnic);
 
         xbard->p_to_initiator[nb_procs+1]   (signal_vci_ini_d_bdev);
@@ -471,5 +483,5 @@
     xram->p_clk                     	(this->p_clk);
     xram->p_resetn                  	(this->p_resetn);
-    xram->p_vci                 		(signal_vci_xram);
+    xram->p_vci                 	      (signal_vci_xram);
 
     std::cout << "  - XRAM connected" << std::endl;
@@ -492,33 +504,45 @@
 	 {
         // BDEV            
-	     bdev->p_clk                      	(this->p_clk);
-        bdev->p_resetn                   	(this->p_resetn);
-        bdev->p_irq                      	(signal_irq_bdev);
-        bdev->p_vci_target               	(signal_vci_tgt_d_bdev);
-        bdev->p_vci_initiator            	(signal_vci_ini_d_bdev);
+	     bdev->p_clk                    (this->p_clk);
+        bdev->p_resetn                 (this->p_resetn);
+        bdev->p_irq                    (signal_irq_bdev);
+        bdev->p_vci_target             (signal_vci_tgt_d_bdev);
+        bdev->p_vci_initiator          (signal_vci_ini_d_bdev);
 
         std::cout << "  - BDEV connected" << std::endl;
 
         // FBUF
-        fbuf->p_clk                       	(this->p_clk);
-        fbuf->p_resetn                    	(this->p_resetn);
-        fbuf->p_vci                       	(signal_vci_tgt_d_fbuf);
+        fbuf->p_clk                    (this->p_clk);
+        fbuf->p_resetn                 (this->p_resetn);
+        fbuf->p_vci                    (signal_vci_tgt_d_fbuf);
 
         std::cout << "  - FBUF connected" << std::endl;
 
+        // MNIC
+        mnic->p_clk                    (this->p_clk);
+        mnic->p_resetn                 (this->p_resetn);
+        mnic->p_vci                    (signal_vci_tgt_d_mnic);
+        for ( size_t i=0 ; i<nic_channels ; i++ )
+        {
+            mnic->p_rx_irq[i]          (signal_irq_mnic_rx[i]);
+            mnic->p_tx_irq[i]          (signal_irq_mnic_tx[i]);
+        }
+
+        std::cout << "  - MNIC connected" << std::endl;
+
         // BROM
-        brom->p_clk                       	(this->p_clk);
-        brom->p_resetn                    	(this->p_resetn);
-        brom->p_vci                       	(signal_vci_tgt_d_brom);
+        brom->p_clk                    (this->p_clk);
+        brom->p_resetn                 (this->p_resetn);
+        brom->p_vci                    (signal_vci_tgt_d_brom);
 
         std::cout << "  - BROM connected" << std::endl;
 
         // MTTY
-        mtty->p_clk                       	(this->p_clk);
-        mtty->p_resetn                    	(this->p_resetn);
-        mtty->p_vci                       	(signal_vci_tgt_d_mtty);
+        mtty->p_clk                    (this->p_clk);
+        mtty->p_resetn                 (this->p_resetn);
+        mtty->p_vci                    (signal_vci_tgt_d_mtty);
         for ( size_t i=0 ; i<nb_ttys ; i++ )
         {
-            mtty->p_irq[i]           		(signal_irq_mtty[i]);
+            mtty->p_irq[i]           	(signal_irq_mtty[i]);
         }
 
