Index: /trunk/platforms/tsar_generic_iob/arch_info.py
===================================================================
--- /trunk/platforms/tsar_generic_iob/arch_info.py	(revision 1052)
+++ /trunk/platforms/tsar_generic_iob/arch_info.py	(revision 1053)
@@ -9,6 +9,7 @@
 #########################################################################################
 #  This python script defines a specific instance of "tsar_generic_iob" architecture
-#  for the ALMOS-MK operating system. It is used to generate the "hard_config.h" 
-#  and the "arch_info.bin files, used by bthe ALMOS-MK bootloader.
+#  for the ALMOS-MKH operating system. It is used to generate the "hard_config.h" file, 
+#  used to configure the hardware architecture, and the "arch_info.bin" file, used by 
+#  the ALMOS-MK bootloader.
 #
 #  The constructor prototype format is imposed by the genarch.py application,
@@ -31,7 +32,4 @@
 #  - fbf_width      : frame_buffer width = frame_buffer heigth
 #  - ioc_type       : can be 'IOC_BDV','IOC_HBA','IOC_SDC', 'IOC_SPI','NONE'
-#  - io_cxy         : IO cluster identifier
-#  - boot_cxy       : boot cluster identifier
-#  - cache_line     : number of bytes in cache line (in 16,32,64)
 #
 #  The following parameters are imposed by the "tsar_generic_iob" architecture:
@@ -42,4 +40,7 @@
 #  - p_width        : number of bits for local processor index
 #  - irqs_per_core  : number of input IRQs per processor
+#  - io_cxy         : IO cluster identifier
+#  - boot_cxy       : boot cluster identifier
+#  - cache_line     : number of bytes in cache line (in 16,32,64)
 ########################################################################################
 
@@ -51,8 +52,5 @@
           nb_nics       = 1, 
           fbf_width     = 128,
-          ioc_type      = 'IOC_BDV',
-          io_cxy        = 0,
-          boot_cxy      = 0, 
-          cache_line    = 64):
+          ioc_type      = 'IOC_BDV'):
 
     ### architecture constants
@@ -64,4 +62,7 @@
     irqs_per_core = 4           
     devices_max   = 16  
+    boot_cxy      = 0
+    cache_line    = 64
+    io_cxy        = ((x_size-1)<<y_width) + (y_size-1)   # upper right cluster
 
     ### constructor parameters checking
@@ -182,8 +183,6 @@
                                    channels = nb_cores )
 
-            archi.addIrq( dstdev = xcu, port = 1, srcdev = dma, channel = 0 )
-            archi.addIrq( dstdev = xcu, port = 2, srcdev = dma, channel = 1 )
-            archi.addIrq( dstdev = xcu, port = 3, srcdev = dma, channel = 2 )
-            archi.addIrq( dstdev = xcu, port = 4, srcdev = dma, channel = 3 )
+            for i in xrange( nb_cores ):
+                archi.addIrq( dstdev = xcu, port = i+1 , srcdev = dma, channel = i )
 
             # define external devices
@@ -244,4 +243,13 @@
                 archi.addIrq( dstdev = pic, port = 23, srcdev = tty, channel = 7 , is_rx = True )
 
+                archi.addIrq( dstdev = pic, port = 24, srcdev = tty, channel = 0 , is_rx = False )
+                archi.addIrq( dstdev = pic, port = 25, srcdev = tty, channel = 1 , is_rx = False )
+                archi.addIrq( dstdev = pic, port = 26, srcdev = tty, channel = 2 , is_rx = False )
+                archi.addIrq( dstdev = pic, port = 27, srcdev = tty, channel = 3 , is_rx = False )
+                archi.addIrq( dstdev = pic, port = 28, srcdev = tty, channel = 4 , is_rx = False )
+                archi.addIrq( dstdev = pic, port = 29, srcdev = tty, channel = 5 , is_rx = False )
+                archi.addIrq( dstdev = pic, port = 30, srcdev = tty, channel = 6 , is_rx = False )
+                archi.addIrq( dstdev = pic, port = 31, srcdev = tty, channel = 7 , is_rx = False )
+
             # define cores
             for p in xrange ( nb_cores ):
Index: /trunk/platforms/tsar_generic_iob/top.cpp
===================================================================
--- /trunk/platforms/tsar_generic_iob/top.cpp	(revision 1052)
+++ /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;
+                }
             }
         }
Index: /trunk/platforms/tsar_generic_iob/top.desc
===================================================================
--- /trunk/platforms/tsar_generic_iob/top.desc	(revision 1052)
+++ /trunk/platforms/tsar_generic_iob/top.desc	(revision 1053)
@@ -69,5 +69,5 @@
 
             # TTY
-            Uses('caba:vci_multi_tty', 
+            Uses('caba:vci_tty_tsar', 
                   cell_size = vci_cell_size_ext),
 
