ULA

Changeset

124:40c8c2cd15f4
2020-04-16 Paul Boddie raw files shortlog changelog graph Added notes on two-bytes-per-cycle ULA accesses and related considerations.
ULA.txt (file)
     1.1 --- a/ULA.txt	Thu Apr 16 00:24:51 2020 +0200
     1.2 +++ b/ULA.txt	Thu Apr 16 22:25:05 2020 +0200
     1.3 @@ -174,12 +174,49 @@
     1.4  Another conceivable simplification from using an 8-bit wide RAM access channel
     1.5  with a single access within each 2MHz cycle is the possibility of allowing the
     1.6  CPU to signal directly to the RAM instead of having the ULA perform the access
     1.7 -signalling on the CPU's behalf.
     1.8 +signalling on the CPU's behalf. Note that it is this more leisurely signalling
     1.9 +that would allow the CPU to conduct accesses at 2MHz: the "compressed"
    1.10 +signalling being beyond the capabilities of the CPU.
    1.11  
    1.12  Note that 16MHz cycles would still be needed for the pixel clock in MODE 0,
    1.13  which needs to output eight pixels per 2MHz cycle, producing 640 monochrome
    1.14  pixels per 80-byte line.
    1.15  
    1.16 +An obvious consideration with regard to 8-bit wide access is whether the ULA
    1.17 +could still conduct the "compressed" signalling for its own RAM accesses:
    1.18 +
    1.19 +     Time (ns):  0-------------- 500------------- ...
    1.20 +   2 MHz cycle:  0               1                ...
    1.21 +  16 MHz cycle:  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7  ...
    1.22 +                 /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ ...
    1.23 +          ~RAS:  /---\___________/---\___________ ...
    1.24 +          ~CAS:  /-----\___/-\___/-----\___/-\___ ...
    1.25 +Address events:      A B     C       A B     C    ...
    1.26 +   Data events:           1     2         1     2 ...
    1.27 +
    1.28 +      ~RAS ops:  1   0           1   0            ...
    1.29 +      ~CAS ops:  1     0   1 0   1     0   1 0    ...
    1.30 +
    1.31 +   Address ops:     a b     c       a b     c     ...
    1.32 +      Data ops:  s         f     s         f      ...
    1.33 +
    1.34 +           ~WE:  ......W                          ...
    1.35 +       PHI OUT:  \_______/-------\_______/------- ...
    1.36 +           CPU:  L       D       L       D        ...
    1.37 +           RnW:          R               R        ...
    1.38 +
    1.39 +Here, "1" and "2" in the data events correspond to whole byte accesses,
    1.40 +effectively upgrading the half-byte "F" and "S" events in the existing ULA
    1.41 +arrangement.
    1.42 +
    1.43 +Although the provision of access for the CPU would adhere to the relevant
    1.44 +timing constraints, providing only one byte per 2MHz cycle, the ULA could
    1.45 +obtain two bytes per cycle. This would then free up bandwidth for the CPU in
    1.46 +screen modes where the ULA would normally be dominant (MODE 0 to 3), albeit at
    1.47 +the cost of extra buffering. Such buffering could also be done for modes where
    1.48 +the bandwidth is shared (MODE 4 to 6), consolidating pairs of ULA accesses into
    1.49 +single cycles and freeing up an extra cycle for CPU accesses.
    1.50 +
    1.51  CPU Clock Notes
    1.52  ---------------
    1.53  
    1.54 @@ -721,11 +758,38 @@
    1.55  Unfortunately, the mechanism for accessing the RAM is too slow to provide data
    1.56  within the time constraints of 2MHz operation. There is no time remaining in a
    1.57  2MHz cycle for the CPU to receive and process any retrieved data once the
    1.58 -necessary signalling has been performed. The only way for the CPU to be able
    1.59 -to access the RAM quickly enough would be to do away with the double 4-bit
    1.60 -access mechanism and to have a single 8-bit channel to the memory. This would
    1.61 -require twice as many 1-bit RAM chips or a different kind of RAM chip, but it
    1.62 -would also potentially simplify the ULA.
    1.63 +necessary signalling has been performed.
    1.64 +
    1.65 +The only way for the CPU to be able to access the RAM quickly enough would be
    1.66 +to do away with the double 4-bit access mechanism and to have a single 8-bit
    1.67 +channel to the memory. This would require twice as many 1-bit RAM chips or a
    1.68 +different kind of RAM chip, but it would also potentially simplify the ULA.
    1.69 +
    1.70 +The section on 8-bit wide RAM access discusses the possibilities around
    1.71 +changing the memory architecture, also describing the possibility of ULA
    1.72 +accesses achieving two bytes per 2MHz cycle due to the doubling of the memory
    1.73 +channel, leaving every other access free for the CPU during the display period
    1.74 +in MODE 0 to 3...
    1.75 +
    1.76 +  Standard display period: UUUUUUUU
    1.77 +  Modified display period: UCUCUCUC
    1.78 +
    1.79 +...and consolidating accesses in MODE 4 to 6:
    1.80 +
    1.81 +  Standard display period: UCUCUCUC
    1.82 +  Modified display period: UCCCUCCC
    1.83 +
    1.84 +Together with the enhancements for non-display periods, such an "Enhanced+ ULA"
    1.85 +would perform as follows:
    1.86 +
    1.87 +                Standard ULA    Enhanced+ ULA   % Total Bandwidth   Speedup
    1.88 +MODE 0, 1, 2    9728 bytes      29696 bytes     24% -> 74%          3.1
    1.89 +MODE 3          12288 bytes     32256 bytes     31% -> 81%          2.6
    1.90 +MODE 4, 5       19968 bytes     34816 bytes     50% -> 87%          1.7
    1.91 +MODE 6          19968 bytes     36096 bytes     50% -> 90%          1.8
    1.92 +
    1.93 +Of course, the principal enhancement would be the wider memory channel, with
    1.94 +more buffering in the ULA being its contribution to this arrangement.
    1.95  
    1.96  Enhancement: Region Blanking
    1.97  ----------------------------