Skip to content
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

Wrong parameter value assigned to PageAddrWidth of idma_legalizer_page_splitter in idma_legalizer.sv.tpl? #51

Open
Kevin99214 opened this issue Jul 1, 2024 · 2 comments · May be fixed by #53
Assignees

Comments

@Kevin99214
Copy link

I've been running into an issue synthesizing idma_legalizer_page_splitter in the block below. It is saying that i is out of range

  always_comb begin : proc_range_select
        page_offset = '0;
        for (int i = 0; i < PageAddrWidth; i++) begin
            page_offset[i] = page_addr_width > i ? addr_i[i] : 1'b0;
        end
    end

The discrepancy seems to be in idma_legalizer.sv.tpl. The instantiation of idma_legalizer_page_splitter has parameter PageAddrWidth set to PageSize, but it passes in page_addr_t which has a width of $clog2(PageSize).

idma_legalizer_page_splitter #(
      .OffsetWidth   ( OffsetWidth ),
      .PageAddrWidth ( PageSize    ),
      .addr_t        ( addr_t      ),
      .page_len_t    ( page_len_t  ),
      .page_addr_t   ( page_addr_t )
  )

Is this a typo or have I missed something?

@thommythomaso thommythomaso self-assigned this Jul 4, 2024
@thommythomaso
Copy link
Collaborator

Can you please provide some more information about your setup? Which tool are you using to synthesize the hardware? What parameterization?

@Kevin99214
Copy link
Author

Sorry, by synthesizing I meant a SynthesisError (from Spyglass Lint). This is the exact error from it.

0xEEB	SYNTH_5255		SynthesisError	external/opensrc-idma/src/backend/idma_legalizer_page_splitter.sv	53	1000	idma_legalizer_page_splitter -> Illegal bit select. Index 11 for "page_offset" is out of range [10:0] in expression: "page_offset[I]"

I am using the AXI version of the DMA, parameter values from the idma_legalizer_rw_axi are:

DataWidth = 64
AddrWidth = 56
StrbWidth = 8
OffsetWidth = 3
PageSize = 2048
PageAddrWidth = 11

In module declaration:
-> PageSize of 2048 gets passed to the parameter of PageAddrWidth
-> page_addr_t is typedef logic [PageAddrWidth-1:0]

In always_comb + for loop:
-> PageAddrWidth is 2048
-> page_offset is declared as page_addr_t (11 bit wide logic)

Not an urgent issue, just seeing if my lint cleanup is done correctly

thommythomaso added a commit that referenced this issue Jul 9, 2024
github-actions bot pushed a commit that referenced this issue Jul 9, 2024
-----

Deployed from f1dc74d
@micprog micprog linked a pull request Jul 17, 2024 that will close this issue
github-actions bot pushed a commit that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants