Search in sources :

Example 1 with FIFOCacheBuilder

use of com.jopdesign.wcet.uppaal.translator.cache.FIFOCacheBuilder in project jop by jop-devel.

the class SystemBuilder method getCacheSimulation.

private CacheSimBuilder getCacheSimulation() {
    MethodCache cache = project.getWCETProcessorModel().getMethodCache();
    UppaalCacheApproximation cacheApprox = config.getCacheApproximation();
    CacheSimBuilder sim;
    if (cache.getName() == CacheImplementation.NO_METHOD_CACHE) {
        sim = new StaticCacheBuilder(false);
    } else if (cacheApprox == UppaalCacheApproximation.ALWAYS_MISS) {
        sim = new StaticCacheBuilder(true);
    } else {
        switch(cache.getName()) {
            case LRU_CACHE:
                sim = new LRUCacheBuilder((BlockCache) cache);
                break;
            case FIFO_CACHE:
                sim = new FIFOCacheBuilder((BlockCache) cache, config.emptyInitialCache);
                break;
            case LRU_VARBLOCK_CACHE:
                sim = new LRUVarBlockCacheBuilder(project, (VarBlockCache) cache, this.methodId.keySet());
                break;
            case FIFO_VARBLOCK_CACHE:
                sim = new FIFOVarBlockCacheBuilder(project, (VarBlockCache) cache, this.methodId.keySet(), config.emptyInitialCache);
                break;
            default:
                throw new AssertionError("Unsupport cache implementation: " + cache.getName());
        }
    }
    return sim;
}
Also used : FIFOCacheBuilder(com.jopdesign.wcet.uppaal.translator.cache.FIFOCacheBuilder) UppaalCacheApproximation(com.jopdesign.wcet.uppaal.UppAalConfig.UppaalCacheApproximation) StaticCacheBuilder(com.jopdesign.wcet.uppaal.translator.cache.StaticCacheBuilder) CacheSimBuilder(com.jopdesign.wcet.uppaal.translator.cache.CacheSimBuilder) MethodCache(com.jopdesign.wcet.jop.MethodCache) LRUCacheBuilder(com.jopdesign.wcet.uppaal.translator.cache.LRUCacheBuilder) LRUVarBlockCacheBuilder(com.jopdesign.wcet.uppaal.translator.cache.LRUVarBlockCacheBuilder) FIFOVarBlockCacheBuilder(com.jopdesign.wcet.uppaal.translator.cache.FIFOVarBlockCacheBuilder)

Aggregations

MethodCache (com.jopdesign.wcet.jop.MethodCache)1 UppaalCacheApproximation (com.jopdesign.wcet.uppaal.UppAalConfig.UppaalCacheApproximation)1 CacheSimBuilder (com.jopdesign.wcet.uppaal.translator.cache.CacheSimBuilder)1 FIFOCacheBuilder (com.jopdesign.wcet.uppaal.translator.cache.FIFOCacheBuilder)1 FIFOVarBlockCacheBuilder (com.jopdesign.wcet.uppaal.translator.cache.FIFOVarBlockCacheBuilder)1 LRUCacheBuilder (com.jopdesign.wcet.uppaal.translator.cache.LRUCacheBuilder)1 LRUVarBlockCacheBuilder (com.jopdesign.wcet.uppaal.translator.cache.LRUVarBlockCacheBuilder)1 StaticCacheBuilder (com.jopdesign.wcet.uppaal.translator.cache.StaticCacheBuilder)1