Forum Discussion
Altera_Forum
Honored Contributor
13 years agoYou should be able to write a simple linux driver that will use pread() and pwrite() to read/write memory fpga memory.
Your driver read code probably need to be something like:static ssize_t
foo_read(struct file *fp, char *u_buf, size_t len, loff_t *offp)
{
foo_info_t *au = fp->private_data;
loff_t loff = *offp;
if (loff > MAX_SIZE || loff + len > MAX_SIZE)
return -EINVAL;
if (copy_to_user(u_buf, au->au_base + loff, len) != 0)
return -EFAULT;
*offp = loff + len;
return len;
} Updating 'offp' lets you use hexdump etc.