Filling large ROMs

X

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" <x@x.com> wrote in message
news:fno3k8$b2v$1@nsnmrro2-gest.nuria.telefonica-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.
 
I solved it!

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

"Xin Xiao" <x@x.com> wrote in message
news:fno3k8$b2v$1@nsnmrro2-gest.nuria.telefonica-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 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
 
jihan.rezwan@gmail.com 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
 
On Jan 30, 12:36 am, Mark McDougall <ma...@vl.com.au> 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!
 

Welcome to EDABoard.com

Sponsor

Back
Top