- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a NIOS II which is connected to a vga component with avalon memory mapped slave. In the VHDL entity, i have address, writedata, readdata, and chip select. the address base of the avalon memory mapped slave is 0x3008. I am not sure how to write information into the memory mapped slave. The address is used so i can write data into different signals. So far i have something like this in c: # define x (char *) 0x3008 main(){ while(1) *x=0x0F; // whatever values i need to pass. }Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From NIOS you just treat it as if it is any other bit of memory and the processor will take care of the signalling (hence they are called memory-mapped).
There are handy functions provided in the NIOS BSP that are useful when writing to slave devices such as: IOWR_32DIRECT(<base address>,<offset in bytes>,<32bit data>); IORD_32DIRECT(<base address>,<offset in bytes>); And similar ones for 8bit and 16 bit data. Alternative you can do something like: int main(){ char* x = 0x3008; *x = 0x0F; }- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- From NIOS you just treat it as if it is any other bit of memory and the processor will take care of the signalling (hence they are called memory-mapped). There are handy functions provided in the NIOS BSP that are useful when writing to slave devices such as: IOWR_32DIRECT(<base address>,<offset in bytes>,<32bit data>); IORD_32DIRECT(<base address>,<offset in bytes>); And similar ones for 8bit and 16 bit data. Alternative you can do something like: int main(){ char* x = 0x3008; *x = 0x0F; } --- Quote End --- Thanks i got it working. Another question i have has regards to the altera monitor program. Has anyone used it? I'm trying to use the sleep function included from the unistd.h. However when i compile it tells me there is an undefined reference to sleep(). any ideas? ps. usleep() gives the same error

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