Verilog Array for Synthsis

Source: Internet
Author: User

Integer i,j;
Always @ (Posedge i_clk or Negedge i_rst_n) begin
if (!i_rst_n) begin
for (i = 0; i < i_wghtgridh; i = i + 1) begin
for (j = 0; J < i_wghtgridw; j = j + 1) begin
R_WEIGHTONWEIGHTS0A[I][J] <= 5 ' d0;
End
End
End
ELSE begin
R_WEIGHTONWEIGHTS0A[TEXEL_CNT_Y_R2][TEXEL_CNT_X_R2] <= W_weightonweights0;
End
End
Why design compiler-think this isn't right?
Because I_wghtgridh is a variable.

This is OK.
reg [4:0] r_weightonweights0a [7:0][7:0];
Integer i,j;
Always @ (Posedge i_clk or Negedge i_rst_n) begin
if (!i_rst_n) begin
for (i = 0; i < 8; i = i + 1) begin//NUM_PLP can use wire??
for (j = 0; J < 8; j = j + 1) begin
R_WEIGHTONWEIGHTS0A[I][J] <= 5 ' d0;
End
End
End
ELSE begin
R_WEIGHTONWEIGHTS0A[TEXEL_CNT_Y_R2][TEXEL_CNT_X_R2] <= W_weightonweights0;
End
End

1. The index number of the array must therefore be a constant. If the TEXEL_CNT_Y_R2 is not constant, it is unreasonable.

2.Verilog array does not see the waveform in Verdi, so array is recommended to write switch-case to select the index number.

Verilog Array for Synthsis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.