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

Is the OPT_NONESEL option currently the same as the multiple slaves? #47

Open
aylons opened this issue Mar 19, 2022 · 1 comment
Open

Comments

@aylons
Copy link

aylons commented Mar 19, 2022

Hi, first, thank you for all the content and code you publish, I've been following for a while. Right now I'm studying your crossbar code and realized that the request array has the same implementation for OPT_NONESEL and for !(OPT_NONESEL) & !(NS == 1).

I'm guessing a "nonesel slave" is missing as indicated by the comment, but is the code supposed to be duplicated this way or some difference in the actual request decoding is to be implemented?

wb2axip/rtl/addrdecode.v

Lines 124 to 161 in c36b2a8

generate if (OPT_NONESEL)
begin : NO_DEFAULT_REQUEST
// {{{
reg [NS-1:0] r_request;
// Need to create a slave to describe when nothing is selected
//
always @(*)
begin
for(iM=0; iM<NS; iM=iM+1)
r_request[iM] = i_valid && prerequest[iM];
if (!OPT_NONESEL && (NS > 1 && |prerequest[NS-1:1]))
r_request[0] = 1'b0;
end
assign request[NS-1:0] = r_request;
// }}}
end else if (NS == 1)
begin : SINGLE_SLAVE
// {{{
assign request[0] = i_valid;
// }}}
end else begin
// {{{
reg [NS-1:0] r_request;
always @(*)
begin
for(iM=0; iM<NS; iM=iM+1)
r_request[iM] = i_valid && prerequest[iM];
if (!OPT_NONESEL && (NS > 1 && |prerequest[NS-1:1]))
r_request[0] = 1'b0;
end
assign request[NS-1:0] = r_request;
// }}}
end endgenerate
// }}}

@ZipCPU
Copy link
Owner

ZipCPU commented Mar 20, 2022

The nothing is selected slave decoding is handled in the next block down. The logic you are pointing out is the decoding logic for everything else. What makes address 0 special in this logic is that it's used as a catch all address. If nothing else is selected, and slave zero would work (mask == 0), then slave zero becomes the default instead of the extra "nothing is selected" error generating slave.

Yes, the two blocks you point out could be merged. Thanks for pointing that out. No, they don't do the same thing, but the difference is captured by parameter settings in if (!OPT_NONESEL && NS > 1 ..., so the logic looks the same as you've pointed out. Feel free to submit a patch if you would like, or I might do it myself ...

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

No branches or pull requests

2 participants