Exemple #1
0
void prefetcher_access_hit(struct mod_stack_t *stack,
                           struct mod_t *target_mod) {
    int it_index;

    if (target_mod->kind != mod_kind_cache || !target_mod->cache->prefetcher)
        return;

    if (mod_block_get_prefetched(target_mod, stack->addr)) {
        /* This block was prefetched. Now it has a real access. For the purposes
         * of the prefetcher heuristic, this is still a miss. Hence, update
         * the prefetcher tables. */
        it_index = prefetcher_update_tables(stack, target_mod);

        /* Clear the prefetched flag since we have a real access now */
        mem_debug("  addr 0x%x %s : clearing \"prefetched\" flag\n", stack->addr,
                  target_mod->name);
        mod_block_set_prefetched(target_mod, stack->addr, 0);

        if (it_index < 0) return;

        if (target_mod->cache->prefetcher->type == prefetcher_type_ghb_pc_cs) {
            /* Perform ghb based PC/CS prefetching
             * (Program Counter based index, Constant Stride) */
            prefetcher_ghb_pc_cs(target_mod, stack, it_index);
        } else {
            assert(target_mod->cache->prefetcher->type == prefetcher_type_ghb_pc_dc);
            /* Perform ghb based PC/DC prefetching
             * (Program Counter based index, Delta Correlation) */
            prefetcher_ghb_pc_dc(target_mod, stack, it_index);
        }
    }
}
Exemple #2
0
void prefetcher_access_miss(struct mod_stack_t *stack, struct mod_t *target_mod)
{
	int it_index;

	if (target_mod->kind != mod_kind_cache || !target_mod->cache->prefetcher)
		return;

	it_index = prefetcher_update_tables(stack, target_mod);

	if (it_index < 0)
		    return;

	if (target_mod->cache->prefetcher->type == prefetcher_type_ghb_pc_cs)
	{
		/* Perform ghb based PC/CS prefetching
		 * (Program Counter based index, Constant Stride) */
		prefetcher_ghb_pc_cs(target_mod, stack, it_index);
	}
	else
	{
		assert(target_mod->cache->prefetcher->type == prefetcher_type_ghb_pc_dc);
		/* Perform ghb based PC/DC prefetching
		 * (Program Counter based index, Delta Correlation) */
		prefetcher_ghb_pc_dc(target_mod, stack, it_index);
	}
}