Forum Discussion

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

How to use SDRAM Vhdl with DE2-115??

English use of I might be wrong. Because I am not good at English.

I have been using de2-115.

I would like to create a SDRAM circuit to verify that the data is written to the SDRAM, data is read from the SDRAM.

But since I do not understand about the SDRAM , it is difficult .

Could you tell me the code and its operation to me someone ?

By the way , the code shown below is a SRAM that created me.

I would like to create SDRAM something similar to this circuit .

library ieee;
 use ieee.std_logic_1164.all;
 entity top_level_entity is
 port (
  SW: in std_logic_vector (17 downto 0);
  LEDR: out std_logic_vector (17 downto 0);
  SRAM_ADDR: out std_logic_vector (19 downto 0);
  SRAM_DQ: inout std_logic_vector (15 downto 0);
  SRAM_CE_N: out std_logic;
  SRAM_OE_N: out std_logic;
  SRAM_WE_N: out std_logic;
  SRAM_UB_N: out std_logic;
  SRAM_LB_N: out std_logic
 ) ;
 end top_level_entity;
 architecture inside_top_level_entity of top_level_entity is
  signal address: std_logic_vector (1 downto 0);
  signal data: std_logic_vector (14 downto 0);
  signal output: std_logic_vector (14 downto 0);
  signal we: std_logic;
 begin
 &#12288;SRAM_WE_N <= not SW (15);
 &#12288;SRAM_CE_N <= '0 ';
 &#12288;SRAM_OE_N <= '0 ';
 &#12288;SRAM_UB_N <= '0 ';&#12288;
 &#12288;SRAM_LB_N <= '0 ';
 &#12288;address <= SW (17 downto 16);
 &#12288;SRAM_ADDR (19 downto 2) <= (others => '0 ');
 &#12288;SRAM_ADDR (1 downto 0) <= address;
 &#12288;data <= SW (14 downto 0) when SW (15) = '1 'else (others =>' Z ');
 &#12288;SRAM_DQ (15) <= '0 ';
 &#12288;SRAM_DQ (14 downto 0) <= data;
 &#12288;output <= SRAM_DQ (14 downto 0);
 &#12288;LEDR (14 downto 0) <= output;
 end inside_top_level_entity;

help, help, sir, for the love of Heaven.

4 Replies

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

    Thank you for answering questions.

    Will it be you want to create a SDRAM with DE2-115, it is to use the SDRAM controller?

    Maybe, there is a possibility that my English was wrong.

    Using the DE2-115 in I, want to create a simple SDRAM circuit.

    At the same,I want to know the DRAM even regard to how the operation.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To design your own SDRAM Controller,you need to read the specification of SDRAM and accordingly you can design it.You can refer datasheet for SDRAM as well.

    If you just want to test the working of SDRAM,then you can use Altera's SDRAM Controller directly.You can connect NIOS II Processor with SDRAM Controller and can verify the functionality of SDRAM.I am sure there will be some reference design/example design for DE2-115 board which uses SDRAM.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    have u wrote any code to access sdram data in nios ii ide? Please help me with a c code to access data on sdram.please post your c code and sopc file. Thank you...!!!