Index: trunk/platforms/tsar_generic_iob/top.cpp
===================================================================
--- trunk/platforms/tsar_generic_iob/top.cpp	(revision 1051)
+++ trunk/platforms/tsar_generic_iob/top.cpp	(revision 1053)
@@ -11,5 +11,5 @@
 // - BROM : boot ROM
 // - FBUF : Frame Buffer
-// - MTTY : multi TTY (one channel)
+// - MTTY : multi TTY (up to 8 channels)
 // - MNIC : Network controller (up to 4 channels)
 // - DISK : Block device controler (BDV / HBA / SDC)
@@ -44,5 +44,6 @@
 // - IOPIC HWI[7:4]     connected to IRQ_NIC_TX[3:0]
 // - IOPIC HWI[12]      connected to IRQ_IOC 
-// - IOPIC HWI[31:16]   connected to IRQ_TTY_RX[15:0]
+// - IOPIC HWI[23:16]   connected to IRQ_TTY_RX[7:0]
+// - IOPIC HWI[31:24]   connected to IRQ_TTY_TX[7:0]
 //
 // Each cluster contains the following component:
@@ -135,5 +136,5 @@
 #include "tsar_iob_cluster.h"
 #include "vci_chbuf_dma.h"
-#include "vci_multi_tty.h"
+#include "vci_tty_tsar.h"
 #include "vci_master_nic.h"
 #include "vci_simple_rom.h"
@@ -460,5 +461,5 @@
    "Error in tsar_generic_iob : ICU_NB_OUT cannot be smaller than 4*NB_PROCS_MAX" );
    
-   assert( (NB_TXT_CHANNELS >= 1) and (NB_TXT_CHANNELS <= 16) and
+   assert( (NB_TXT_CHANNELS >= 1) and (NB_TXT_CHANNELS <= 8) and
    "Error in tsar_generic_iob : NB_TXT_CHANNELS parameter cannot be larger than 16" );
 
@@ -821,4 +822,5 @@
     sc_signal<bool>                   signal_irq_disk;
     sc_signal<bool>                   signal_irq_mtty_rx[NB_TXT_CHANNELS];
+    sc_signal<bool>                   signal_irq_mtty_tx[NB_TXT_CHANNELS];
     sc_signal<bool>                   signal_irq_mnic_rx[NB_NIC_CHANNELS];
     sc_signal<bool>                   signal_irq_mnic_tx[NB_NIC_CHANNELS];
@@ -1072,5 +1074,5 @@
 #endif
 
-    // Multi-TTY controller
+    // TTY controller
     std::vector<std::string> vect_names;
     for( size_t tid = 0 ; tid < NB_TXT_CHANNELS ; tid++ )
@@ -1080,10 +1082,10 @@
  
          vect_names.push_back(term_name.str().c_str());
-      }
-      VciMultiTty<vci_param_ext>*  mtty;
-      mtty = new VciMultiTty<vci_param_ext>( "mtty",
-                                             IntTab(0, IOX_MTTY_TGT_ID),
-                                             maptab_iox,
-                                             vect_names);
+    }
+    VciTtyTsar<vci_param_ext>*  mtty;
+    mtty = new VciTtyTsar<vci_param_ext>( "mtty",
+                                          IntTab(0, IOX_MTTY_TGT_ID),
+                                          maptab_iox,
+                                          vect_names);
 
     // IOPIC
@@ -1335,5 +1337,6 @@
     for ( size_t i=0 ; i<NB_TXT_CHANNELS ; i++ )
     {
-        mtty->p_irq[i]                                   (signal_irq_mtty_rx[i]);
+        mtty->p_irq_rx[i]                                (signal_irq_mtty_rx[i]);
+        mtty->p_irq_tx[i]                                (signal_irq_mtty_tx[i]);
     }
     std::cout << "  - MTTY connected" << std::endl;
@@ -1353,4 +1356,6 @@
        else if(i < 16)                 iopi->p_hwi[i] (signal_irq_false);
        else if(i < 16+NB_TXT_CHANNELS) iopi->p_hwi[i] (signal_irq_mtty_rx[i-16]);
+       else if(i < 24)                 iopi->p_hwi[i] (signal_irq_false);
+       else if(i < 24+NB_TXT_CHANNELS) iopi->p_hwi[i] (signal_irq_mtty_tx[i-24]);
        else                            iopi->p_hwi[i] (signal_irq_false);
     }
@@ -1651,11 +1656,11 @@
 
         // Monitor a specific address for one L1 cache
-        // clusters[0][0]->proc[0]->cache_monitor(0x800080ULL);
+        // clusters[0][0]->proc[0]->cache_monitor( 0x00032D74ULL );
 
         // Monitor a specific address for one L2 cache (single word if second argument true)
-        // clusters[0][0]->memc->cache_monitor( 0x00007000ULL, false  );
+        // clusters[0][0]->memc->cache_monitor( 0x00032D74ULL, false  );
 
         // Monitor a specific address for one XRAM
-        // clusters[0][0]->xram->start_monitor( 0x00007000ULL , 64);
+        // clusters[0][0]->xram->start_monitor( 0x0008A000ULL , 64);
 
         if ( debug_ok and (n > debug_from) )
@@ -1671,5 +1676,12 @@
                 size_t x          = cluster_xy >> 4;
                 size_t y          = cluster_xy & 0xF;
-
+/*
+            size_t l          = 0;
+            size_t x          = 0;
+            size_t y;
+            
+            for( y = 0 ; y < 2 ; y++ )
+            {
+*/
                 clusters[x][y]->proc[l]->print_trace(0x1);
                 std::ostringstream proc_signame;
@@ -1748,6 +1760,6 @@
 //              signal_vci_tgt_brom.print_trace("[SIG]BROM_TGT");
 
-//              mtty->print_trace();
-//              signal_vci_tgt_mtty.print_trace("[SIG]MTTY_TGT");
+                mtty->print_trace( 1 );
+                signal_vci_tgt_mtty.print_trace("[SIG]MTTY_TGT");
 
 //              disk->print_trace();
@@ -1759,14 +1771,14 @@
 #endif
 
-                mnic->print_trace( 0 );
-                signal_vci_tgt_mnic.print_trace("[SIG]MNIC_TGT");
-                signal_vci_ini_mnic.print_trace("[SIG]MNIC_INI");
+//              mnic->print_trace( 0 );
+//              signal_vci_tgt_mnic.print_trace("[SIG]MNIC_TGT");
+//              signal_vci_ini_mnic.print_trace("[SIG]MNIC_INI");
 
 //              fbuf->print_trace();
 //              signal_vci_tgt_fbuf.print_trace("[SIG]FBUF_TGT");
 
-//              iopi->print_trace();
-//              signal_vci_ini_iopi.print_trace("[SIG]IOPI_INI");
-//              signal_vci_tgt_iopi.print_trace("[SIG]IOPI_TGT");
+                iopi->print_trace();
+                signal_vci_ini_iopi.print_trace("[SIG]IOPI_INI");
+                signal_vci_tgt_iopi.print_trace("[SIG]IOPI_TGT");
 
 //              iox_network->print_trace();
@@ -1776,12 +1788,21 @@
                 std::cout << "### IRQ_DISK ACTIVE" << std::endl;
 
-                if ( signal_irq_mtty_rx[0].read() ) 
-                std::cout << "### IRQ_MTTY_RX[0] ACTIVE" << std::endl;
-
-                if ( signal_irq_mnic_rx[0].read() ) 
-                std::cout << "### IRQ_MNIC_RX[0] ACTIVE" << std::endl;
-
-                if ( signal_irq_mnic_tx[0].read() ) 
-                std::cout << "### IRQ_MNIC_TX[0] ACTIVE" << std::endl;
+                for( size_t k = 0 ; k < NB_TXT_CHANNELS ; k++ )
+                {
+                    if ( signal_irq_mtty_rx[k].read() ) 
+                    std::cout << "### IRQ_MTTY_RX[" << k << "] ACTIVE" << std::endl;
+
+                    if ( signal_irq_mtty_tx[k].read() ) 
+                    std::cout << "### IRQ_MTTY_TX[" << k << "] ACTIVE" << std::endl;
+                }
+
+                for( size_t k = 0 ; k < NB_NIC_CHANNELS ; k++ )
+                {
+                    if ( signal_irq_mnic_rx[k].read() ) 
+                    std::cout << "### IRQ_MNIC_RX[" << k << "] ACTIVE" << std::endl;
+
+                    if ( signal_irq_mnic_tx[k].read() ) 
+                    std::cout << "### IRQ_MNIC_TX[" << k << "] ACTIVE" << std::endl;
+                }
             }
         }
