Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15329 Discussions

how to map many ports to a vector/array ?

Altera_Forum
Honored Contributor II
1,017 Views

Hi All, 

 

I have an entiry with a lot of ports. I'd like to map these ports to a vector/array. 

 

example

Ports: 

bit_000_0 : in std_logic;  

bit_000_1 : in std_logic;  

bit_000_2 : in std_logic;  

bit_000_3 : in std_logic;  

bit_000_4 : in std_logic;  

 

Desired mapping of the ports to a vector: 

vec (0) <= bit_000_0; 

vec (1) <= bit_000_1; 

vec (2) <= bit_000_2; 

vec (3) <= bit_000_3; 

vec (4) <= bit_000_4; 

 

Can I use a function/package for this purpose? There are a lot of such ports (~150), so I'd like to do these assignments in the separate file (e.g. package) and do not clutter the top entity/module file. Is this possible? 

 

Thank you!
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
79 Views

Concatenation: 

 

vec(4 downto 0) <= bit_000_4 & bit_000_3 & bit_000_2 & bit_000_1 & bit_000_0
Altera_Forum
Honored Contributor II
79 Views

 

--- Quote Start ---  

Concatenation: 

 

vec(4 downto 0) <= bit_000_4 & bit_000_3 & bit_000_2 & bit_000_1 & bit_000_0 

--- Quote End ---  

 

 

Could this assignment be done in the package? Remember that bit_000_4, bit_000_3, ... are ports - could they be observed from a package?
Altera_Forum
Honored Contributor II
79 Views

Because they are all single bits, then concatenation is about the only thing you can do.

Reply