-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negative replicate gives Internal Error num
member accessed when data type is UNINITIALIZED
#3963
Comments
Can you extract into a minimal example please? |
A minimal example that crashes with internal error looks like this `timescale 1ns / 1ns
module receiver
#(
parameter IN_DW = 32,
parameter OUT_DW = 24
)
(
input clk_i,
output reg [OUT_DW-1:0] m_axis_out_tdata
);
localparam REQUIRED_OUT_DW = OUT_DW + 5;
reg [REQUIRED_OUT_DW - 1: 0] filter_result;
always @(posedge clk_i) begin
if (REQUIRED_OUT_DW >= OUT_DW) begin
m_axis_out_tdata <= filter_result[REQUIRED_OUT_DW - 1 -: OUT_DW];
end else begin
m_axis_out_tdata <= {{(OUT_DW - REQUIRED_OUT_DW){1'b0}}, filter_result};
end
end
endmodule I run it with This does not crash `timescale 1ns / 1ns
module receiver
#(
parameter IN_DW = 32,
parameter OUT_DW = 24
)
(
input clk_i,
output reg [OUT_DW-1:0] m_axis_out_tdata
);
localparam REQUIRED_OUT_DW = OUT_DW + 5;
reg [REQUIRED_OUT_DW - 1: 0] filter_result;
always @(posedge clk_i) begin
if (REQUIRED_OUT_DW >= OUT_DW) begin
m_axis_out_tdata <= filter_result[REQUIRED_OUT_DW - 1 -: OUT_DW];
end else begin
// m_axis_out_tdata <= {{(OUT_DW - REQUIRED_OUT_DW){1'b0}}, filter_result};
end
end
endmodule @wsnyder the crash seems to be caused by the line Also this does not crash `timescale 1ns / 1ns
module receiver
#(
parameter IN_DW = 32,
parameter OUT_DW = 24
)
(
input clk_i,
output reg [OUT_DW-1:0] m_axis_out_tdata
);
localparam REQUIRED_OUT_DW = OUT_DW - 5;
reg [REQUIRED_OUT_DW - 1: 0] filter_result;
always @(posedge clk_i) begin
if (REQUIRED_OUT_DW >= OUT_DW) begin
m_axis_out_tdata <= filter_result[REQUIRED_OUT_DW - 1 -: OUT_DW];
end else begin
m_axis_out_tdata <= {{(OUT_DW - REQUIRED_OUT_DW){1'b0}}, filter_result};
end
end
endmodule |
When I run it with v4.106 I get this interesting error message
When I run it with v4.228 I get the same error message as in my first post |
Debug output
|
This is a workaround for the bug `timescale 1ns / 1ns
module receiver
#(
parameter IN_DW = 32,
parameter OUT_DW = 24
)
(
input clk_i,
output reg [OUT_DW-1:0] m_axis_out_tdata
);
localparam REQUIRED_OUT_DW = OUT_DW + 5;
reg [REQUIRED_OUT_DW - 1: 0] filter_result;
localparam PAD_BITS = REQUIRED_OUT_DW >= OUT_DW ? 0 : OUT_DW - REQUIRED_OUT_DW;
always @(posedge clk_i) begin
if (REQUIRED_OUT_DW >= OUT_DW) begin
// take some MSBs
m_axis_out_tdata <= filter_result[REQUIRED_OUT_DW - 1 -: OUT_DW];
end else begin
// do zero padding
m_axis_out_tdata <= {{(PAD_BITS){1'b0}}, filter_result};
end
end
endmodule |
num
member accessed when data type is UNINITIALIZEDnum
member accessed when data type is UNINITIALIZED
Your code before workaround has effectively "{24-29}{1'b0}", and since concatenate sizes are unsigned this is a huge vector, which causes the crash. The way you worked around it, or similar, I believe is required by IEEE. |
I am getting the error
Internal Error: ../V3Number.h:196: `num` member accessed when data type is UNINITIALIZED
My verilator version is 5.006 compiled from git.
I am running it with this command line
The repo with the code is here: https://github.com/catkira/open5G_rx/tree/try_verilator
The bug can be reproduced by running tests/test_receiver.py
The text was updated successfully, but these errors were encountered: