Index: /trunk/modules/vci_block_device_tsar/caba/source/include/vci_block_device_tsar.h
===================================================================
--- /trunk/modules/vci_block_device_tsar/caba/source/include/vci_block_device_tsar.h	(revision 521)
+++ /trunk/modules/vci_block_device_tsar/caba/source/include/vci_block_device_tsar.h	(revision 522)
@@ -117,7 +117,8 @@
     sc_signal<bool>                    r_go;           	   // command from T_FSM to M_FSM
 
-    sc_signal<sc_dt::sc_uint<vci_param::S> >	r_srcid;   // save srcid
-    sc_signal<sc_dt::sc_uint<vci_param::T> >	r_trdid;   // save trdid
-    sc_signal<sc_dt::sc_uint<vci_param::P> >	r_pktid;   // save pktid
+    sc_signal<typename vci_param::srcid_t >	r_srcid;   // save srcid
+    sc_signal<typename vci_param::trdid_t >	r_trdid;   // save trdid
+    sc_signal<typename vci_param::pktid_t >	r_pktid;   // save pktid
+    sc_signal<typename vci_param::data_t >	r_tdata;   // save wdata
 
     uint32_t*                          r_local_buffer; 	   // capacity is one block 
Index: /trunk/modules/vci_block_device_tsar/caba/source/src/vci_block_device_tsar.cpp
===================================================================
--- /trunk/modules/vci_block_device_tsar/caba/source/src/vci_block_device_tsar.cpp	(revision 521)
+++ /trunk/modules/vci_block_device_tsar/caba/source/src/vci_block_device_tsar.cpp	(revision 522)
@@ -65,4 +65,5 @@
             r_trdid = p_vci_target.trdid.read();
             r_pktid = p_vci_target.pktid.read();
+	    r_tdata = p_vci_target.wdata.read();
             sc_dt::sc_uint<vci_param::N> address = p_vci_target.address.read();
 
@@ -101,8 +102,14 @@
     case T_WRITE_BUFFER:
     {
-        if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() )  
-        {
-            r_buf_address = (uint64_t)p_vci_target.wdata.read();
-            r_target_fsm  = T_IDLE;
+	if (p_vci_target.rspack.read() ) {
+#ifdef SOCLIB_MODULE_DEBUG
+	    std::cout << "vci_bd WRITE_BUFFER " << r_tdata.read()
+		<< " status " << r_initiator_fsm.read() << std::endl;
+#endif
+            if (r_initiator_fsm.read() == M_IDLE)
+            {
+                r_buf_address = (uint64_t)r_tdata.read();
+                r_target_fsm  = T_IDLE;
+	    }
         }
         break;
@@ -111,9 +118,15 @@
     case T_WRITE_BUFFER_EXT:
     {
-        if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() )  
-        {
-            r_buf_address = r_buf_address.read() + 
-                            (((uint64_t)p_vci_target.wdata.read())<<32);
-            r_target_fsm  = T_IDLE;
+	if (p_vci_target.rspack.read() ) {
+#ifdef SOCLIB_MODULE_DEBUG
+	    std::cout << "vci_bd WRITE_BUFFER_EXT " << r_tdata.read()
+		<< " status " << r_initiator_fsm.read() << std::endl;
+#endif
+            if (r_initiator_fsm.read() == M_IDLE)
+            {
+                r_buf_address = r_buf_address.read() + 
+                            (((uint64_t)r_tdata.read())<<32);
+                r_target_fsm  = T_IDLE;
+	    }
         }
         break;
@@ -122,9 +135,15 @@
     case T_WRITE_COUNT:
     {
-        if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() )  
-        {
-            r_nblocks    = (uint32_t)p_vci_target.wdata.read();
-            r_target_fsm = T_IDLE;
-        }
+	if (p_vci_target.rspack.read() ) {
+#ifdef SOCLIB_MODULE_DEBUG
+	    std::cout << "vci_bd WRITE_COUNT " << r_tdata.read() <<
+		" status " << r_initiator_fsm.read() << std::endl;
+#endif
+            if (r_initiator_fsm.read() == M_IDLE)
+            {
+                r_nblocks    = (uint32_t)r_tdata.read();
+                r_target_fsm = T_IDLE;
+            }
+	}
         break;
     }
@@ -132,9 +151,14 @@
     case T_WRITE_LBA:
     {
-        if ( (r_initiator_fsm.read() == M_IDLE) and p_vci_target.rspack.read() )  
-        {
-            r_lba        = (uint32_t)p_vci_target.wdata.read();
-            r_target_fsm = T_IDLE;
-        }
+	if (p_vci_target.rspack.read() ) {
+#ifdef SOCLIB_MODULE_DEBUG
+	    std::cout << "vci_bd WRITE_LBA " << r_tdata.read() <<
+		" status " << r_initiator_fsm.read() << std::endl;
+#endif
+            if (r_initiator_fsm.read() == M_IDLE) {
+                r_lba        = (uint32_t)r_tdata.read();
+                r_target_fsm = T_IDLE;
+            }
+	}
         break;
     }
@@ -144,15 +168,25 @@
         if ( p_vci_target.rspack.read() )  
         {
-            if ( ((uint32_t)p_vci_target.wdata.read() == BLOCK_DEVICE_READ) and
+#ifdef SOCLIB_MODULE_DEBUG
+	    std::cout << "vci_bd WRITE_OP " << r_tdata.read() <<
+		" status " << r_initiator_fsm.read();
+#endif
+            if ( ((uint32_t)r_tdata.read() == BLOCK_DEVICE_READ) and
                  (r_initiator_fsm.read() == M_IDLE) )
             {
                 r_read = true;
                 r_go   = true;
-            }
-            else if ( ((uint32_t)p_vci_target.wdata.read() == BLOCK_DEVICE_WRITE) and
+#ifdef SOCLIB_MODULE_DEBUG
+		std::cout << " READ";
+#endif
+            }
+            else if ( ((uint32_t)r_tdata.read() == BLOCK_DEVICE_WRITE) and
                       (r_initiator_fsm.read() == M_IDLE) )
             {
                 r_read = false;
                 r_go   = true;
+#ifdef SOCLIB_MODULE_DEBUG
+		std::cout << " WRITE";
+#endif
             }
             else
@@ -161,4 +195,7 @@
             }
             r_target_fsm = T_IDLE;
+#ifdef SOCLIB_MODULE_DEBUG
+	    std::cout << std::endl;
+#endif
         }
         break;
@@ -169,6 +206,10 @@
         if ( p_vci_target.rspack.read() ) 
         {
+#ifdef SOCLIB_MODULE_DEBUG
+	    std::cout << "vci_bd WRITE_IRQEN " << r_tdata.read()
+		<< " status " << r_initiator_fsm.read() << std::endl;
+#endif
             r_target_fsm = T_IDLE;
-            r_irq_enable = (p_vci_target.wdata.read() != 0);
+            r_irq_enable = (r_tdata.read() != 0);
         }
         break;
@@ -248,4 +289,7 @@
             {
                 r_initiator_fsm = M_READ_ERROR;
+#ifdef SOCLIB_MODULE_DEBUG
+		std::cout << "vci_bd M_READ_ERROR" << std::endl;
+#endif
             }
             else   
@@ -345,4 +389,7 @@
             {
                 r_initiator_fsm = M_READ_ERROR;
+#ifdef SOCLIB_MODULE_DEBUG
+		std::cout << "vci_bd M_READ_ERROR" << std::endl;
+#endif
             }
             else if ( (not aligned and (r_burst_count.read() == m_bursts_per_block)) or 
@@ -352,4 +399,7 @@
                 {
                     r_initiator_fsm = M_READ_SUCCESS;
+#ifdef SOCLIB_MODULE_DEBUG
+		    std::cout << "vci_bd M_READ_SUCCESS" << std::endl;
+#endif
                 }
                 else                                              // last burst not last block
@@ -430,4 +480,7 @@
                 {
                     r_initiator_fsm = M_WRITE_ERROR;
+#ifdef SOCLIB_MODULE_DEBUG
+		    std::cout << "vci_bd M_WRITE_ERROR" << std::endl;
+#endif
                 }
                 else if ( (not aligned and (r_burst_count.read() == m_bursts_per_block)) or 
@@ -459,8 +512,14 @@
             {
                 r_initiator_fsm = M_WRITE_ERROR; 
+#ifdef SOCLIB_MODULE_DEBUG
+		std::cout << "vci_bd M_WRITE_ERROR" << std::endl;
+#endif
             }
             else if ( r_block_count.read() == r_nblocks.read() - 1 ) 
             {
                 r_initiator_fsm = M_WRITE_SUCCESS; 
+#ifdef SOCLIB_MODULE_DEBUG
+		std::cout << "vci_bd M_WRITE_SUCCESS" << std::endl;
+#endif
             }
             else
@@ -634,6 +693,10 @@
           (r_initiator_fsm == M_READ_ERROR)    ||
           (r_initiator_fsm == M_WRITE_ERROR) ) &&  
-         r_irq_enable.read() ) p_irq = true;
-    else			           p_irq = false;
+         r_irq_enable.read() ) {
+#ifdef SOCLIB_MODULE_DEBUG
+		std::cout << "vci_bd send IRQ" << std::endl;
+#endif
+		p_irq = true;
+    } else			           p_irq = false;
 } // end GenMoore()
 
