For
for
statement represent repetition.
Loop variable is placed before in
keyword,
and range is placed after it.
break
can be used to break the loop.
module ModuleA {
var a: logic<10>;
always_comb {
for i: u32 in 0..10 {
a += i;
if i == 5 {
break;
}
}
}
}