Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17257 Discussions

ID for each module from the for generate

Altera_Forum
Honored Contributor II
1,443 Views

Hello guys, 

 

I instantiate a bunch of the same module with a for generate statement.  

I dont know how to store the hcu_id of the module( I need it in an another part of the system); with ID I mean the  

variable i of the for generate. I would need something like a constant input equal to the i variable of the for generate. 

 

Any ideas?? Thanks
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
549 Views

not quite sure I get the problem? it would be easy to pass in the loop value into a signal of the instatiation inside the generate, giving each instance access to it's ID number. 

 

Why not post some code so we have a better idea of what you are trying to do.
0 Kudos
Altera_Forum
Honored Contributor II
549 Views

Ok this is the top entity. I instantiate this module like this:  

g_upd_req_conn : FOR i IN 0 TO MAX_H_TILES - 1 GENERATE 

u_upd_req_conn : ENTITY work.upd_req_conn(beh) 

PORT MAP( 

rst_n => rst_n, 

clk => clk, 

ID => ??? 

); 

END GENERATE g_upd_req_conn; 

I need to give an ID to each module equal to the variable i, like a constant input. Any ideas?
0 Kudos
Altera_Forum
Honored Contributor II
549 Views

 

--- Quote Start ---  

Ok this is the top entity. I instantiate this module like this:  

g_upd_req_conn : FOR i IN 0 TO MAX_H_TILES - 1 GENERATE 

u_upd_req_conn : ENTITY work.upd_req_conn(beh) 

PORT MAP( 

rst_n => rst_n, 

clk => clk, 

ID => ??? 

); 

END GENERATE g_upd_req_conn; 

I need to give an ID to each module equal to the variable i, like a constant input. Any ideas? 

--- Quote End ---  

 

 

if ID is integer: 

 

g_upd_req_conn : FOR i IN 0 TO MAX_H_TILES - 1 GENERATE u_upd_req_conn : ENTITY work.upd_req_conn(beh) PORT MAP( rst_n => rst_n, clk => clk, ID => i ); END GENERATE g_upd_req_conn;
0 Kudos
Reply