base:improved_clockslide
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
base:improved_clockslide [2017-02-28 07:54] – created lft | base:improved_clockslide [2017-02-28 08:16] – Consistent use of 'clock slide'. lft | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | === Improved Clock Slide === | + | ====== Improved Clock Slide ====== |
- | by *lft* | + | by **lft** |
Sometimes we want to delay a variable number of cycles, e.g. during VSP or when setting up a stable raster. | Sometimes we want to delay a variable number of cycles, e.g. during VSP or when setting up a stable raster. | ||
Line 7: | Line 7: | ||
A typical way of handling a variable delay is to use a //clock slide//. In the following example, we start somewhere in a given range of cycles, we want to end up exactly at cycle 50, and we've computed the corresponding number of cycles to skip in A. | A typical way of handling a variable delay is to use a //clock slide//. In the following example, we start somewhere in a given range of cycles, we want to end up exactly at cycle 50, and we've computed the corresponding number of cycles to skip in A. | ||
- | ; | + | ; |
- | | + | |
branch | branch | ||
| | ||
Line 17: | Line 17: | ||
; at cycle 50 | ; at cycle 50 | ||
- | Notice that the operands are reinterpreted as opcodes depending on where we land on the slide. For instance, the final '' | + | Every additional byte we skip corresponds to one less cycle of delay. |
- | The length of the clockslide | + | The length of the clock slide depends on the maximum jitter we have to support, and we pay a corresponding penalty in the form of useless waiting cycles. In the example, the maximum supported jitter is 10 cycles (41-31), and the minimum overhead cost is 9 cycles (50-41). |
Now here comes the improvement: | Now here comes the improvement: | ||
+ | Notice that in the latest case (starting at cycle 41), we still execute a single '' | ||
+ | But we can use the page-crossing penalty of the branch instruction to add an extra cycle in this particular case! Consider: | ||
+ | ; delay 18-A cycles | ||
+ | | ||
+ | branch | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ; page-crossing here! | ||
+ | ; at cycle 49 | ||
+ | |||
+ | The clock slide is now one byte shorter, and the minimum overhead cost has been reduced to 8 cycles. | ||
+ | |||
+ | The downside is that we now have an alignment requirement. Sometimes it may not be possible to adjust the starting address of the delay code. But note that we can insert dummy bytes just after the branch instruction, |
base/improved_clockslide.txt · Last modified: 2017-04-27 01:17 by copyfault