Edrisborne
11/10/2022, 4:33 PM/foss/tools/riscv-gnu-toolchain-rv32i/217e7f3debe424d61374d31e33a091a630535937/lib/gcc/riscv32-unknown-linux-gnu/11.1.0/../../../../riscv32-unknown-linux-gnu/bin/ld: test_la.elf section
.data' will not fit in region dff'
`/foss/tools/riscv-gnu-toolchain-rv32i/217e7f3debe424d61374d31e33a091a630535937/lib/gcc/riscv32-unknown-linux-gnu/11.1.0/../../../../riscv32-unknown-linux-gnu/bin/ld: region dff' overflowed by 1624 bytes
collect2: error: ld returned 1 exit status
It seems that there is not enough memory for my program. I have declared some large arrays (~160 in size) which have the data and other signals values in them, outside the main function, I think the error is due to these large arrays. I have make the error go away for now by changing the type of the arrays from int
to unit8_t
(only works if my data values are small). But I think with defining more variables in my program the error will show itself again, considering the 1KB sram. Any suggestions?
int la_clock [164] = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
int la_reset [164] = { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 0, 0};
and in the main function:
for(int i= 0; i < 164; i++){
reg_la0_data = (0x00000000 | la_dat_i[i]) |
(0x00000000 | la_wr_en[i] << 29) |
(0x00000000 | la_reset[i] << 30) |
(0x00000000 | la_clock[i] << 31) ;
}
Edrisborne
11/12/2022, 7:48 PMMatt Venn
11/15/2022, 11:51 AMEdrisborne
11/15/2022, 7:43 PMEdrisborne
11/15/2022, 7:44 PMMatt Venn
11/15/2022, 7:55 PMEdrisborne
11/16/2022, 2:15 PMEdrisborne
11/16/2022, 2:18 PMMatt Venn
11/16/2022, 3:50 PMMatt Venn
11/16/2022, 3:50 PMEdrisborne
11/16/2022, 3:55 PMMatt Venn
11/16/2022, 4:31 PMMatt Venn
11/16/2022, 4:31 PMEdrisborne
11/16/2022, 5:44 PMEdrisborne
11/18/2022, 6:57 AMMatt Venn
11/18/2022, 1:30 PMMatt Venn
11/18/2022, 1:31 PMMatt Venn
11/18/2022, 1:42 PMMatt Venn
11/18/2022, 1:42 PMMatt Venn
11/18/2022, 1:43 PMEdrisborne
11/19/2022, 11:08 AMEdrisborne
11/19/2022, 11:17 AMMatt Venn
11/19/2022, 12:09 PMTim Edwards
11/19/2022, 2:23 PMwire la_write;
assign la_write = ~la_oenb[BITS-1:0];
You are assigning a vector value to a single wire.
But I think the main issue is here:
always @(posedge clk) begin
if (reset) begin
sr_data <= 164'd0;
ready <= 0;
end else if(la_write || (valid && !ready && wen && (wb_addr == BASE_ADDR))) begin
$display("writing");
ready <=1;
sr_data[WIDTH-1:1] <= sr_data[WIDTH-2:0];
sr_data[0] <= Sin;
end
end
You are resetting ready
only on reset. When there is a write, you set ready
(which is wb_ack_o
back to the wishbone master) high, but there is nothing in the code to set it low again, so your project is effectively blocking any further wishbone access. The correct code should be:
always @(posedge clk) begin
if (reset) begin
sr_data <= 164'd0;
ready <= 0;
end else begin
if (la_write || (valid && !ready && wen && (wb_addr == BASE_ADDR))) begin
$display("writing");
ready <=1;
sr_data[WIDTH-1:1] <= sr_data[WIDTH-2:0];
sr_data[0] <= Sin;
end else begin
ready <= 0;
end
end
end
Edrisborne
11/20/2022, 7:49 PM