Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

instantiation with in an always block

Status
Not open for further replies.

anusha vasanta

Member level 1
Joined
Sep 23, 2014
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
251
Hi all,
is there any way to do the instantiation inside always block, here i had a code which had a tmp_reg first it should have one value and next it should take some other how could it be possible for this generate block
Code:
			genvar m;
			generate
			for(m=0;m<BLOCKS;m=m+1)
			begin :RAM4

			  assign   tmp_reg=mic_h2_result;
			  assign block_data[m]=data_new[(m*128)+127:(m*128)]; 
			  assign block_out[m]=(tmp_reg^block_data[m]);
			  Top_PipelinedCipher ROM4(clk,reset,data_valid_in,key_valid_in,key,block_out[m],valid_out,block_result[m]);
			  assign tmp_reg=block_result[m];
			end
			endgenerate
 

Hi Anusha,

When you use generate you should always remember - it is not a run time function. Once synthesis is done for one generated condition , it will not change at run time, as it is hardware inside the FPGA and real electrical connections are made once you synthesize your design.
 

is there any way to do the instantiation inside always block
I presume you already know the answer is no.

It's nevertheless easy to connect the in-and outputs of the instantiated module with sequential code inside an always block by wires and regs.
 

Haa i know that we can't use instantiation inside an always block but heard that gen block can be written inside always block so i got the doubt of that kind.
Actually i had a tmp_reg contains one value and again i was assigning some other continous values to my tmp_reg like in the above mentioned code i know that it was wrong but i was unable to find a logic for that. help me thanku
 

but heard that gen block can be written inside always block so i got the doubt of that kind
It can't.

Actually i had a tmp_reg contains one value and again i was assigning some other continous values to my tmp_reg like in the above mentioned code i know that it was wrong but i was unable to find a logic for that.
At least to me ist completely unclear what you want to achieve here. Instead of posting code snippets that are illegal according to Verilog rules, you should describe what you exactly want to achieve.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top