Quote:
As I understand it, a line write access may be made even if only a longword of that cache line changed.
The point is that the Coldfire V4 can distinguish byte/word/longword writes from full line write.
The Coldfire has in optimization for "Full line writes" when using write through cache mode.
A "Full Line write" is a write that will overwrite all 16 bytes of the full cache line anyway. To create a full line write Freescale recommends to use the MOVEM instruction.
As far as I understands the Coldfire cache does operates like this:
Write to memory address in Write through mode:
----------------------------------------------
(In write through the data will be written to the memory directly - Data will NOT be fetched to on chip cache first)
Byte write (direct byte memory write of this data)
Word Write (direct word memory write of this data)
Long word write (direct longword memory write of this data)
line write: (line write are generated by MOVEM instruction)
In the line write the 16byte will be bursted out.
If you run with DDR2 memory than any access that does not burst is rather slow.
Some clarification on how the COLDFIRE DDR2 memory interface works would be appreciated.
Its clear that using line writes does highly improver performance.
Write to memory address in COPY BACK mode:
----------------------------------------------
Copy back does always burst a whole cache line in and out.
So if you alter one byte in memory which is not yet cached then the cache line gets bursted in and altered in on chip cache. The CPU will burst out the content of the altered cache line, if its need the cache line for something else.
COPY BACK is in most case MUCH more efficient than write through. I'm a bit puzzled the Linux operates not in COPY BACK mode. It would be nice to learn if there is reason for this.
The question that I had, is how does the CPU handle it when it recognizes a "full line write" as for example created by a MOVEM instruction.
Reading in the line complete to then complete overwrite it is of course not efficient. I would say this could be reagrded as a bug. The question that we have is, is this a misprint or misunderstanding of the manual or does the V4 has a deficiency here.