Filling large ROMs

Discussion in 'VHDL' started by Xin Xiao, Jan 29, 2008.

  1. Xin Xiao

    Xin Xiao Guest

    I have a constant ROM, and I would like to initialize it. The problem is
    that the ROM is very large and I only need to initialize, say, the first 10
    positions or so. How can I initialize the first 10 positions and fill the
    rest with zeros? Maybe with the "others" reserved word? Do you have an
    example?
     
    Xin Xiao, Jan 29, 2008
    #1
    1. Advertising

  2. "Xin Xiao" <> wrote in message
    news:fno3k8$b2v$-data.net...
    >
    > I have a constant ROM, and I would like to initialize it. The problem is
    > that the ROM is very large and I only need to initialize, say, the first
    > 10 positions or so. How can I initialize the first 10 positions and fill
    > the rest with zeros? Maybe with the "others" reserved word? Do you have an
    > example?


    If you only need to use the first few locations of a ROM, then perhaps a
    smaller ROM is in order.
     
    David Spencer, Jan 29, 2008
    #2
    1. Advertising

  3. Xin Xiao

    Xin Xiao Guest

    I solved it!

    constant array : t_array :=
    ( 0 => "111111111",
    1 => "101010101",
    ...
    others => "000000000");

    "Xin Xiao" <> wrote in message
    news:fno3k8$b2v$-data.net...
    >
    > I have a constant ROM, and I would like to initialize it. The problem is
    > that the ROM is very large and I only need to initialize, say, the first
    > 10 positions or so. How can I initialize the first 10 positions and fill
    > the rest with zeros? Maybe with the "others" reserved word? Do you have an
    > example?
     
    Xin Xiao, Jan 29, 2008
    #3
  4. Xin Xiao wrote:
    >
    > I have a constant ROM, and I would like to initialize it. The problem is
    > that the ROM is very large and I only need to initialize, say, the first
    > 10 positions or so. How can I initialize the first 10 positions and fill
    > the rest with zeros? Maybe with the "others" reserved word? Do you have
    > an example?


    That will likely slow down your simulation. There are techniques for
    populating sparse arrays to be used as memory in simulation, you could
    apply a similar technique for your ROM...

    Regards,

    --
    Mark McDougall, Engineer
    Virtual Logic Pty Ltd, <http://www.vl.com.au>
    21-25 King St, Rockdale, 2216
    Ph: +612-9599-3255 Fax: +612-9599-3266
     
    Mark McDougall, Jan 29, 2008
    #4
  5. Xin Xiao

    Guest

    On Jan 30, 12:36 am, Mark McDougall <> wrote:
    > Xin Xiao wrote:
    >
    > > I have a constant ROM, and I would like to initialize it. The problem is
    > > that the ROM is very large and I only need to initialize, say, the first
    > > 10 positions or so. How can I initialize the first 10 positions and fill
    > > the rest with zeros? Maybe with the "others" reserved word? Do you have
    > > an example?

    >
    > That will likely slow down your simulation. There are techniques for
    > populating sparse arrays to be used as memory in simulation, you could
    > apply a similar technique for your ROM...
    >
    > Regards,
    >
    > --
    > Mark McDougall, Engineer
    > Virtual Logic Pty Ltd, <http://www.vl.com.au>
    > 21-25 King St, Rockdale, 2216
    > Ph: +612-9599-3255 Fax: +612-9599-3266


    I have a similar problem. I'm trying to declare and initialize an
    array of constants with this statement:

    constant RCONtable: array (10 downto 1) of std_logic_vector (7 downto
    0) :=
    ( x"01", x"02", x"04", x"08", x"10", x"20", x"40", x"80", x"1b",
    x"36" );


    but the compiler doesn't like it :(

    Please help me!
     
    , Mar 5, 2008
    #5
  6. wrote:

    > I have a similar problem. I'm trying to declare and initialize an array
    > of constants with this statement:
    >
    > constant RCONtable: array (10 downto 1) of std_logic_vector (7 downto
    > 0) := ( x"01", x"02", x"04", x"08", x"10", x"20", x"40", x"80", x"1b",
    > x"36" );


    type RCONtable_t is array (natural range <>) of std_logic_vector(7 downto 0);
    constant RCONtable : RCONtable_t(2 downto 1) := ( X"01", X"02" );

    Regards,

    --
    Mark McDougall, Engineer
    Virtual Logic Pty Ltd, <http://www.vl.com.au>
    21-25 King St, Rockdale, 2216
    Ph: +612-9599-3255 Fax: +612-9599-3266
     
    Mark McDougall, Mar 5, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. santaç

    burning websites to CD-ROMS

    santaç, Jul 28, 2004, in forum: HTML
    Replies:
    15
    Views:
    2,721
    Mark Parnell
    Jul 30, 2004
  2. Ketchup
    Replies:
    1
    Views:
    262
    Jan Tielens
    May 25, 2004
  3. Replies:
    5
    Views:
    922
    Xho Jingleheimerschmidt
    Apr 2, 2009
  4. Mohsen Pahlevanzadeh
    Replies:
    0
    Views:
    131
    Mohsen Pahlevanzadeh
    Sep 9, 2013
  5. MRAB
    Replies:
    0
    Views:
    125
Loading...

Share This Page