Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Custom instruction to access SDRAM

Hi,

I'm inexperienced with FPGA's.

I want to implement a custom instruction, which calculates an SDRAM address and writes something into. I use NIOS II e and SDRAM controller IP. My questions are:

1. Is that possible? (I guess it is, but would be nice to hear a confirm from someone else ;))

2. Whereto do I provide my result? To the SDRAM controller or the SDRAM itself?

3. Not sure it is conflict-free with data master

Maybe someone have literature, i already read the altera custom instruction user guide and found nothing similar in this forum yet. Sorry, this questions may be stupid, but as i sad, I'm totaly beginner.

Regards.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I believe what you would like to do can be accomplished with a single new IP component which has two interfaces:

    1. A custom instruction slave connected to the NIOS

    2. An Avalon-MM Master connected to the SDRAM controller (or, any bridge you have in front of the SDRAM controller)

    It is not commonly done, but I expect there is nothing preventing you from doing this.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It may sound like a stupid question but why don't you want to use regular instructions to write to the memory? The CPU already has instructions to load and store values to/from the data memory.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I just trying out some things to get started. It maybe has totaly no sense but i want to figure out how things work.

    Thanks for replys.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I would start with a single cycle combinatorial custom instruction, maybe just add or byte reverse.

    If you find your instruction on the RTL viewer you'll get a good idea of how it all works.