A unique cache structure with some addressing flexibility and a unique
linker method that generates program code with a minimized WCET and takes
advantage of the flexibility of the cache structure is provided. The
method generates relocatable object modules for each function of the
program code. Suitable starting locations for theses objects modules are
generated and linked together forming an executable version of the program
code. WCET analysis is performed on the executable code. The WCET is then
compared to the previous best WCET estimate. The starting locations of the
modules providing the better WCET are stored as the best configuration for
the program code. The process may be repeated until the WCET is suitably
minimized. The unique cache structure allows the WCET minimized program
code to reside contiguously in memory, while being properly cached
according to the results of the linker method. The cache structure
dynamically offsets the different object modules into the instruction
cache at run-time as per the results of the linker method. That is, it
introduces code gaps in a dynamic manner. A unique cache program counter
is used to expeditiously predict and generate the next instruction cache
address. As such, the WCET of a program can be minimized and incorporated
into an architecture with an instruction cache in an inexpensive manner
and without wasting system resources.