how can I drive an array from a component to the top level ??

Y

yossi

I have a question related to my design,

I have a component that has lots of registers (120 registers 8bit each).
In this case I can declare an Array in side this component.
my quaestion is:
can I drive it out of this component to the top level?

I was trying to do that with no success, can you assist?


ENTITY registers IS
PORT (

my_array out -- .....??

);
END;
 
Y

yossi

I have a question related to my design,



I have a component that has lots of registers (120 registers 8bit each).

In this case I can declare an Array in side this component.

my quaestion is:

can I drive it out of this component to the top level?



I was trying to do that with no success, can you assist?





ENTITY registers IS

PORT (



my_array out -- .....??



);

END;

hello everybody :)
Can somebody assist?
 
A

Andy

I have a question related to my design, I have a component that has lots of registers (120 registers 8bit each). In this case I can declare an Arrayin side this component. my quaestion is: can I drive it out of this component to the top level? I was trying to do that with no success, can you assist? ENTITY registers IS PORT ( my_array out -- .....?? ); END;

You can drive the array out on a port just fine, but you have to declare the type for the array (and therefore, the port) in a package that is invokedby not only the entity, but also the calling architecture and anything else that needs to declare a signal/variable or port of this type.

Andy
 
A

Anton Gunman

Hello,

You can do it as such:
------------------------------------------------------------
-- my_pkg.vhd
------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;

package my_pkg is
-- Array dimensions
constant ARRAY_SIZE : integer := 120;
constant REG_WIDTH : integer := 8;

-- Array type declaration
type my_array_type is array (0 to ARRAY_SIZE-1) of std_logic_vector(REG_WIDTH-1 downto 0);

end package my_pkg;

------------------------------------------------------------
-- registers.vhd
------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use work.my_pkg.all; -- Package (array declaration)

entity registers is

port (
--...
my_array_out : out my_array_type);
end registers;
--...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top