1) Hi, I'm trying to write a code that looks like this
1 | localparam NUM_OF_LINES = 2;
|
2 | localparam ROWS = 2;
|
3 |
|
4 | genvar i, j;
|
5 |
|
6 | generate
|
7 | for (i = 0; i < NUM_OF_LINES; i = i+1)
|
8 | begin: lines_loop
|
9 | for (i = 0; i < NUM_OF_ROWS; i = i+1)
|
10 | begin: rows_loop
|
11 | always @(posedge clk)
|
12 | data[i][j] <= prev_data [i][j];
|
13 | end
|
14 | end
|
ofcourse all the regs are declared.
I can't compile it when it's like that, what is the right syntax for
loop within a loop?
2)
localparam WIDTH = 10;
How can I right an addition command with the width of the parameter?
explanation: I'm trying to do:
data <= data + 1;
when data is the width of WIDTH but I don't want it to do the addition
with 32 bits so i tried to write "data <= data + WIDTH'h1" but it's not
working