Changeset 1037
- Timestamp:
- Mar 3, 2016, 4:03:06 PM (9 years ago)
- Location:
- trunk/modules/vci_mem_cache/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r1036 r1037 189 189 READ_TRT_LOCK, 190 190 READ_TRT_SET, 191 READ_TRT_REQ 191 READ_TRT_REQ, 192 READ_WAIT 192 193 }; 193 194 -
trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r1036 r1037 160 160 "READ_TRT_LOCK", 161 161 "READ_TRT_SET", 162 "READ_TRT_REQ" 162 "READ_TRT_REQ", 163 "READ_WAIT" 163 164 }; 164 165 const char *write_fsm_str[] = … … 2984 2985 if (!wok) m_cpt_trt_full++; 2985 2986 if (hit_read or hit_write) m_cpt_trt_rb++; 2986 r_read_fsm = READ_ IDLE;2987 r_read_fsm = READ_WAIT; 2987 2988 } 2988 2989 else // missing line is requested to the XRAM … … 3037 3038 3038 3039 ////////////////// 3039 case READ_TRT_REQ: // consume the read request in FIFO andsend it to IXR_CMD_FSM3040 case READ_TRT_REQ: // consume read request in FIFO / send it to IXR_CMD_FSM 3040 3041 { 3041 3042 if (not r_read_to_ixr_cmd_req) … … 3057 3058 break; 3058 3059 } 3060 3061 /////////////// 3062 case READ_WAIT: // release the locks protecting the shared ressources 3063 { 3064 3065 #if DEBUG_MEMC_READ 3066 if (m_debug) 3067 { 3068 std::cout << " <MEMC " << name() 3069 << " READ_WAIT> Releases the locks before retry" << std::endl; 3070 } 3071 #endif 3072 r_read_fsm = READ_DIR_REQ; 3073 break; 3074 } 3075 3059 3076 } // end switch read_fsm 3060 3077 … … 7896 7913 // compute dir_allocate, that is actually a release condition: 7897 7914 // allocation can be done if the owner FSM doest not use the cache 7915 // The oner FSM get the lowest priority (registerd in dir_last) 7916 // only if the DIR access is a success. 7898 7917 bool dir_allocate = false; 7899 int dir_last ;7918 int dir_last = r_alloc_dir_last.read(); 7900 7919 switch(r_alloc_dir_fsm.read()) 7901 7920 { … … 7921 7940 (r_alloc_trt_fsm.read() == ALLOC_TRT_READ))) 7922 7941 { 7923 dir_last = ALLOC_DIR_READ;7924 7942 dir_allocate = true; 7943 if ( r_read_fsm.read() != READ_WAIT ) dir_last = ALLOC_DIR_READ; 7925 7944 } 7926 7945 break; … … 7944 7963 (r_alloc_trt_fsm.read() == ALLOC_TRT_WRITE))) 7945 7964 { 7946 dir_last = ALLOC_DIR_WRITE;7947 7965 dir_allocate = true; 7966 if ( r_write_fsm.read() != WRITE_WAIT ) dir_last = ALLOC_DIR_WRITE; 7948 7967 } 7949 7968 break; … … 7968 7987 (r_alloc_trt_fsm.read() == ALLOC_TRT_CAS))) 7969 7988 { 7970 dir_last = ALLOC_DIR_CAS;7971 7989 dir_allocate = true; 7990 if ( r_cas_fsm.read() != CAS_WAIT ) dir_last = ALLOC_DIR_CAS; 7972 7991 } 7973 7992 break; … … 7981 8000 (r_config_fsm.read() != CONFIG_IVT_LOCK)) 7982 8001 { 8002 dir_allocate = true; 7983 8003 dir_last = ALLOC_DIR_CONFIG; 7984 dir_allocate = true;7985 8004 } 7986 8005 break; … … 7993 8012 (r_cleanup_fsm.read() != CLEANUP_HEAP_LOCK)) 7994 8013 { 8014 dir_allocate = true; 7995 8015 dir_last = ALLOC_DIR_CLEANUP; 7996 dir_allocate = true;7997 8016 } 7998 8017 … … 8005 8024 (r_xram_rsp_fsm.read() != XRAM_RSP_IVT_LOCK)) 8006 8025 { 8007 dir_last = r_alloc_dir_last.read();8008 8026 dir_allocate = true; 8009 8027 } … … 8096 8114 8097 8115 // Compute trt_allocate, that is actually a release condition: 8098 // allocation can be done if owner FSM does not use the TRT 8116 // allocation can be done if owner FSM release the TRT 8117 // The owner FSM get the lowest priority (registered in trt_last) 8118 // but only if the access to TRT is successful 8099 8119 bool trt_allocate = false; 8100 int trt_last ;8120 int trt_last = r_alloc_trt_last.read(); 8101 8121 switch(r_alloc_trt_fsm.read()) 8102 8122 { … … 8105 8125 (r_read_fsm.read() != READ_TRT_SET)) 8106 8126 { 8107 trt_last = ALLOC_TRT_READ;8108 8127 trt_allocate = true; 8128 if ( r_read_fsm.read() != READ_WAIT ) trt_last = ALLOC_TRT_READ; 8109 8129 } 8110 8130 break; … … 8117 8137 (r_write_fsm.read() != WRITE_BC_DIR_INVAL)) 8118 8138 { 8119 trt_last = ALLOC_TRT_WRITE;8120 8139 trt_allocate = true; 8140 if ( r_write_fsm.read() != WRITE_WAIT ) trt_last = ALLOC_TRT_WRITE; 8121 8141 } 8122 8142 break; … … 8128 8148 (r_cas_fsm.read() != CAS_BC_DIR_INVAL)) 8129 8149 { 8130 trt_last = ALLOC_TRT_CAS;8131 8150 trt_allocate = true; 8151 if ( r_cas_fsm.read() != CAS_WAIT ) trt_last = ALLOC_TRT_CAS; 8132 8152 } 8133 8153 break; … … 8136 8156 (r_config_fsm.read() != CONFIG_TRT_SET)) 8137 8157 { 8158 trt_allocate = true; 8138 8159 trt_last = ALLOC_TRT_CONFIG; 8139 trt_allocate = true;8140 8160 } 8141 8161 break; … … 8147 8167 (r_ixr_cmd_fsm.read() != IXR_CMD_CONFIG_TRT)) 8148 8168 { 8149 trt_last = r_alloc_trt_last.read();8150 8169 trt_allocate = true; 8151 8170 } … … 8157 8176 (r_xram_rsp_fsm.read() != XRAM_RSP_TRT_DIRTY)) 8158 8177 { 8159 trt_last = r_alloc_trt_last.read();8160 8178 trt_allocate = true; 8161 8179 } … … 8165 8183 (r_ixr_rsp_fsm.read() != IXR_RSP_TRT_READ)) 8166 8184 { 8167 trt_last = r_alloc_trt_last.read();8168 8185 trt_allocate = true; 8169 8186 }
Note: See TracChangeset
for help on using the changeset viewer.