[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [f-cpu] new cjump instruction



On Sun, Apr 13, 2003 at 01:21:05PM +0000, nico wrote:
[...]
> All of this is part of the beginning of the pipeline (fetch stages).
> There is nothing about it in the manual or elsewhere. 
[...]

Well, then let's try to fill that gap.

I'll assume that the fetcher sends an aligned address to the I-cache
and always receives a complete cache line (256 bits = 32 bytes = 8
instructions).  In sequential code, it will have to fetch a new line
every 8 cycles -- and it can prefetch the next line in sequence as
soon as it starts executing the current line, which gives the I-cache
a number of cycles to deliver.  In order to speed things up further,
instructions may be pre-decoded in parallel as soon as the fetcher
has received a cache line, and stored in pre-decoded form.  That is,
instructions that need special attention would be flagged so that they
can be quickly recognized later.

The fetcher (short for "instruction fetch/decode/issue unit") executes
instructions from beginning to end of the current line.  Most instructions
are simply delegated to other execution units, but some need special
handling.  An important one is `loadaddr[i]'.  The fetcher will send
PC+4 (may be precomputed) and the immediate value (if any) to the adder,
and it will use the result to prefetch another cache line into one of
its buffers (BTW: I guess it may be better to use a dedicated adder
instead of EU_ASU).

When the fetcher executes a jump that refers to the prefetched line,
it can simply switch buffers and go ahead.  If the target line has not
been prefetched yet (which is also the case for your proposed `cjump'
instruction), the fetcher will have to stop, obtain the target address
and start a new I-cache fetch cycle before it can continue.  That will
take quite a while, even if you can skip the TLB lookup (so much for
"fetch is fast").  Note that many TLB lookups can be skipped anyway if
the fetcher remembers the dimensions of the current page(s).

Did I miss anything?  Well, probably a lot.
Yann, please correct me if I'm wrong.

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/