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

Make all functions automatic #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion design/ifu/ifu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ assign tmp_bnk[2:0] = encode8_3(bp.btb_sel_f2[7:0]);
if(dec_tlu_br1_wb_pkt.br_error | dec_tlu_br1_wb_pkt.br_start_error)
$display("%7d BTB_ERR1: index: %0h bank: %0h start: %b rfpc: %h way: %h", `DEC.tlu.mcyclel[31:0]+32'ha,dec_tlu_br1_wb_pkt.index[`RV_BTB_ADDR_HI:`RV_BTB_ADDR_LO],dec_tlu_br1_wb_pkt.bank[1:0], dec_tlu_br1_wb_pkt.br_start_error, {exu_flush_path_final[31:1], 1'b0}, dec_tlu_br1_wb_pkt.way);
end // always @ (negedge clk)
function [2:0] encode8_3;
function automatic [2:0] encode8_3;
input [7:0] in;

encode8_3[2] = |in[7:4];
Expand Down
12 changes: 6 additions & 6 deletions design/ifu/ifu_bp_ctl.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1703,15 +1703,15 @@ assign fgmask_f2[0] = (~ifc_fetch_addr_f2[3] & ~ifc_fetch_addr_f2[2]



function [2:0] encode8_3;
function automatic [2:0] encode8_3;
input [7:0] in;

encode8_3[2] = |in[7:4];
encode8_3[1] = in[7] | in[6] | in[3] | in[2];
encode8_3[0] = in[7] | in[5] | in[3] | in[1];

endfunction
function [7:0] decode3_8;
function automatic [7:0] decode3_8;
input [2:0] in;

decode3_8[7] = in[2] & in[1] & in[0];
Expand All @@ -1724,7 +1724,7 @@ assign fgmask_f2[0] = (~ifc_fetch_addr_f2[3] & ~ifc_fetch_addr_f2[2]
decode3_8[0] = ~in[2] & ~in[1] & ~in[0];

endfunction
function [3:0] decode2_4;
function automatic [3:0] decode2_4;
input [1:0] in;

decode2_4[3] = in[1] & in[0];
Expand All @@ -1734,7 +1734,7 @@ assign fgmask_f2[0] = (~ifc_fetch_addr_f2[3] & ~ifc_fetch_addr_f2[2]

endfunction

function [3:0] countones;
function automatic [3:0] countones;
input [7:0] valid;

begin
Expand All @@ -1749,7 +1749,7 @@ countones[3:0] = {3'b0, valid[7]} +
{3'b0, valid[0]};
end
endfunction
function [2:0] newlru; // updated lru
function automatic [2:0] newlru; // updated lru
input [2:0] lru;// current lru
input [1:0] used;// hit way
begin
Expand All @@ -1765,7 +1765,7 @@ newlru[0] = (~lru[2] & lru[1] & ~used[1] & ~used[0]) | (~lru[1] & ~lru[0] & used
end
endfunction //

function [1:0] lru2way; // new repl way taking invalid ways into account
function automatic [1:0] lru2way; // new repl way taking invalid ways into account
input [2:0] lru; // current lru
input [2:0] v; // current way valids
begin
Expand Down