From 2deaf1efefc4b02fac9ff25c2c5cc4af3ac6cb71 Mon Sep 17 00:00:00 2001 From: Adi Hayon Date: Mon, 21 May 2018 21:20:02 +0300 Subject: [PATCH] Changed use of N_MAX_GENERIC_REGS to N_GENERIC_REGS. --- rtl/hwpe_ctrl_regfile.sv | 4 ++-- rtl/hwpe_ctrl_slave.sv | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtl/hwpe_ctrl_regfile.sv b/rtl/hwpe_ctrl_regfile.sv index a1256f6..5b1a058 100644 --- a/rtl/hwpe_ctrl_regfile.sv +++ b/rtl/hwpe_ctrl_regfile.sv @@ -171,8 +171,8 @@ module hwpe_ctrl_regfile always_comb begin : regfile_latch_addr_proc if(flags_i.is_contexted == 1'b1) begin - regfile_latch_rd_addr = regfile_in_i.addr[LOG_REGS-1:0] + regfile_in_i.addr[LOG_REGS_MC-1:LOG_REGS]*N_IO_REGS - N_RESERVED_REGS - N_MAX_GENERIC_REGS + N_GENERIC_REGS - N_MANDATORY_REGS; // one mul x const + one add + one add with const - regfile_latch_wr_addr = regfile_in_i.addr[LOG_REGS-1:0] + regfile_in_i.addr[LOG_REGS_MC-1:LOG_REGS]*N_IO_REGS - N_RESERVED_REGS - N_MAX_GENERIC_REGS + N_GENERIC_REGS - N_MANDATORY_REGS; // one mul x const + one add + one add with const + regfile_latch_rd_addr = regfile_in_i.addr[LOG_REGS-1:0] + regfile_in_i.addr[LOG_REGS_MC-1:LOG_REGS]*N_IO_REGS - N_RESERVED_REGS - N_GENERIC_REGS - N_MANDATORY_REGS; // one mul x const + one add + one add with const + regfile_latch_wr_addr = regfile_in_i.addr[LOG_REGS-1:0] + regfile_in_i.addr[LOG_REGS_MC-1:LOG_REGS]*N_IO_REGS - N_RESERVED_REGS - N_GENERIC_REGS - N_MANDATORY_REGS; // one mul x const + one add + one add with const end else begin regfile_latch_rd_addr = regfile_in_i.addr[LOG_REGS-1:0] - N_RESERVED_REGS - N_MANDATORY_REGS; diff --git a/rtl/hwpe_ctrl_slave.sv b/rtl/hwpe_ctrl_slave.sv index 6561fa3..9e16508 100644 --- a/rtl/hwpe_ctrl_slave.sv +++ b/rtl/hwpe_ctrl_slave.sv @@ -151,7 +151,7 @@ module hwpe_ctrl_slave always_comb begin : flags_proc regfile_flags.is_mandatory = (cfg.add[LOG_REGS+2-1:2] <= N_MANDATORY_REGS+N_RESERVED_REGS-1) ? 1 : 0; // Accessed reg is mandatory (or reserved) - regfile_flags.is_contexted = (cfg.add[LOG_REGS+2-1:2] > N_MANDATORY_REGS+N_RESERVED_REGS+N_MAX_GENERIC_REGS-1) ? 1 : 0; // Accessed reg is contexted + regfile_flags.is_contexted = (cfg.add[LOG_REGS+2-1:2] > N_MANDATORY_REGS+N_RESERVED_REGS+N_GENERIC_REGS-1) ? 1 : 0; // Accessed reg is contexted regfile_flags.is_read = (cfg.req == 1'b1 && cfg.wen == 1'b1); regfile_flags.is_testset = (cfg.req == 1'b1 && cfg.wen == 1'b1 && cfg.add[LOG_REGS+2-1:2] == 1) ? 1 : 0; // Operation is a test&set to register context_ts regfile_flags.is_trigger = (cfg.req == 1'b1 && cfg.wen == 1'b0 && cfg.add[LOG_REGS+2-1:2] == 0) ? 1 : 0; // Operation is a trigger