Changeset 990 for branches/reconfiguration/modules
- Timestamp:
- May 14, 2015, 2:20:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/modules/vci_xicu/caba/source/src/vci_xicu.cpp
r973 r990 224 224 switch (func) 225 225 { 226 case XICU_WTI_REG:226 case XICU_WTI_REG: 227 227 CHECK_BOUNDS(wti); 228 228 data = r_wti_reg[idx]; … … 328 328 case XICU_PRIO: 329 329 CHECK_BOUNDS(irq); 330 data = 331 (((r_msk_pti[idx] & r_pti_pending) ? 1 : 0) << 0) | 332 (((r_msk_hwi[idx] & r_hwi_pending) ? 1 : 0) << 1) | 333 (((r_msk_wti[idx] & r_wti_pending) ? 1 : 0) << 2) | 334 ((soclib::common::ctz<uint32_t>(r_msk_pti[idx] & r_pti_pending) & 0x1f) << 8) | 335 ((soclib::common::ctz<uint32_t>(r_msk_hwi[idx] & r_hwi_pending) & 0x1f) << 16) | 336 ((soclib::common::ctz<uint32_t>(r_msk_wti[idx] & r_wti_pending) & 0x1f) << 24); 337 330 { 331 uint32_t pti_active = r_msk_pti[idx] & r_pti_pending; 332 uint32_t hwi_active = r_msk_hwi[idx] & r_hwi_pending; 333 uint32_t wti_active = r_msk_wti[idx] & r_wti_pending; 334 uint32_t t = pti_active ? 1 : 0; 335 uint32_t h = hwi_active ? 1 : 0; 336 uint32_t w = wti_active ? 1 : 0; 337 uint32_t prio_pti = t ? soclib::common::ctz<uint32_t>(pti_active) : 0; 338 uint32_t prio_hwi = h ? soclib::common::ctz<uint32_t>(hwi_active) : 0; 339 uint32_t prio_wti = w ? soclib::common::ctz<uint32_t>(wti_active) : 0; 340 341 data = (t << 0) | (h << 1) | (w << 2) | 342 (prio_pti << 8 ) | (prio_hwi << 16) | (prio_wti << 24); 343 } 338 344 #if SOCLIB_MODULE_DEBUG 339 345 std::cout << "[" << name() << "] Read XICU_PRIO[" << std::dec << idx << "] = " … … 342 348 return true; 343 349 344 case XICU_CONFIG:350 case XICU_CONFIG: 345 351 data = (m_irq_count << 24) | (m_wti_count << 16) | (m_hwi_count << 8) | m_pti_count; 346 #if SOCLIB_MODULE_DEBUG 347 std::cout << "[" << name() << "] Read XICU_CONFIG = " << std::hex << (int)data << std::dec << " time = " << m_clock_cycles << std::endl; 348 #endif 349 return true; 350 351 case XICU_CFG_REG: 352 353 #if SOCLIB_MODULE_DEBUG 354 std::cout << "[" << name() << "] Read XICU_CONFIG = " 355 << std::hex << (int)data << std::dec << " time = " << m_clock_cycles << std::endl; 356 #endif 357 return true; 358 359 case XICU_CFG_REG: 352 360 CHECK_BOUNDS(cfg); 353 361 data = r_cfg_reg[idx];
Note: See TracChangeset
for help on using the changeset viewer.