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

PCU: fix reset and SPR write #47

Merged
merged 2 commits into from Feb 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions rtl/verilog/mor1kx_pcu.v
Expand Up @@ -88,15 +88,15 @@ module mor1kx_pcu
for(pcu_num = 0; pcu_num < OPTION_PERFCOUNTERS_NUM + 1; pcu_num = pcu_num + 1) begin: pcu_generate
always @(posedge clk `OR_ASYNC_RST) begin
if (rst) begin
pcu_pccr[pcu_num] = 32'd0;
pcu_pcmr[pcu_num] = 32'd0 | 1 << `OR1K_PCMR_CP;
pcu_pccr[pcu_num] <= 32'd0;
pcu_pcmr[pcu_num] <= 32'd0 | 1 << `OR1K_PCMR_CP;
// we could write pcu registers only in system mode
end else if (spr_we_i && spr_sys_mode_i) begin
if (pcu_pccr_access)
pcu_pccr[spr_addr_i[2:0]] <= spr_dat_i;
if (pcu_pccr_access & (spr_addr_i[2:0] == pcu_num))
pcu_pccr[pcu_num] <= spr_dat_i;
// WPE are not implemented, hence we do not update WPE part
if (pcu_pcmr_access) begin
pcu_pcmr[spr_addr_i[2:0]][`OR1K_PCMR_DDS:`OR1K_PCMR_CISM] <=
if (pcu_pcmr_access && (spr_addr_i[2:0] == pcu_num)) begin
pcu_pcmr[pcu_num][`OR1K_PCMR_DDS:`OR1K_PCMR_CISM] <=
spr_dat_i[`OR1K_PCMR_DDS:`OR1K_PCMR_CISM];
end else if (((pcu_pcmr[pcu_num][`OR1K_PCMR_CISM] & spr_sys_mode_i) |
(pcu_pcmr[pcu_num][`OR1K_PCMR_CIUM] & ~spr_sys_mode_i))) begin
Expand Down