- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I want to flush all dcache of niosII/f core, I find a function in kitsv1.1\nios2\components\altera_nios2\HAL\src\alt_dcache_flush_all.c , but I wonder if it is correct. the function is like that: /* * alt_dcache_flush_all() is called to flush the entire data cache. */ void alt_dcache_flush_all (void) {# if NIOS2_DCACHE_SIZE > 0 alt_dcache_flush (0, NIOS2_DCACHE_SIZE);# endif } I read the src of function alt_dcache_flush (void* start, alt_u32 len) in alt_dcache_flush.c. the first param is an address second is a size. we can invoke it like that alt_dcache_flush(&iVal , sizeof(iVal) ), but what does it mean to pass a zero to it as first param just like alt_dcache_flush_all() does? Is it correct? I am anxious to know the answer. Who can give me some advice? http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gifLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, this is correct.
The Nios II FLUSHD instruction ignores the tag portion of the memory address (the top bits). This means that a FLUSHD to address 0x0000 is the same as a FLUSHD to address 0x1000, 0x2000, 0x3000, etc. for a 4096 byte D-cache. +james+- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got it!thanks !
I may have read the describtion of flushd and initd instruction, but I ignore the sentence"Ignore the tag,flushd identifies the cache line associated with the computed effective address". because I don't know what the tag refer to. thanks again. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page