There is a class with three templates.
#if defined(USE_CACHE_FALRU)
template class Cache<FALRU>;
#endif
#if defined(USE_CACHE_IIC)
template class Cache<IIC>;
#endif
#if defined(USE_CACHE_LRU)
template class Cache<LRU>;
#endif
These template has common function:
FALRUBlk* accessBlock(Addr addr, int &lat, int context_src, int *inCache = 0);
IICTag* accessBlock(Addr addr, int &lat, int context_src);
BlkType* accessBlock(Addr addr, int &lat, int context_src);
As you can see, number of arguments for one of the templates differs from others.
Now in Cache(), there is a function which call accessBlock()
template<class TagStore>
bool Cache<TagStore>::access(PacketPtr pkt, BlkType *&blk, int &lat, PacketList &writebacks)
{
...
blk = tags->accessBlock(pkt->getAddr(), lat, id);
...
}
In a confing file, all templates are defined
#define USE_CACHE_LRU 1
#define USE_CACHE_FALRU 1
#define USE_CACHE_IIC 1
I wonder how this file is compiled. As you can see, FALRUBlk::accessBlock() takes 4 arguments. However in Cache::access(), only three arguments are passed.
So Can someone explain how this function compiled without problem?