shainky
Junior Member level 1
- Joined
- Apr 18, 2009
- Messages
- 17
- Helped
- 0
- Reputation
- 0
- Reaction score
- 1
- Trophy points
- 1,281
- Activity points
- 1,414
hi,
can i use if else inside generate statement?
I think we cannot use assign statement with if statement.
But the moment i am removing assign statement i am getting spyglass lint errors.
Is this code synthesizable?
can i use if else inside generate statement?
Code dot - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 generate for (i = 0; i < my_size; i = i + 1) begin : size u_mux(.in(index[i]), .sel(idx_int[i]), .out(side[4*i +: 4])); if (i == 'd0) assign my_data[64*i +: 64] = {{56{1'b0}},data[8*i +: 8]}; else if (i == 'd1) assign my_data[64*i +: 64] = (datasize == 1'b1) ? {{48{1'b0}}, data[8*i +: 16]} : {{56{1'b0}},data[8*i +: 8]}; else assign my_data[64*i +: 64] = {{56{1'b0}},data[((8*i)+8) +: 8]}; end endgenerate
I think we cannot use assign statement with if statement.
But the moment i am removing assign statement i am getting spyglass lint errors.
Is this code synthesizable?
Last edited by a moderator: