- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
do you know how to terminate an "if" instruction? the instructions are repeating over and over again and i don't want to repeat.I need a break terminal or something like that.I search on the net but it doesn't work.If you know...please help. Best regards, tastaxLink Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if in C on a Nios ?
if in VHDL ? if in Verilog ? Is the "if" in HDL and is it inside a clocked process/always block ?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is in verilog and is in a clocked always block. How can i execute the if instruction just once?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It will be executed every time the clock comes.
The only way to avoid it is to remember that it was already ran once: logic once = 1'b0; always @ (posedge clk) begin if (once == 1'b0) begin // insert your code here once <= 1'b1; // remember that it already ran once end end- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thx a lot! your example was very helpfull for me and it works for my project!

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