Forum Discussion

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

On-Chip Memory Access

I am currently designing a dual processor system. One of the processors is a NIOS and the other is external to the FPGA and is a Freescale Coldfire.

I have a requirement for both of the processors to access the on-chip memory within the FPGA therefore i have selected the dual port mode in SOPC for the on chip RAM.

While i understand how to access this memory using the NIOS i dont know how to connect it to my external Coldfire Processor. I was expecting to do this using the Avalon Switch fabric but was unable to make this work

Any help or tips would be greatly appreciated.

Regards and thanks

Paul

6 Replies

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

    Hi Paul,

    One solution would be to design an external processor interface working as Avalon Master (You can refer to http://www.altera.com/literature/an/an397.pdf), use single port standard on-chip RAM interface and connect it with both the masters (external processor and Nios II) through SOPC builder bus connection interface. You could assign arbitration share as per your design priority. Hope that this should work for you.

    Is it necessary to use dual port configuration for on-chip RAM?

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

    BD

    Thanks for the reply. This was exactly what i was hoping for. I am now looking into using the application note to do as you have suggested.

    I assumed i would need to use dual port ram initially however i dont need "traditional" dual port ram. I only need to write to the ram from the coldfire and read from the NIOS.

    Therefore i think a single port ram with some bespoke arbitration circuitry is a potential way forward. Thanks again for your help.

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

    Hi Paul,

    You could use dual port RAM if you are planning on simultaneous read/write from coldfire and Nios II. The single port RAM will allow for sequential operation only, i.e., only one master can have access to this RAM at a time. So you can select the RAM configuration (dual port/single port) as per your design requirements.

    Cheers!

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

    To use on-chip memory, You must create a driver or interface before connecting it to avalon bus.

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

    --- Quote Start ---

    Hi Paul,

    You could use dual port RAM if you are planning on simultaneous read/write from coldfire and Nios II. The single port RAM will allow for sequential operation only, i.e., only one master can have access to this RAM at a time. So you can select the RAM configuration (dual port/single port) as per your design requirements.

    Cheers!

    BD

    --- Quote End ---

    I have the same needs with external processor :

    I want to instantiate a Dual-Port in SOPC

    - Data will be written by NIOS or DMA.

    - Data will be read by external processor.

    Have you some idea ?

    regards

    sebby2000