Changeset 668


Ignore:
Timestamp:
Apr 2, 2014, 4:11:10 PM (11 years ago)
Author:
porquet
Message:

cc_vcache v5: add support for XTN::DEBUG_MASK

Differentiate three types of debugging: icache, dcache and cmd. Make it
possible to set up the mask, via a XTN command (e.g. by the GDB server).

See the wikipage on GDB server for more information ("monitor
cachedebug" section).

Location:
trunk/modules/vci_cc_vcache_wrapper/caba/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h

    r616 r668  
    335335    bool                                m_debug_previous_i_hit;
    336336    bool                                m_debug_previous_d_hit;
    337     bool                                m_debug_activated;
     337    bool                                m_debug_icache_fsm;
     338    bool                                m_debug_dcache_fsm;
     339    bool                                m_debug_cmd_fsm;
    338340
    339341    ///////////////////////////////
  • trunk/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp

    r627 r668  
    809809        m_debug_previous_i_hit     = false;
    810810        m_debug_previous_d_hit     = false;
    811         m_debug_activated              = false;
     811        m_debug_icache_fsm             = false;
     812        m_debug_dcache_fsm             = false;
     813        m_debug_cmd_fsm                = false;
    812814
    813815        // activity counters
     
    950952    m_cpt_total_cycles++;
    951953
    952     m_debug_activated = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
     954    m_debug_icache_fsm = m_debug_icache_fsm ||
     955        ((m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok);
     956    m_debug_dcache_fsm = m_debug_dcache_fsm ||
     957        ((m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok);
     958    m_debug_cmd_fsm = m_debug_cmd_fsm ||
     959        ((m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok);
    953960
    954961    /////////////////////////////////////////////////////////////////////
     
    12091216                    r_icache_fsm      = ICACHE_MISS_SELECT;
    12101217#if DEBUG_ICACHE
    1211 if ( m_debug_activated )
     1218if ( m_debug_icache_fsm )
    12121219std::cout << "  <PROC " << name() << " ICACHE_IDLE> READ MISS in icache"
    12131220          << " : PADDR = " << std::hex << paddr << std::endl;
     
    12311238                    r_icache_fsm       = ICACHE_IDLE;
    12321239#if DEBUG_ICACHE
    1233 if ( m_debug_activated )
     1240if ( m_debug_icache_fsm )
    12341241std::cout << "  <PROC " << name() << " ICACHE_IDLE> READ HIT in icache"
    12351242          << " : PADDR = " << std::hex << paddr << std::endl;
     
    12431250
    12441251#if DEBUG_ICACHE
    1245 if ( m_debug_activated )
     1252if ( m_debug_icache_fsm )
    12461253{
    12471254    std::cout << "  <PROC " << name()
     
    15891596
    15901597#if DEBUG_ICACHE
    1591 if ( m_debug_activated )
     1598if ( m_debug_icache_fsm )
    15921599{
    15931600    std::cout << "  <PROC " << name()
     
    16141621                            CACHE_SLOT_STATE_ZOMBI);
    16151622#if DEBUG_ICACHE
    1616 if ( m_debug_activated )
     1623if ( m_debug_icache_fsm )
    16171624{
    16181625    std::cout << "  <PROC " << name()
     
    16891696                            r_vci_rsp_fifo_icache.read() );
    16901697#if DEBUG_ICACHE
    1691 if ( m_debug_activated )
     1698if ( m_debug_icache_fsm )
    16921699{
    16931700    std::cout << "  <PROC " << name()
     
    17671774                                        CACHE_SLOT_STATE_ZOMBI );
    17681775#if DEBUG_ICACHE
    1769 if ( m_debug_activated )
     1776if ( m_debug_icache_fsm )
    17701777{
    17711778    std::cout << "  <PROC " << name()
     
    17911798                                    CACHE_SLOT_STATE_VALID );
    17921799#if DEBUG_ICACHE
    1793 if ( m_debug_activated )
     1800if ( m_debug_icache_fsm )
    17941801{
    17951802    std::cout << "  <PROC " << name()
     
    18861893
    18871894#if DEBUG_ICACHE
    1888 if ( m_debug_activated )
     1895if ( m_debug_icache_fsm )
    18891896{
    18901897    std::cout << "  <PROC " << name()
     
    19271934            }
    19281935#if DEBUG_ICACHE
    1929 if ( m_debug_activated )
     1936if ( m_debug_icache_fsm )
    19301937{
    19311938    std::cout << "  <PROC " << name()
     
    20132020
    20142021#if DEBUG_ICACHE
    2015 if ( m_debug_activated )
     2022if ( m_debug_icache_fsm )
    20162023{
    20172024std::cout << "  <PROC " << name()
     
    20532060
    20542061#if DEBUG_ICACHE
    2055 if ( m_debug_activated )
     2062if ( m_debug_icache_fsm )
    20562063{
    20572064    std::cout << "  <PROC " << name()
     
    23142321
    23152322#if DEBUG_DCACHE
    2316 if ( m_debug_activated )
     2323if ( m_debug_dcache_fsm )
    23172324std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
    23182325          << " Cache update in P1 stage" << std::dec
     
    26012608                            break;
    26022609
     2610                    case iss_t::XTN_DEBUG_MASK:     // debug mask
     2611                        m_debug_dcache_fsm = ((m_dreq.wdata & 0x1) != 0);
     2612                        m_debug_icache_fsm = ((m_dreq.wdata & 0x2) != 0);
     2613                        m_debug_cmd_fsm = ((m_dreq.wdata & 0x4) != 0);
     2614                        m_drsp.valid = true;
     2615                        r_dcache_fsm = DCACHE_IDLE;
     2616                        break;
     2617
    26032618                    default:
    26042619                        r_mmu_detr   = MMU_WRITE_UNDEFINED_XTN;
     
    26582673                            m_drsp.rdata = 0;
    26592674#if DEBUG_DCACHE
    2660 if ( m_debug_activated )
     2675if ( m_debug_dcache_fsm )
    26612676std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
    26622677          << " HIT in dtlb, but privilege violation" << std::endl;
     
    26742689                            m_drsp.rdata = 0;
    26752690#if DEBUG_DCACHE
    2676 if ( m_debug_activated )
     2691if ( m_debug_dcache_fsm )
    26772692std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
    26782693          << " HIT in dtlb, but writable violation" << std::endl;
     
    27152730                                r_dcache_fsm          = DCACHE_MISS_SELECT;
    27162731#if DEBUG_DCACHE
    2717 if ( m_debug_activated )
     2732if ( m_debug_dcache_fsm )
    27182733std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
    27192734          << " READ MISS in dcache"
     
    27262741                                r_dcache_fsm   = DCACHE_IDLE;
    27272742#if DEBUG_DCACHE
    2728 if ( m_debug_activated )
     2743if ( m_debug_dcache_fsm )
    27292744std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
    27302745          << " Pending cleanup, stalled until cleanup acknowledge"
     
    27422757                                m_drsp.rdata   = cache_rdata;
    27432758#if DEBUG_DCACHE
    2744 if ( m_debug_activated )
     2759if ( m_debug_dcache_fsm )
    27452760std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
    27462761          << " READ HIT in dcache"
     
    27572772                            r_dcache_fsm            = DCACHE_UNC_WAIT;
    27582773#if DEBUG_DCACHE
    2759 if ( m_debug_activated )
     2774if ( m_debug_dcache_fsm )
    27602775std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
    27612776          << " READ UNCACHEABLE in dcache"
     
    29552970
    29562971#if DEBUG_DCACHE
    2957 if ( m_debug_activated )
     2972if ( m_debug_dcache_fsm )
    29582973{
    29592974    if ( r_dcache_tlb_ins.read() )
     
    30253040
    30263041#if DEBUG_DCACHE
    3027 if ( m_debug_activated )
     3042if ( m_debug_dcache_fsm )
    30283043{
    30293044    std::cout << "  <PROC " << name()
     
    30623077
    30633078#if DEBUG_DCACHE
    3064 if ( m_debug_activated )
     3079if ( m_debug_dcache_fsm )
    30653080{
    30663081    std::cout << "  <PROC " << name()
     
    30843099
    30853100#if DEBUG_DCACHE
    3086 if ( m_debug_activated )
     3101if ( m_debug_dcache_fsm )
    30873102{
    30883103    std::cout << "  <PROC " << name()
     
    31113126
    31123127#if DEBUG_DCACHE
    3113 if ( m_debug_activated )
     3128if ( m_debug_dcache_fsm )
    31143129{
    31153130    std::cout << "  <PROC " << name()
     
    31523167
    31533168#if DEBUG_DCACHE
    3154 if ( m_debug_activated )
     3169if ( m_debug_dcache_fsm )
    31553170{
    31563171    if ( r_dcache_tlb_ins.read() )
     
    32243239
    32253240#if DEBUG_DCACHE
    3226 if ( m_debug_activated )
     3241if ( m_debug_dcache_fsm )
    32273242{
    32283243    std::cout << "  <PROC " << name()
     
    32483263
    32493264#if DEBUG_DCACHE
    3250 if ( m_debug_activated )
     3265if ( m_debug_dcache_fsm )
    32513266{
    32523267    std::cout << "  <PROC " << name()
     
    32653280
    32663281#if DEBUG_DCACHE
    3267 if ( m_debug_activated )
     3282if ( m_debug_dcache_fsm )
    32683283{
    32693284    std::cout << "  <PROC " << name()
     
    33333348
    33343349#if DEBUG_DCACHE
    3335 if ( m_debug_activated )
     3350if ( m_debug_dcache_fsm )
    33363351{
    33373352    std::cout << "  <PROC " << name()
     
    33533368
    33543369#if DEBUG_DCACHE
    3355 if ( m_debug_activated )
     3370if ( m_debug_dcache_fsm )
    33563371{
    33573372    std::cout << "  <PROC " << name()
     
    33693384
    33703385#if DEBUG_DCACHE
    3371 if ( m_debug_activated )
     3386if ( m_debug_dcache_fsm )
    33723387{
    33733388    std::cout << "  <PROC " << name()
     
    33863401
    33873402#if DEBUG_DCACHE
    3388 if ( m_debug_activated )
     3403if ( m_debug_dcache_fsm )
    33893404{
    33903405    std::cout << "  <PROC " << name()
     
    34243439
    34253440#if DEBUG_DCACHE
    3426 if ( m_debug_activated )
     3441if ( m_debug_dcache_fsm )
    34273442{
    34283443    if ( r_dcache_tlb_ins.read() )
     
    35003515
    35013516#if DEBUG_DCACHE
    3502 if ( m_debug_activated )
     3517if ( m_debug_dcache_fsm )
    35033518{
    35043519    std::cout << "  <PROC " << name()
     
    35243539
    35253540#if DEBUG_DCACHE
    3526 if ( m_debug_activated )
     3541if ( m_debug_dcache_fsm )
    35273542{
    35283543    std::cout << "  <PROC " << name()
     
    35423557
    35433558#if DEBUG_DCACHE
    3544 if ( m_debug_activated )
     3559if ( m_debug_dcache_fsm )
    35453560{
    35463561    std::cout << "  <PROC " << name()
     
    35553570    {
    35563571#if DEBUG_DCACHE
    3557 if ( m_debug_activated )
     3572if ( m_debug_dcache_fsm )
    35583573{
    35593574    std::cout << "  <PROC " << name()
     
    36083623        {
    36093624#if DEBUG_DCACHE
    3610 if ( m_debug_activated )
     3625if ( m_debug_dcache_fsm )
    36113626{
    36123627    std::cout << "  <PROC " << name()
     
    36233638    {
    36243639#if DEBUG_DCACHE
    3625 if ( m_debug_activated )
     3640if ( m_debug_dcache_fsm )
    36263641{
    36273642    std::cout << "  <PROC " << name()
     
    38943909
    38953910#if DEBUG_DCACHE
    3896 if ( m_debug_activated )
     3911if ( m_debug_dcache_fsm )
    38973912{
    38983913    std::cout << "  <PROC " << name()
     
    39373952
    39383953#if DEBUG_DCACHE
    3939 if ( m_debug_activated )
     3954if ( m_debug_dcache_fsm )
    39403955{
    39413956    std::cout << "  <PROC " << name()
     
    39974012
    39984013#if DEBUG_DCACHE
    3999 if ( m_debug_activated )
     4014if ( m_debug_dcache_fsm )
    40004015{
    40014016    std::cout << "  <PROC " << name()
     
    40934108
    40944109#if DEBUG_DCACHE
    4095 if ( m_debug_activated )
     4110if ( m_debug_dcache_fsm )
    40964111{
    40974112    std::cout << "  <PROC " << name()
     
    41234138                            CACHE_SLOT_STATE_ZOMBI );
    41244139#if DEBUG_DCACHE
    4125 if ( m_debug_activated )
     4140if ( m_debug_dcache_fsm )
    41264141{
    41274142    std::cout << "  <PROC " << name()
     
    42684283                                r_vci_rsp_fifo_dcache.read() );
    42694284#if DEBUG_DCACHE
    4270 if ( m_debug_activated )
     4285if ( m_debug_dcache_fsm )
    42714286{
    42724287    std::cout << "  <PROC " << name()
     
    43464361                                        CACHE_SLOT_STATE_ZOMBI );
    43474362#if DEBUG_DCACHE
    4348 if ( m_debug_activated )
     4363if ( m_debug_dcache_fsm )
    43494364std::cout << "  <PROC " << name()
    43504365          << " DCACHE_MISS_DIR_UPDT> Switch slot to ZOMBI state"
     
    43694384
    43704385#if DEBUG_DCACHE
    4371 if ( m_debug_activated )
     4386if ( m_debug_dcache_fsm )
    43724387std::cout << "  <PROC " << name()
    43734388          << " DCACHE_MISS_DIR_UPDT> Switch slot to VALID state"
     
    45744589
    45754590#if DEBUG_DCACHE
    4576 if ( m_debug_activated )
     4591if ( m_debug_dcache_fsm )
    45774592{
    45784593    std::cout << "  <PROC " << name()
     
    46224637
    46234638#if DEBUG_DCACHE
    4624 if ( m_debug_activated )
     4639if ( m_debug_dcache_fsm )
    46254640{
    46264641    std::cout << "  <PROC " << name()
     
    46704685
    46714686#if DEBUG_DCACHE
    4672 if ( m_debug_activated )
     4687if ( m_debug_dcache_fsm )
    46734688{
    46744689    std::cout << "  <PROC " << name()
     
    47134728
    47144729#if DEBUG_DCACHE
    4715 if ( m_debug_activated )
     4730if ( m_debug_dcache_fsm )
    47164731{
    47174732    std::cout << "  <PROC " << name()
     
    47744789
    47754790#if DEBUG_DCACHE
    4776 if ( m_debug_activated )
     4791if ( m_debug_dcache_fsm )
    47774792{
    47784793    std::cout << "  <PROC " << name()
     
    48114826
    48124827#if DEBUG_DCACHE
    4813 if ( m_debug_activated )
     4828if ( m_debug_dcache_fsm )
    48144829{
    48154830    std::cout << "  <PROC " << name()
     
    48374852
    48384853#if DEBUG_DCACHE
    4839 if ( m_debug_activated )
     4854if ( m_debug_dcache_fsm )
    48404855{
    48414856    std::cout << "  <PROC " << name()
     
    48734888
    48744889#if DEBUG_DCACHE
    4875 if ( m_debug_activated )
     4890if ( m_debug_dcache_fsm )
    48764891{
    48774892    std::cout << "  <PROC " << name()
     
    49024917
    49034918#if DEBUG_DCACHE
    4904 if ( m_debug_activated )
     4919if ( m_debug_dcache_fsm )
    49054920{
    49064921    std::cout << "  <PROC " << name()
     
    49634978
    49644979#if DEBUG_DCACHE
    4965 if ( m_debug_activated and ok )
     4980if ( m_debug_dcache_fsm and ok )
    49664981{
    49674982    std::cout << "  <PROC " << name()
     
    49794994
    49804995#if DEBUG_DCACHE
    4981 if ( m_debug_activated and ok )
     4996if ( m_debug_dcache_fsm and ok )
    49824997std::cout << "  <PROC " << name() << " DCACHE_INVAL_TLB_SCAN>"
    49834998          << " Invalidate DTLB entry" << std::hex
     
    51845199
    51855200#if DEBUG_CMD
    5186 if ( m_debug_activated )
     5201if ( m_debug_cmd_fsm )
    51875202{
    51885203std::cout << "  <PROC " << name() << " CMD_IDLE>"
Note: See TracChangeset for help on using the changeset viewer.