Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:20:33+00:00 2026-06-14T07:20:33+00:00

I have a component: Component CAU is port ( CLK : in std_logic; RESET

  • 0

I have a component:

Component CAU is
    port 
    (
        CLK              : in std_logic;
        RESET            : in std_logic;
        START            : in std_logic;
        V_DIRECTION      : in vector_3d;
        P_ORIGIN         : in vector_3d;      
        V_NORMAL_IN      : in vector_3d;
        DOT_A            : in vector_3d;
        DOT_B            : in vector_3d;
        DOT_C            : in vector_3d;
        ID_DATA_IN       : in scalar;

        ID_DATA_OUT      : out scalar;
        V_REFLECT        : out vector_3d;          
        V_PASS           : out vector_3d;        
        P_INTERSECT      : out vector_3d;
        V_NORMAL_OUT     : out vector_3d;
        T_OUT            : out scalar;
        SUCCESS          : out std_logic; 
        FINISH           : out std_logic
    );   
end  Component; 

And I want to create 8 instances of it. each is called CAU_inst0, CAU_inst1, and so on. Each of the instances is connected the following way:

CAU_inst0 : CAU
 PORT MAP
 (
    CLK              => CLK_CAU,
    RESET            => RESET,
    START            => start_0_sig,
    V_DIRECTION      => v_direction_0_sig,
    P_ORIGIN         => p_origin_0_sig,
    V_NORMAL_IN      => v_normal_in_0_sig,
    DOT_A            => dot_a_0_sig,
    DOT_B            => dot_b_0_sig,
    DOT_C            => dot_c_0_sig,
    ID_DATA_IN       => id_data_in_0_sig,

    ID_DATA_OUT      => id_data_out_0_sig
    V_REFLECT        => v_reflect_0_sig,
    V_PASS           => v_pass_0_sig,
    P_INTERSECT      => p_intersect_0_sig,
    V_NORMAL_OUT     => v_normal_out_0_sig,
    T_OUT            => t_0_sig,
    SUCCESS          => success_0_sig,
    FINISH           => finish_0_sig
 );

where for each instance i the number 0 is replaced with i. What I did was to create a Matlab script that created the 8 different instances with the correct number. But it’s an ugly solution as it takes 170 lines of just the same code with little changes. Is there a way to create the components (and if possible the appropriate signals) in a loop inside the code to reduce cluter and line?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:20:34+00:00Added an answer on June 14, 2026 at 7:20 am

    What you are looking to use is a for…generate statement.

    Here is an example, similar to what you want to achieve:

    architecture GEN of REG_BANK is
      component REG
        port(D,CLK,RESET : in  std_ulogic;
             Q           : out std_ulogic);
      end component;
    begin
       GEN_REG: 
       for I in 0 to 3 generate
          REGX : REG port map
            (DIN(I), CLK, RESET, DOUT(I));
       end generate GEN_REG;
    end GEN;
    

    In your case, you will need to make all the signals that connect up to your block vectors and or vectors of vectors.

    For example, if you signal is currently defined as:

    signal v_normal_in_0_sig : std_logic_vector(7 downto 0);
    

    You will need to change it to:

    type vector16 is array (natural range <>) of std_logic_vector(15 downto 0);
    signal v_normal_in_sig : vector16(7 downto 0);
    

    In this case, you can now use your signal as v_normal_in_sig(i) to connect to the ith generated instanciation of your entity/component.

    Note that if you are using VHDL-2008, you can do the following instead…

    type vector_array is array (natural range <>) of std_logic_vector;
    signal v_normal_in_sig : vector_array(7 downto 0)(15 downto 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have: @Component class MyDecorator{ private Cache cache; /* some wrapped methods like get
Please consider such scenerio: I have component called TMenuItemSelector which has two published properties:
I have Facelet component and I have backing bean for it. When I include
I have a component that I hand over a function public var func :
I have a component that is made up of various components such as a
I have a component that i want to store to an SQLite database. public
I have a component where i want to display a custom jtooltip. That is
I have a component and I want to make a textarea on the admin
I have a component with a number of properties that have various attributes Normally
I have a component called a TableDataViewer that contains the following pieces of data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.