Fix misreading of spec: hartsel hart is selected in addition to those bits set in hart array mask, when hasel is set.
This commit is contained in:
parent
fb15894731
commit
c2756e79fc
|
@ -189,11 +189,12 @@ wire [N_HARTS-1:0] dmcontrol_op_mask;
|
||||||
generate
|
generate
|
||||||
if (N_HARTS > 1) begin: dmcontrol_multiple_harts
|
if (N_HARTS > 1) begin: dmcontrol_multiple_harts
|
||||||
|
|
||||||
// Note we don't need to use the "next" version of hart_array_mask since
|
// Selection is the hart selected by hartsel, *plus* the hart array mask
|
||||||
// it can't change simultaneously with a run/halt/reset request.
|
// if hasel is set. Note we don't need to use the "next" version of
|
||||||
|
// hart_array_mask since it can't change simultaneously with dmcontrol.
|
||||||
assign dmcontrol_op_mask =
|
assign dmcontrol_op_mask =
|
||||||
hasel_next ? hart_array_mask :
|
(hartsel_next >= N_HARTS ? {N_HARTS{1'b0}} : {{N_HARTS-1{1'b0}}, 1'b1} << hartsel_next)
|
||||||
hartsel_next >= N_HARTS ? {N_HARTS{1'b0}} : {{N_HARTS-1{1'b0}}, 1'b1} << hartsel_next;
|
| ({N_HARTS{hasel_next}} & hart_array_mask);
|
||||||
|
|
||||||
end else begin: dmcontrol_single_hart
|
end else begin: dmcontrol_single_hart
|
||||||
|
|
||||||
|
@ -553,22 +554,14 @@ assign hart_instr_data = {N_HARTS{
|
||||||
function status_any;
|
function status_any;
|
||||||
input [N_HARTS-1:0] status_mask;
|
input [N_HARTS-1:0] status_mask;
|
||||||
begin
|
begin
|
||||||
if (hasel) begin
|
status_any = status_mask[hartsel] || (hasel && |(status_mask & hart_array_mask));
|
||||||
status_any = |(status_mask & hart_array_mask);
|
|
||||||
end else begin
|
|
||||||
status_any = status_mask[hartsel];
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function status_all;
|
function status_all;
|
||||||
input [N_HARTS-1:0] status_mask;
|
input [N_HARTS-1:0] status_mask;
|
||||||
begin
|
begin
|
||||||
if (hasel) begin
|
status_all = status_mask[hartsel] && (!hasel || ~|(~status_mask & hart_array_mask));
|
||||||
status_all = ~|(~status_mask & hart_array_mask);
|
|
||||||
end else begin
|
|
||||||
status_all = status_mask[hartsel];
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue