There is no mechanism in Verilog or SystemVerilog to execute a small snippet, such as the Python example you gave. That is, you cannot specify step 2 between bits.
You can do this with a for loop, and it doesn't need to be in the generation block, as in your own answer.
A modified example from your answer:
always @(*) begin for (int i = 0; i < FLOORS; i++) begin RELEVANT[i] <= FLOOR_REQUEST[i*2+FORWARD]; end end
This should synthesize everything in order as long as FLOORS is a constant.
source share