Changeset 323 for branches/v5/modules


Ignore:
Timestamp:
Mar 14, 2013, 10:59:55 AM (11 years ago)
Author:
joannou
Message:

removed unusefull flipflop r_*cache_cc_fifo_done + syntax correction (added an
"=" sign) in declaration of the arrau of string of state names

Location:
branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/include/vci_cc_vcache_wrapper.h

    r315 r323  
    376376    sc_signal<size_t>       r_icache_cc_word;               // word counter for cc update
    377377    sc_signal<bool>         r_icache_cc_need_write;     // activate the cache for writing
    378     sc_signal<bool>         r_icache_cc_fifo_done;      // tels when fifo is all poped
    379378
    380379    // icache flush handling
     
    450449    sc_signal<size_t>       r_dcache_cc_word;               // word counter for cc update
    451450    sc_signal<bool>         r_dcache_cc_need_write;     // activate the cache for writing
    452     sc_signal<bool>         r_dcache_cc_fifo_done;      // tels when fifo is all poped
    453451
    454452    // dcache flush handling
  • branches/v5/modules/vci_cc_vcache_wrapper_dspin_coherence/caba/source/src/vci_cc_vcache_wrapper.cpp

    r321 r323  
    140140    };
    141141
    142 const char *cc_receive_fsm_state_str[] {
     142const char *cc_receive_fsm_state_str[] = {
    143143        "CC_RECEIVE_IDLE",
    144144        "CC_RECEIVE_CLACK",
     
    152152    };
    153153
    154 const char *cc_send_fsm_state_str[] {
     154const char *cc_send_fsm_state_str[] = {
    155155        "CC_SEND_IDLE",
    156156        "CC_SEND_CLEANUP_1",
     
    255255      r_icache_cc_word("r_icache_cc_word"),
    256256      r_icache_cc_need_write("r_icache_cc_need_write"),
    257       r_icache_cc_fifo_done("r_icache_cc_fifo_done"),
    258257
    259258      r_icache_flush_count("r_icache_flush_count"),
     
    316315      r_dcache_cc_word("r_dcache_cc_word"),
    317316      r_dcache_cc_need_write("r_dcache_cc_need_write"),
    318       r_dcache_cc_fifo_done("r_dcache_cc_fifo_done"),
    319317
    320318      r_dcache_flush_count("r_dcache_flush_count"),
     
    17701768                // just pop the fifo , don't write in icache
    17711769                r_icache_cc_need_write = false;
    1772                 r_icache_cc_fifo_done = false;
    17731770            }
    17741771            // the request is dealt with
     
    18141811                    r_icache_fsm          = ICACHE_CC_UPDT;
    18151812                    r_icache_cc_word      = r_cc_receive_word_idx.read();
    1816                     r_icache_cc_fifo_done = false;
    18171813                }
    18181814                else if (r_cc_receive_icache_type.read() == CC_TYPE_INVAL)   // hit inval
     
    18341830                    // just pop the fifo , don't write in icache
    18351831                    r_icache_cc_need_write = false;
    1836                     r_icache_cc_fifo_done = false;
    18371832                }
    18381833                else // No response needed
     
    19101905        size_t  set   = r_icache_cc_set.read();
    19111906
    1912         if (not r_icache_cc_fifo_done.read())
    1913         {
    1914             if (r_cc_receive_updt_fifo_be.rok())
    1915             {
    1916                 if (r_icache_cc_need_write.read())
     1907        if (r_cc_receive_updt_fifo_be.rok())
     1908        {
     1909            if (r_icache_cc_need_write.read())
     1910            {
     1911                r_icache.write( way,
     1912                                set,
     1913                                word,
     1914                                r_cc_receive_updt_fifo_data.read(),
     1915                                r_cc_receive_updt_fifo_be.read() );
     1916
     1917                r_icache_cc_word = word+1;
     1918            }
     1919            if ( r_cc_receive_updt_fifo_eop.read() )    // last word
     1920            {
     1921                // no need to write in the cache anymore
     1922                r_icache_cc_need_write = false;
     1923                // wait to send a request to cc_send_fsm
     1924                if(not r_icache_cc_send_req.read()) // cc_send is available
    19171925                {
    1918                     r_icache.write( way,
    1919                                     set,
    1920                                     word,
    1921                                     r_cc_receive_updt_fifo_data.read(),
    1922                                     r_cc_receive_updt_fifo_be.read() );
    1923 
    1924                     r_icache_cc_word = word+1;
     1926                    // coherence request completed
     1927                    r_cc_receive_icache_req = false;
     1928                    // request multicast acknowledgement
     1929                    r_icache_cc_send_req = true;
     1930                    r_icache_cc_send_updt_tab_idx = r_cc_receive_icache_updt_tab_idx.read();
     1931                    r_icache_cc_send_type = CC_TYPE_MULTI_ACK;
     1932
     1933                    r_icache_fsm          = r_icache_fsm_save.read();
    19251934                }
    1926                 if ( r_cc_receive_updt_fifo_eop.read() )        // last word
    1927                 {
    1928                     // the fifo is all poped
    1929                     r_icache_cc_fifo_done = true;
    1930                     // no need to write in the cache anymore
    1931                     r_icache_cc_need_write = false;
    1932                 }
    1933                 //consume fifo
     1935            }
     1936            else
     1937            {
     1938                //consume fifo if not eop
    19341939                cc_receive_updt_fifo_get  = true;
    1935             }
    1936         }
    1937         else
    1938         {
    1939             // wait to send a request to cc_send_fsm
    1940             if(not r_icache_cc_send_req.read()) // cc_send is available
    1941             {
    1942                 // coherence request completed
    1943                 r_cc_receive_icache_req = false;
    1944                 // request multicast acknowledgement
    1945                 r_icache_cc_send_req = true;
    1946                 r_icache_cc_send_updt_tab_idx = r_cc_receive_icache_updt_tab_idx.read();
    1947                 r_icache_cc_send_type = CC_TYPE_MULTI_ACK;
    1948 
    1949                 r_icache_fsm          = r_icache_fsm_save.read();
    19501940            }
    19511941        }
     
    43924382                // just pop the fifo , don't write in icache
    43934383                r_dcache_cc_need_write = false;
    4394                 r_dcache_cc_fifo_done = false;
    43954384            }
    43964385            // the request is dealt with
     
    44384427                    r_dcache_fsm          = DCACHE_CC_UPDT;
    44394428                    r_dcache_cc_word      = r_cc_receive_word_idx.read();
    4440                     r_dcache_cc_fifo_done = false;
    44414429                }
    44424430                else if (r_cc_receive_dcache_type.read() == CC_TYPE_INVAL)   // hit inval
     
    44584446                    // just pop the fifo , don't write in icache
    44594447                    r_dcache_cc_need_write = false;
    4460                     r_dcache_cc_fifo_done = false;
    44614448                }
    44624449                else // No response needed
     
    45564543        size_t   set        = r_dcache_cc_set.read();
    45574544
    4558         if (not r_dcache_cc_fifo_done.read())
    4559         {
    4560             if (r_cc_receive_updt_fifo_be.rok())
    4561             {
    4562                 if (r_dcache_cc_need_write.read())
     4545        if (r_cc_receive_updt_fifo_be.rok())
     4546        {
     4547            if (r_dcache_cc_need_write.read())
     4548            {
     4549                if ( r_dcache_in_tlb[way*m_dcache_sets+set] )                   // selective TLB inval
    45634550                {
    4564                     if ( r_dcache_in_tlb[way*m_dcache_sets+set] )                       // selective TLB inval
     4551                    r_dcache_in_tlb[way*m_dcache_sets+set] = false;
     4552                    r_dcache_tlb_inval_line  = r_cc_receive_dcache_nline.read() / (m_dcache_words<<2);
     4553                    r_dcache_tlb_inval_set   = 0;
     4554                    r_dcache_fsm_scan_save   = r_dcache_fsm.read();
     4555                    r_dcache_fsm             = DCACHE_INVAL_TLB_SCAN;
     4556                    break;
     4557                }
     4558                else
     4559                {
     4560                    if ( r_dcache_contains_ptd[way*m_dcache_sets+set] )         // TLB flush
    45654561                    {
    4566                         r_dcache_in_tlb[way*m_dcache_sets+set] = false;
    4567                         r_dcache_tlb_inval_line  = r_cc_receive_dcache_nline.read() / (m_dcache_words<<2);
    4568                         r_dcache_tlb_inval_set   = 0;
    4569                         r_dcache_fsm_scan_save   = r_dcache_fsm.read();
    4570                         r_dcache_fsm             = DCACHE_INVAL_TLB_SCAN;
    4571                         break;
    4572                     }
    4573                     else
    4574                     {
    4575                         if ( r_dcache_contains_ptd[way*m_dcache_sets+set] )     // TLB flush
    4576                         {
    4577                             r_itlb.reset();
    4578                             r_dtlb.reset();
    4579                             r_dcache_contains_ptd[way*m_dcache_sets+set] = false;
     4562                        r_itlb.reset();
     4563                        r_dtlb.reset();
     4564                        r_dcache_contains_ptd[way*m_dcache_sets+set] = false;
    45804565
    45814566#if DEBUG_DCACHE
     
    45864571}
    45874572#endif
    4588                         }
     4573                    }
    45894574
    45904575#ifdef INSTRUMENTATION
    45914576m_cpt_dcache_data_write++;
    45924577#endif
    4593                         r_dcache.write( way,
    4594                                         set,
    4595                                         word,
    4596                                         r_cc_receive_updt_fifo_data.read(),
    4597                                         r_cc_receive_updt_fifo_be.read() );
    4598 
    4599                         r_dcache_cc_word = word + 1;
     4578                    r_dcache.write( way,
     4579                                    set,
     4580                                    word,
     4581                                    r_cc_receive_updt_fifo_data.read(),
     4582                                    r_cc_receive_updt_fifo_be.read() );
     4583
     4584                    r_dcache_cc_word = word + 1;
    46004585
    46014586#if DEBUG_DCACHE
     
    46104595}
    46114596#endif
    4612                     }
    46134597                }
    4614                 if ( r_cc_receive_updt_fifo_eop.read() )        // last word
     4598            }
     4599
     4600            if ( r_cc_receive_updt_fifo_eop.read() )    // last word
     4601            {
     4602                // no need to write in the cache anymore
     4603                r_dcache_cc_need_write = false;
     4604
     4605                // wait to send a request to cc_send_fsm
     4606                if(not r_icache_cc_send_req.read())
     4607                // cc_send is available
    46154608                {
    4616                     // the fifo is all poped
    4617                     r_dcache_cc_fifo_done = true;
    4618                     // no need to write in the cache anymore
    4619                     r_dcache_cc_need_write = false;
     4609                    //consume last fifo flit if eop and request to cc_send possible
     4610                    cc_receive_updt_fifo_get  = true;
     4611
     4612                    // coherence request completed
     4613                    r_cc_receive_dcache_req = false;
     4614
     4615                    // request multicast acknowledgement
     4616                    r_dcache_cc_send_req = true;
     4617                    r_dcache_cc_send_updt_tab_idx = r_cc_receive_dcache_updt_tab_idx.read();
     4618                    r_dcache_cc_send_type = CC_TYPE_MULTI_ACK;
     4619
     4620                    r_dcache_fsm          = r_dcache_fsm_cc_save.read();
    46204621                }
    4621                 //consume fifo
     4622            }
     4623            else
     4624            {
     4625                //consume fifo if not eop
    46224626                cc_receive_updt_fifo_get  = true;
    46234627            }
    4624         }
    4625         else
    4626         {
    4627             // wait to send a request to cc_send_fsm
    4628             if(not r_icache_cc_send_req.read()) // cc_send is available
    4629             {
    4630                 // coherence request completed
    4631                 r_cc_receive_dcache_req = false;
    4632                 // request multicast acknowledgement
    4633                 r_dcache_cc_send_req = true;
    4634                 r_dcache_cc_send_updt_tab_idx = r_cc_receive_dcache_updt_tab_idx.read();
    4635                 r_dcache_cc_send_type = CC_TYPE_MULTI_ACK;
    4636 
    4637                 r_dcache_fsm          = r_dcache_fsm_cc_save.read();
    4638             }
     4628
    46394629        }
    46404630        break;
Note: See TracChangeset for help on using the changeset viewer.