Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17267 Discussions

select a component generated by gernerate stsement

Altera_Forum
Honored Contributor II
1,087 Views

hi  

 

im new to vhdl programming. i have a component ------comp port map (a(I),S(I), k);---- in file 1 which is generated 8 times by generate statement and in file 2 sub1 (file 1) is instantiated 2 times ... i have to add select signal with 8 bits in top file (file 2 )...now i need to write a logic to select comp2 when select signal in top file is 00000001 to 00001000 i.e component 1 to 4 and 00010000 to 10000000 for 5 to 8....pls give a solution ... 

file 1: 

 

entity sub1 is 

(x:in std_logic 

y:in std_logic 

z:out std_logic); 

------some other signals 

end entity 

 

architecture b of a is 

---- 

---- lines of code 

-,--- 

for I in 0 to 7 generate 

accname: acc port map (a(I),S(I), k); 

cpuname: cpu port map (h(I),o(I), f); 

 

end architecture; 

 

 

file 2: 

entity maintop is 

(l:in std_logic 

m:in std_logic 

n:out std_logic); 

------some other signals 

end entity 

 

 

architecture toparc of maintop is 

 

comp1 : sub1 port map (x,y, z); 

comp2 : sub1 port map (x,y, z); 

 

end arc
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
385 Views

? from your question it is unclear what strategy you try to use to acomplish problem.  

Try simple multiplexor , change sub1 entity design 

Draw a port connectivity diagram that you await to clarify your question
0 Kudos
Reply