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.

instantiating a module inside an always block

Status
Not open for further replies.

yupina-chan

Member level 2
Member level 2
Joined
Nov 27, 2013
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Visit site
Activity points
397
hi. can i instantiate a module inside an always block?
what i want to do is save values to a line buffer. i only want to execute my line buffer only at a certain period of time so inside my always block(at positive clock edge the values enter), i have a counter. whenever the counter reaches the specified count, it performs the line buffer module. how can i make this in verilog? thanks in advance
 

A module doesnt get "executed" or "performed", it gets instantiated. So it cannot be instantiated inside an always block. Instantiating a module is like placing a chip on a circuit board, and you wouldnt want to add or remove chips based on certain conditions during run-time.
 

so how can i get over with this problem? like how can i save the entered values at a certain period of time?
example: only the values entered at 20<count<40 is saved but the input is still streaming
 

thanks for the reply. in what module should i create the write enable? can you elaborate further please?
 

You need to create it so that it connects to the write enable of the memory. So creating at the same level as the counter would be sensible, as you can easily do the compare there.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top