Thank you for the follow up. Please see some inline answers in Below:
Q1)Any suggestion as to how to implement this? "after the loop count how many cast outs or writes been done to SDRAM (pages)"
A1) I was thinking possibly SDRAM event # 0x66 [Total number of hits to page 0, 1, 2, and 3, pipelined and non-pipelined] , assuming no other master besides to core is accessing SDRAM. In the code loop if the generated addresses are aligned with cache line boundaries [one per cache line] then if the cache line was valid and modified then it will be flushed to some SDRAM pages, thus get caught by event # 0x66. So the 'do math 'comment was meant for you to correlate cache line flush with the event counter increments. This is just an idea and i do not have code for it.
Q2) I'm planning to do the math to predict the number of dirty cache lines based on the timing of the flush() loop as an aggregate because I will know how long it takes to do the same loop over a clean cache.
A2) that idea sounds with assumption of no other master is doing SDRAM access and so on.
Q3)Is there a Performance Monitor event that can be used to count the write-backs that I can check after the loop exits? Or, by [do math] are you referring to something like I'm already proposing?
A3) Please see A1.