1 Star 7 Fork 5

LoongsonEdu/openLA500

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
perf_counter.v 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
chenzes 提交于 2024-04-21 11:27 . proj init
module perf_counter (
input clk ,
input reset ,
input dcache_miss ,
input icache_miss ,
input commit_inst ,
input br_inst ,
input mem_inst ,
input br_pre ,
input br_pre_error
);
reg[31:0] dcache_miss_counter;
reg[31:0] icache_miss_counter;
reg[31:0] commit_inst_counter;
reg[31:0] br_inst_counter;
reg[31:0] mem_inst_counter;
reg[31:0] br_pre_counter;
reg[31:0] br_pre_error_counter;
always @(posedge clk) begin
if (reset) begin
dcache_miss_counter <= 32'b0;
icache_miss_counter <= 32'b0;
commit_inst_counter <= 32'b0;
br_inst_counter <= 32'b0;
mem_inst_counter <= 32'b0;
br_pre_counter <= 32'b0;
br_pre_error_counter <= 32'b0;
end
else begin
if (dcache_miss) begin
dcache_miss_counter <= dcache_miss_counter + 32'b1;
end
if (icache_miss) begin
icache_miss_counter <= icache_miss_counter + 32'b1;
end
if (commit_inst) begin
commit_inst_counter <= commit_inst_counter + 32'b1;
end
if (br_inst) begin
br_inst_counter <= br_inst_counter + 32'b1;
end
if (mem_inst) begin
mem_inst_counter <= mem_inst_counter + 32'b1;
end
if (br_pre) begin
br_pre_counter <= br_pre_counter + 32'b1;
end
if (br_pre_error) begin
br_pre_error_counter <= br_pre_error_counter + 32'b1;
end
end
end
endmodule
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/loongson-edu/open-la500.git
git@gitee.com:loongson-edu/open-la500.git
loongson-edu
open-la500
openLA500
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385