- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
Is it possible to use always@block within always block? The reason I want to do that is I try to construct multiple synchronised blocks using For loop, and you need to put loop statement in a always/initial block. My code is like:
always
begin
for(i=0;i<5;i=i+1)begin
always@(posedge clk)
begin
...
end
end
end
I'm not sure whether this is synthesizable or not, please give some advice. Cheers.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You'll want a generate statement
In this example: http://www.asic-world.com/verilog/verilog2k2.html You can replace memory U with your always structure Just be sure you don't generate multiple drivers for whatever reg you are writing- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- You'll want a generate statement In this example: http://www.asic-world.com/verilog/verilog2k2.html You can replace memory U with your always structure Just be sure you don't generate multiple drivers for whatever reg you are writing --- Quote End --- Can this example be synthesized?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
generate-for loops are synthesizable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It does not make sense for an always block within an always block
yes, generate if is better choice
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page