fixed committed instrs count
This commit is contained in:
@@ -18,23 +18,35 @@ module VX_commit #(
|
|||||||
VX_writeback_if writeback_if,
|
VX_writeback_if writeback_if,
|
||||||
VX_cmt_to_csr_if cmt_to_csr_if
|
VX_cmt_to_csr_if cmt_to_csr_if
|
||||||
);
|
);
|
||||||
|
localparam NCMTW = $clog2(`NUM_EXS*`NUM_THREADS+1);
|
||||||
|
|
||||||
// CSRs update
|
// CSRs update
|
||||||
|
|
||||||
wire [`NUM_EXS-1:0] commited_mask;
|
wire [`NUM_EXS-1-1:0] exu_committed;
|
||||||
assign commited_mask = {alu_commit_if.valid,
|
wire [`NUM_THREADS-1:0] lsu_committed;
|
||||||
lsu_commit_if.valid,
|
wire [$clog2(`NUM_EXS-1+1)-1:0] exu_commits;
|
||||||
|
wire [$clog2(`NUM_THREADS+1)-1:0] lsu_commits;
|
||||||
|
|
||||||
|
assign exu_committed = {alu_commit_if.valid,
|
||||||
csr_commit_if.valid,
|
csr_commit_if.valid,
|
||||||
mul_commit_if.valid,
|
mul_commit_if.valid,
|
||||||
fpu_commit_if.valid,
|
fpu_commit_if.valid,
|
||||||
gpu_commit_if.valid};
|
gpu_commit_if.valid};
|
||||||
|
|
||||||
wire [$clog2(`NUM_EXS+1)-1:0] num_commits;
|
assign lsu_committed = {`NUM_THREADS{lsu_commit_if.valid}} & lsu_commit_if.tmask;
|
||||||
|
|
||||||
VX_countones #(
|
VX_countones #(
|
||||||
.N(`NUM_EXS)
|
.N(`NUM_EXS-1)
|
||||||
) valids_counter (
|
) exu_counter (
|
||||||
.valids(commited_mask),
|
.valids(exu_committed),
|
||||||
.count (num_commits)
|
.count (exu_commits)
|
||||||
|
);
|
||||||
|
|
||||||
|
VX_countones #(
|
||||||
|
.N(`NUM_THREADS)
|
||||||
|
) lsu_counter (
|
||||||
|
.valids(lsu_committed),
|
||||||
|
.count (lsu_commits)
|
||||||
);
|
);
|
||||||
|
|
||||||
fflags_t fflags;
|
fflags_t fflags;
|
||||||
@@ -54,20 +66,22 @@ module VX_commit #(
|
|||||||
fflags_t fflags_r;
|
fflags_t fflags_r;
|
||||||
reg has_fflags_r;
|
reg has_fflags_r;
|
||||||
reg [`NW_BITS-1:0] wid_r;
|
reg [`NW_BITS-1:0] wid_r;
|
||||||
reg [$clog2(`NUM_EXS+1)-1:0] num_commits_r;
|
reg [$clog2(`NUM_EXS-1+1)-1:0] exu_cmt_r;
|
||||||
|
reg [$clog2(`NUM_THREADS+1)-1:0] lsu_cmt_r;
|
||||||
reg csr_update_r;
|
reg csr_update_r;
|
||||||
|
|
||||||
always @(posedge clk) begin
|
always @(posedge clk) begin
|
||||||
csr_update_r <= (| commited_mask);
|
csr_update_r <= (| exu_committed) | lsu_commit_if.valid;
|
||||||
fflags_r <= fflags;
|
fflags_r <= fflags;
|
||||||
has_fflags_r <= fpu_commit_if.valid && fpu_commit_if.has_fflags;
|
has_fflags_r <= fpu_commit_if.valid && fpu_commit_if.has_fflags;
|
||||||
wid_r <= fpu_commit_if.wid;
|
wid_r <= fpu_commit_if.wid;
|
||||||
num_commits_r <= (num_commits << $clog2(`NUM_THREADS));
|
exu_cmt_r <= exu_commits;
|
||||||
|
lsu_cmt_r <= lsu_commits;
|
||||||
end
|
end
|
||||||
|
|
||||||
assign cmt_to_csr_if.valid = csr_update_r;
|
assign cmt_to_csr_if.valid = csr_update_r;
|
||||||
assign cmt_to_csr_if.wid = wid_r;
|
assign cmt_to_csr_if.wid = wid_r;
|
||||||
assign cmt_to_csr_if.num_commits = num_commits_r;
|
assign cmt_to_csr_if.num_commits = {exu_cmt_r, `NT_BITS'(0)} + NCMTW'(lsu_cmt_r);
|
||||||
assign cmt_to_csr_if.has_fflags = has_fflags_r;
|
assign cmt_to_csr_if.has_fflags = has_fflags_r;
|
||||||
assign cmt_to_csr_if.fflags = fflags_r;
|
assign cmt_to_csr_if.fflags = fflags_r;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ interface VX_cmt_to_csr_if ();
|
|||||||
|
|
||||||
wire [`NW_BITS-1:0] wid;
|
wire [`NW_BITS-1:0] wid;
|
||||||
|
|
||||||
wire [$clog2(`NUM_EXS+1)-1:0] num_commits;
|
wire [$clog2(`NUM_EXS*`NUM_THREADS+1)-1:0] num_commits;
|
||||||
|
|
||||||
wire has_fflags;
|
wire has_fflags;
|
||||||
fflags_t fflags;
|
fflags_t fflags;
|
||||||
|
|||||||
Reference in New Issue
Block a user