-
Notifications
You must be signed in to change notification settings - Fork 475
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
axil_adapter_wr : Modelsim error "part select is reversed" #46
Comments
I just ran into this problem as well in |
I think I did it, #49 EDIT 0: Oh I'm sorry. I just realized you have a problem with EDIT 1: Never mind, I misunderstood some things. Lets discuss in the MR. I think there are some reasonable workarounds. |
Some simulators are buggy and complain incorrectly about unreachable code. Specifically what simulator are you using, and how are the module parameters set? |
In my case, simulator is Modelsim. |
Yea, I am using ModelSim 2020.1 here. |
I get a similar error in Riviera (2022.04). Specifically with mixed language simulation of AXI_STRB_WIDTH = AXIL_STRB_WIDTH = 4
I was able to get around this by disabling SLP ( |
I have the same issue -- there's an illegal slice in modules like axi_axil_adapter_wr.sv (and probably a few other places). Basically the design includes slices in both directions big:small and small:big, so they can't possibly both be valid and it causes VCS to error out. Slices look like this: addr_reg[(AXIL_ADDR_BIT_OFFSET - 1):AXI_ADDR_BIT_OFFSET]
AND
addr_reg[(AXI_ADDR_BIT_OFFSET - 1):AXIL_ADDR_BIT_OFFSET] But if you have everything 32-bits wide, then: AXIL_DATA_WIDTH = 32
AXIL_STRB_WIDTH = (AXIL_DATA_WIDTH/8) = 4
AXIL_ADDR_BIT_OFFSET = $clog2(AXIL_STRB_WIDTH) = 2
AXI_DATA_WIDTH = 32
AXI_STRB_WIDTH = (AXI_DATA_WIDTH/8) = 4
AXI_ADDR_BIT_OFFSET = $clog2(AXI_STRB_WIDTH) = 2
addr_reg[AXIL_ADDR_BIT_OFFSET-1:AXI_ADDR_BIT_OFFSET] = addr_reg[1:2] -> illegal slice Just grepping for "ADDR_BIT_OFFSET", it looks like this bug affects 6 files:
What I think I'm going to do for now is add a compile time assertion that AXI_DATA_WIDTH == AXIL_DATA_WIDTH, and remove those slices everywhere. So, since there is no data width conversion happening, then lines like this: data_next[addr_reg[AXI_ADDR_BIT_OFFSET-1:AXIL_ADDR_BIT_OFFSET]*SEGMENT_DATA_WIDTH +: SEGMENT_DATA_WIDTH] = m_axil_rdata; Become this: data_next = m_axil_rdata; And lines like this: s_axi_rdata_next = data_reg >> (addr_reg[AXIL_ADDR_BIT_OFFSET-1:AXI_ADDR_BIT_OFFSET] * AXI_DATA_WIDTH); Just become this: s_axi_rdata_next = data_reg; |
Update: nevermind; I saw #28 is also a duplicate of this, and the issue is just that the slices are invalid in unreachable if/else clauses in an always_comb. A lot of tools require invalid slices like that to be in generate if/else clauses -- including our version of VCS, it turns out. So, I'll just refactor the if/else to be outside the always_comb and be inside a generate/endgenerate. |
Simulator: Modelsim
Tb connection:
axi4lite-master-bfm <-> axil_adapter <-> axil_ram
In simulation I found error:
" ** Fatal: (vsim-3373) /home/peio/fpgawork/cores/verilog-axi/rtl/axil_adapter_wr.v(215): Range of part-select into 'm_axil_awaddr_reg' is reversed."
axil_adapter_wr.v(215) is:
m_axil_wstrb_next = s_axil_wstrb << (m_axil_awaddr_reg[M_ADDR_BIT_OFFSET - 1:S_ADDR_BIT_OFFSET] * S_STRB_WIDTH);
M_ADDR_BIT_OFFSET=2
S_ADDR_BIT_OFFSET=2
simulator doesn't like m_axil_awaddr_reg[1:2]
is it a bug in axil_adapter_wr?
The text was updated successfully, but these errors were encountered: