"To move data to and from a cache block, the memcpy() function should be
used."
So accessDRAM() is only for obtaining pointers to RAM. We then use those
pointers with memcpy() and that actually transfers the data. So my question
is, when would we ever use the WRITE flag for accessDRAM?
When writing data, we would use READ, to get the DEST pointer for use with
memcpy().
When reading data, we would use READ, to get the SRC pointer for use with
memcpy().
So am I missing something, or do we *never* use the WRITE mode with
accessDRAM?
Thanks,
Jeremy
And if that's the case, then you have no choice but to use it instead of
memcpy().
"Willem Jan van Vliet" <cs61...@imail.EECS.Berkeley.EDU> wrote in message
news:g7lisn$1sjj$1...@agate.berkeley.edu...
> From what I understand accessDRAM() does the memory transfer between RAM
> and
> the cache, and memcpy() does the transfer between the cache and the
> program
> itself. accessDRAM is therefore used on any read/write from/to memory, and
> memcpy() is used to either update the contents of the cache with the data
> passed into the accessMemory() function, or to copy the data from the
> cache to
> the destination passed in accessMemory().
>
> I haven't tested this yet (busy writing a paper for another class... ugh),
> but
> this is what I think the spec means.
>
> Willem
>
> In article <g7ldto$2qjt$1...@geode.berkeley.edu>, "Jeremy Cowles"
> <jeremy...@berkeley.edu> writes:
>>
>> From the spec:
>>
>> "When you are moving things between cache and physical memory, a BLOCK is
>> transferred, NOT just a word nor a byte."
>>
>> The spec also says for write-through you write an entire block as well.
>> For
>> write-back you always write an entire block by definition (unless I got
>> mixed up about this). And to write a block, the spec says use memcpy().
>>
>> So, I still don't see where you would use accessDRAM()...
>>
>>
>> "Kevin Lee Mellott" <cs61...@imail.EECS.Berkeley.EDU> wrote in message
>> news:g7lde7$1qn7$1...@agate.berkeley.edu...
>> > You'll use the WRITE flag when doing Write-backs and you have dirty
>> > data
>> > you
>> > want to over write.
>> >
>> > In article <g7lcad$2q4q$1...@geode.berkeley.edu>, "Jeremy Cowles"
Can Albert or a TA please clarify?
This is the reason for my post. Both accessDRAM and cpymem() do the same
thing.
"When you are moving things between cache and physical memory, a BLOCK is
transferred, NOT just a word nor a byte."
The spec also says for write-through you write an entire block as well. For
write-back you always write an entire block by definition (unless I got
mixed up about this). And to write a block, the spec says use memcpy().
So, I still don't see where you would use accessDRAM()...
"Kevin Lee Mellott" <cs61...@imail.EECS.Berkeley.EDU> wrote in message
news:g7lde7$1qn7$1...@agate.berkeley.edu...
> You'll use the WRITE flag when doing Write-backs and you have dirty data
> you
> want to over write.
>
> In article <g7lcad$2q4q$1...@geode.berkeley.edu>, "Jeremy Cowles"
> <jeremy...@berkeley.edu> writes:
>>