- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
i m a beginner, i try use an onchip memory. i can't perform read and write operation with onchip memory. i can't found an C example that help me access to the memory. i have writen c code: # include "io.h"# include "system.h"# include <stdio.h># include "Data.h"# include "sys/alt_irq.h" //============================================================================= int i; int h; int *z; int Acc0k; long cpt_AlleleAccMaster; int cpt_Allele; int cpt_iteration; int Nb_Nucleotides; int *z1; int *k; void InitDNA() { Acc0k = 0; cpt_Allele = 0; cpt_AlleleAccMaster = 0; cpt_iteration = 0; Nb_Nucleotides = 64; z1 = (unsigned int*)0x02100000; for (i=0;i<Nb_Nucleotides;i=i+4) { h = (G[i]); *z1 = h; z1 = z1 + 1; } } int main() { InitDNA(); //read (load) data from data.h k= (unsigned int*)0x02100000; for(i=0;i<16;i++) { printf("%x\t",*(k+i));// display data } } can someone help me ? thk for all membersLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
doe's 0x02100000 address correspond to a on chip memory cell? did you check it at sopc builder?
in that case you should declare you pointer as volatile # define ON_CHIP (*(volatile unsigned int *)0x02100000)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thnk you parrado, i success running my program with an onchip memory.
best regards
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