From 8355a70adeea0496c3942b7ca9ef70c9958c254f Mon Sep 17 00:00:00 2001 From: Fatima Saleem Date: Mon, 4 Sep 2023 13:56:48 +0500 Subject: [PATCH 1/5] removed rename block --- core/Flist.cva6 | 1 - core/issue_read_operands.sv | 2 +- core/issue_stage.sv | 27 ++-------- core/re_name.sv | 103 ------------------------------------ 4 files changed, 4 insertions(+), 129 deletions(-) delete mode 100644 core/re_name.sv diff --git a/core/Flist.cva6 b/core/Flist.cva6 index b05ec1a5d0..ed029ffb85 100644 --- a/core/Flist.cva6 +++ b/core/Flist.cva6 @@ -121,7 +121,6 @@ ${CVA6_REPO_DIR}/core/serdiv.sv ${CVA6_REPO_DIR}/core/perf_counters.sv ${CVA6_REPO_DIR}/core/ariane_regfile_ff.sv ${CVA6_REPO_DIR}/core/ariane_regfile_fpga.sv -${CVA6_REPO_DIR}/core/re_name.sv // NOTE: scoreboard.sv modified for DSIM (unchanged for other simulators) ${CVA6_REPO_DIR}/core/scoreboard.sv ${CVA6_REPO_DIR}/core/store_buffer.sv diff --git a/core/issue_read_operands.sv b/core/issue_read_operands.sv index 75a883ffd0..43b0b2f278 100644 --- a/core/issue_read_operands.sv +++ b/core/issue_read_operands.sv @@ -24,7 +24,7 @@ module issue_read_operands import ariane_pkg::*; #( input logic flush_i, // stall input logic stall_i, - // coming from rename + // coming from decoder input scoreboard_entry_t issue_instr_i, input logic issue_instr_valid_i, output logic issue_ack_o, diff --git a/core/issue_stage.sv b/core/issue_stage.sv index 1aff2c20d8..47cf244497 100644 --- a/core/issue_stage.sv +++ b/core/issue_stage.sv @@ -112,10 +112,6 @@ module issue_stage import ariane_pkg::*; #( rs3_len_t rs3_sb_iro; logic rs3_valid_iro_sb; - scoreboard_entry_t issue_instr_rename_sb; - logic issue_instr_valid_rename_sb; - logic issue_ack_sb_rename; - scoreboard_entry_t issue_instr_sb_iro; logic issue_instr_valid_sb_iro; logic issue_ack_iro_sb; @@ -129,23 +125,6 @@ module issue_stage import ariane_pkg::*; #( assign issue_instr_o = issue_instr_sb_iro; assign issue_instr_hs_o = issue_instr_valid_sb_iro & issue_ack_iro_sb; - // --------------------------------------------------------- - // 1. Re-name - // --------------------------------------------------------- - re_name #( - .CVA6Cfg ( CVA6Cfg ) - ) i_re_name ( - .clk_i ( clk_i ), - .rst_ni ( rst_ni ), - .flush_i ( flush_i ), - .flush_unissied_instr_i ( flush_unissued_instr_i ), - .issue_instr_i ( decoded_instr_i ), - .issue_instr_valid_i ( decoded_instr_valid_i ), - .issue_ack_o ( decoded_instr_ack_o ), - .issue_instr_o ( issue_instr_rename_sb ), - .issue_instr_valid_o ( issue_instr_valid_rename_sb ), - .issue_ack_i ( issue_ack_sb_rename ) - ); // --------------------------------------------------------- // 2. Manage instructions in a scoreboard @@ -170,9 +149,9 @@ module issue_stage import ariane_pkg::*; #( .rs3_o ( rs3_sb_iro ), .rs3_valid_o ( rs3_valid_iro_sb ), - .decoded_instr_i ( issue_instr_rename_sb ), - .decoded_instr_valid_i ( issue_instr_valid_rename_sb ), - .decoded_instr_ack_o ( issue_ack_sb_rename ), + .decoded_instr_i ( decoded_instr_i ), + .decoded_instr_valid_i ( decoded_instr_valid_i ), + .decoded_instr_ack_o ( decoded_instr_ack_o ), .issue_instr_o ( issue_instr_sb_iro ), .issue_instr_valid_o ( issue_instr_valid_sb_iro ), .issue_ack_i ( issue_ack_iro_sb ), diff --git a/core/re_name.sv b/core/re_name.sv deleted file mode 100644 index 8fd88f3fd7..0000000000 --- a/core/re_name.sv +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (C) 2017 ETH Zurich, University of Bologna -// -// Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 -// You may obtain a copy of the License at https://solderpad.org/licenses/ -// -// Author: Florian Zaruba, ETH Zurich -// Date: 03.10.2017 -// Description: Re-name registers - -module re_name import ariane_pkg::*; #( - parameter config_pkg::cva6_cfg_t CVA6Cfg = config_pkg::cva6_cfg_empty -) ( - input logic clk_i, // Clock - input logic rst_ni, // Asynchronous reset active low - input logic flush_i, // Flush renaming state - input logic flush_unissied_instr_i, - // from/to scoreboard - input scoreboard_entry_t issue_instr_i, - input logic issue_instr_valid_i, - output logic issue_ack_o, - // from/to issue and read operands - output scoreboard_entry_t issue_instr_o, - output logic issue_instr_valid_o, - input logic issue_ack_i -); - - // pass through handshaking signals - assign issue_instr_valid_o = issue_instr_valid_i; - assign issue_ack_o = issue_ack_i; - - // keep track of re-naming data structures - logic [31:0] re_name_table_gpr_n, re_name_table_gpr_q; - logic [31:0] re_name_table_fpr_n, re_name_table_fpr_q; - - // ------------------- - // Re-naming - // ------------------- - always_comb begin - // MSB of the renamed source register addresses - logic name_bit_rs1, name_bit_rs2, name_bit_rs3, name_bit_rd; - - // default assignments - re_name_table_gpr_n = re_name_table_gpr_q; - re_name_table_fpr_n = re_name_table_fpr_q; - issue_instr_o = issue_instr_i; - - if (issue_ack_i && !flush_unissied_instr_i) begin - // if we acknowledge the instruction tic the corresponding destination register - if (ariane_pkg::is_rd_fpr_cfg(issue_instr_i.op, CVA6Cfg.FpPresent)) - re_name_table_fpr_n[issue_instr_i.rd[4:0]] = re_name_table_fpr_q[issue_instr_i.rd[4:0]] ^ 1'b1; - else - re_name_table_gpr_n[issue_instr_i.rd[4:0]] = re_name_table_gpr_q[issue_instr_i.rd[4:0]] ^ 1'b1; - end - - // select name bit according to the register file used for source operands - name_bit_rs1 = is_rs1_fpr_cfg(issue_instr_i.op, CVA6Cfg.FpPresent) ? re_name_table_fpr_q[issue_instr_i.rs1[4:0]] - : re_name_table_gpr_q[issue_instr_i.rs1[4:0]]; - name_bit_rs2 = is_rs2_fpr_cfg(issue_instr_i.op, CVA6Cfg.FpPresent) ? re_name_table_fpr_q[issue_instr_i.rs2[4:0]] - : re_name_table_gpr_q[issue_instr_i.rs2[4:0]]; - // rs3 is only used in certain FP operations and held like an immediate - name_bit_rs3 = re_name_table_fpr_q[issue_instr_i.result[4:0]]; // make sure only the addr bits are read - - // select name bit according to the state it will have after renaming - name_bit_rd = ariane_pkg::is_rd_fpr_cfg(issue_instr_i.op, CVA6Cfg.FpPresent) ? re_name_table_fpr_q[issue_instr_i.rd[4:0]] ^ 1'b1 - : re_name_table_gpr_q[issue_instr_i.rd[4:0]] ^ (issue_instr_i.rd != '0); // don't rename x0 - - // re-name the source registers - issue_instr_o.rs1 = { ENABLE_RENAME & name_bit_rs1, issue_instr_i.rs1[4:0] }; - issue_instr_o.rs2 = { ENABLE_RENAME & name_bit_rs2, issue_instr_i.rs2[4:0] }; - - // re-name the third operand in imm if it's actually an operand - if (is_imm_fpr_cfg(issue_instr_i.op, CVA6Cfg.FpPresent) || (issue_instr_i.op == OFFLOAD && CVA6Cfg.NrRgprPorts == 3)) begin - issue_instr_o.result = { ENABLE_RENAME & name_bit_rs3, issue_instr_i.result[4:0]}; - end - // re-name the destination register - issue_instr_o.rd = { ENABLE_RENAME & name_bit_rd, issue_instr_i.rd[4:0] }; - - // we don't want to re-name gp register zero, it is non-writeable anyway - re_name_table_gpr_n[0] = 1'b0; - - // Handle flushes - if (flush_i) begin - re_name_table_gpr_n = '0; - re_name_table_fpr_n = '0; - end - - end - - // ------------------- - // Registers - // ------------------- - always_ff @(posedge clk_i or negedge rst_ni) begin - if (~rst_ni) begin - re_name_table_gpr_q <= '0; - re_name_table_fpr_q <= '0; - end else begin - re_name_table_gpr_q <= re_name_table_gpr_n; - re_name_table_fpr_q <= re_name_table_fpr_n; - end - end -endmodule From 23098693d95fa2437606fefea25bf555df8aa619 Mon Sep 17 00:00:00 2001 From: Fatima Saleem Date: Mon, 4 Sep 2023 13:57:48 +0500 Subject: [PATCH 2/5] removed rename parameter from the config files --- core/include/ariane_pkg.sv | 2 -- core/include/cv32a60x_config_pkg.sv | 2 -- core/include/cv32a6_embedded_config_pkg.sv | 2 -- core/include/cv32a6_ima_sv32_fpga_config_pkg.sv | 2 -- core/include/cv32a6_imac_sv0_config_pkg.sv | 2 -- core/include/cv32a6_imac_sv32_config_pkg.sv | 2 -- core/include/cv32a6_imafc_sv32_config_pkg.sv | 2 -- core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv | 2 -- core/include/cv64a6_imafdc_sv39_config_pkg.sv | 2 -- core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv | 2 -- core/include/cv64a6_imafdcv_sv39_config_pkg.sv | 2 -- util/config_pkg_generator.py | 3 --- 12 files changed, 25 deletions(-) diff --git a/core/include/ariane_pkg.sv b/core/include/ariane_pkg.sv index d61d98cb6a..0d0e50ea87 100644 --- a/core/include/ariane_pkg.sv +++ b/core/include/ariane_pkg.sv @@ -128,8 +128,6 @@ package ariane_pkg; localparam ASID_WIDTH = (riscv::XLEN == 64) ? 16 : 1; localparam BITS_SATURATION_COUNTER = 2; - localparam ENABLE_RENAME = cva6_config_pkg::CVA6ConfigRenameEn; - localparam ISSUE_WIDTH = 1; // depth of store-buffers, this needs to be a power of two diff --git a/core/include/cv32a60x_config_pkg.sv b/core/include/cv32a60x_config_pkg.sv index a61070387b..eb1e9d8afd 100644 --- a/core/include/cv32a60x_config_pkg.sv +++ b/core/include/cv32a60x_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv32a6_embedded_config_pkg.sv b/core/include/cv32a6_embedded_config_pkg.sv index 6fdf9ee69a..0a845f2aa6 100644 --- a/core/include/cv32a6_embedded_config_pkg.sv +++ b/core/include/cv32a6_embedded_config_pkg.sv @@ -36,8 +36,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv b/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv index 34f4630e04..451f774604 100644 --- a/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv +++ b/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 8192; localparam CVA6ConfigIcacheSetAssoc = 2; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv32a6_imac_sv0_config_pkg.sv b/core/include/cv32a6_imac_sv0_config_pkg.sv index 170bec18be..52f645e0f4 100644 --- a/core/include/cv32a6_imac_sv0_config_pkg.sv +++ b/core/include/cv32a6_imac_sv0_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv32a6_imac_sv32_config_pkg.sv b/core/include/cv32a6_imac_sv32_config_pkg.sv index b7b0fc0eee..4c6c98926c 100644 --- a/core/include/cv32a6_imac_sv32_config_pkg.sv +++ b/core/include/cv32a6_imac_sv32_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv32a6_imafc_sv32_config_pkg.sv b/core/include/cv32a6_imafc_sv32_config_pkg.sv index 72f505d62c..71dab67b58 100644 --- a/core/include/cv32a6_imafc_sv32_config_pkg.sv +++ b/core/include/cv32a6_imafc_sv32_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv b/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv index d43c5c75c0..b24360fa9a 100644 --- a/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv +++ b/core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv64a6_imafdc_sv39_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_config_pkg.sv index 3a7dbb9a82..551900c747 100644 --- a/core/include/cv64a6_imafdc_sv39_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv index e6b7b897da..412fe2880b 100644 --- a/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/core/include/cv64a6_imafdcv_sv39_config_pkg.sv b/core/include/cv64a6_imafdcv_sv39_config_pkg.sv index 790322bf82..a76a54cb3a 100644 --- a/core/include/cv64a6_imafdcv_sv39_config_pkg.sv +++ b/core/include/cv64a6_imafdcv_sv39_config_pkg.sv @@ -37,8 +37,6 @@ package cva6_config_pkg; localparam CVA6ConfigDataUserEn = 0; localparam CVA6ConfigDataUserWidth = CVA6ConfigXlen; - localparam CVA6ConfigRenameEn = 0; - localparam CVA6ConfigIcacheByteSize = 16384; localparam CVA6ConfigIcacheSetAssoc = 4; localparam CVA6ConfigIcacheLineWidth = 128; diff --git a/util/config_pkg_generator.py b/util/config_pkg_generator.py index d801e71622..c7a1f3ff2b 100644 --- a/util/config_pkg_generator.py +++ b/util/config_pkg_generator.py @@ -55,8 +55,6 @@ def setup_parser_config_generator(): help="Data User enable ? 1 : enable, 0 : disable") parser.add_argument("--duser_w", type=int, default=None, choices=list(range(1,64)), help="Data User Width ? [1-64]") - parser.add_argument("--RenameEn", type=int, default=None, choices=[0,1], - help="RenameEn ? 1 : enable, 0 : disable") parser.add_argument("--IcacheByteSize", type=int, default=None, help="Instruction cache size in bytes") parser.add_argument("--IcacheSetAssoc", type=int, default=None, @@ -131,7 +129,6 @@ def setup_parser_config_generator(): "iuser_w" : "CVA6ConfigFetchUserWidth", "duser_en" : "CVA6ConfigDataUserEn", "duser_w" : "CVA6ConfigDataUserWidth", - "RenameEn" : "CVA6ConfigRenameEn", "IcacheByteSize" : "CVA6ConfigIcacheByteSize", "IcacheSetAssoc" : "CVA6ConfigIcacheSetAssoc", "IcacheLineWidth" : "CVA6ConfigIcacheLineWidth", From 8febe208493b1367d2d1cadea7a61fcee221963a Mon Sep 17 00:00:00 2001 From: Fatima Saleem Date: Mon, 4 Sep 2023 17:17:00 +0500 Subject: [PATCH 3/5] updating the REG_ADDR_SIZE --- core/include/ariane_pkg.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/include/ariane_pkg.sv b/core/include/ariane_pkg.sv index 0d0e50ea87..083f937e10 100644 --- a/core/include/ariane_pkg.sv +++ b/core/include/ariane_pkg.sv @@ -159,8 +159,8 @@ package ariane_pkg; localparam riscv::xlen_t OPENHWGROUP_MVENDORID = {{riscv::XLEN-32{1'b0}}, 32'h0602}; localparam riscv::xlen_t ARIANE_MARCHID = {{riscv::XLEN-32{1'b0}}, 32'd3}; - // 32 registers + 1 bit for re-naming = 6 - localparam REG_ADDR_SIZE = 6; + // 32 registers + localparam REG_ADDR_SIZE = 5; // Read ports for general purpose register files localparam NR_RGPR_PORTS = 2; From 2a249ad62d71049f4fffedb3e0beb33f798d1977 Mon Sep 17 00:00:00 2001 From: Fatima Saleem Date: Thu, 7 Sep 2023 20:09:58 +0500 Subject: [PATCH 4/5] removing the rename param from CI --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1658ae0f2a..cb5a8298c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -236,7 +236,7 @@ pub_hwconfig: matrix: - DV_SIMULATORS: ["veri-testharness,spike"] DV_HWCONFIG_OPTS: - - "--default_config=cv32a60x --isa=rv32imac --RenameEn=1" + - "--default_config=cv32a60x --isa=rv32imac" variables: DASHBOARD_JOB_TITLE: "HW config $DV_SIMULATORS $DV_HWCONFIG_OPTS" DASHBOARD_JOB_DESCRIPTION: "Short tests to challenge target configurations" From 2921f877edca71d96369ac53cfaecb14dc4d3ddb Mon Sep 17 00:00:00 2001 From: Fatima Saleem Date: Thu, 7 Sep 2023 21:44:40 +0500 Subject: [PATCH 5/5] updated the gates count for embedded config --- .gitlab-ci/expected_synth.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci/expected_synth.yml b/.gitlab-ci/expected_synth.yml index 2aac810a39..cf4a633bae 100644 --- a/.gitlab-ci/expected_synth.yml +++ b/.gitlab-ci/expected_synth.yml @@ -3,4 +3,4 @@ cv64a6_imafdc_sv39: cv32a60x: gates: 160719 cv32a6_embedded: - gates: 127977 + gates: 128515