Both RAC and IMDB Cache are *options* to Oracle Database Enterprise Edition. So to have IMDB Cache plus RAC you need to license
Oracle Database Enterprise Edition
Oracle Database RAC option
Oracle Database IMDB Cache option
The first two must be licensed for the number of CPUs on the machines where the Oracle database (RAC cluster) will be running. IMDB cache must be licensed for the number of CPUs on the machines where TimesTen will be running (which will not be the Oracle database machines of course).