diff --git a/Bender.yml b/Bender.yml index d46ccac1f1..ff8d8e0219 100644 --- a/Bender.yml +++ b/Bender.yml @@ -25,7 +25,6 @@ sources: files: - core/include/cv64a6_imafdcv_sv39_config_pkg.sv - core/include/riscv_pkg.sv - - common/local/rvfi/rvfi_pkg.sv - core/include/ariane_dm_pkg.sv - core/include/ariane_pkg.sv - core/mmu_sv39/tlb.sv @@ -37,7 +36,6 @@ sources: files: - core/include/cv64a6_imafdc_sv39_config_pkg.sv - core/include/riscv_pkg.sv - - common/local/rvfi/rvfi_pkg.sv - core/include/ariane_dm_pkg.sv - core/include/ariane_pkg.sv - core/mmu_sv39/tlb.sv @@ -49,7 +47,6 @@ sources: files: - core/include/cv32a6_imac_sv0_config_pkg.sv - core/include/riscv_pkg.sv - - common/local/rvfi/rvfi_pkg.sv - core/include/ariane_dm_pkg.sv - core/include/ariane_pkg.sv - core/mmu_sv32/cva6_tlb_sv32.sv @@ -61,7 +58,6 @@ sources: files: - core/include/cv32a6_imac_sv32_config_pkg.sv - core/include/riscv_pkg.sv - - common/local/rvfi/rvfi_pkg.sv - core/include/ariane_dm_pkg.sv - core/include/ariane_pkg.sv - core/mmu_sv32/cva6_tlb_sv32.sv diff --git a/common/local/rvfi/rvfi_pkg.sv b/common/local/rvfi/rvfi_pkg.sv deleted file mode 100644 index 113afafee6..0000000000 --- a/common/local/rvfi/rvfi_pkg.sv +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020 Thales DIS design services SAS -// -// 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/ -// -// Original Author: Jean-Roch COULON - Thales - -package rvfi_pkg; - - localparam NRET = 1; - localparam ILEN = 32; - - typedef struct packed { - logic [NRET-1:0] valid; - logic [NRET*64-1:0] order; - logic [NRET*ILEN-1:0] insn; - logic [NRET-1:0] trap; - logic [NRET*riscv::XLEN-1:0] cause; - logic [NRET-1:0] halt; - logic [NRET-1:0] intr; - logic [NRET*2-1:0] mode; - logic [NRET*2-1:0] ixl; - logic [NRET*5-1:0] rs1_addr; - logic [NRET*5-1:0] rs2_addr; - logic [NRET*riscv::XLEN-1:0] rs1_rdata; - logic [NRET*riscv::XLEN-1:0] rs2_rdata; - logic [NRET*5-1:0] rd_addr; - logic [NRET*riscv::XLEN-1:0] rd_wdata; - - logic [NRET*riscv::XLEN-1:0] pc_rdata; - logic [NRET*riscv::XLEN-1:0] pc_wdata; - - logic [NRET*riscv::VLEN-1:0] mem_addr; - logic [NRET*riscv::PLEN-1:0] mem_paddr; - logic [NRET*(riscv::XLEN/8)-1:0] mem_rmask; - logic [NRET*(riscv::XLEN/8)-1:0] mem_wmask; - logic [NRET*riscv::XLEN-1:0] mem_rdata; - logic [NRET*riscv::XLEN-1:0] mem_wdata; - } rvfi_instr_t; - - -endpackage diff --git a/config_pkg_generator.py b/config_pkg_generator.py index a42bf72c80..82fdc663e2 100644 --- a/config_pkg_generator.py +++ b/config_pkg_generator.py @@ -154,7 +154,6 @@ def setup_parser_config_generator(): "PerfCounterEn": "CVA6ConfigPerfCounterEn", "DcacheType": "CVA6ConfigDcacheType", "MmuPresent": "CVA6ConfigMmuPresent", - "RvfiTrace": "RVFI_PORT", # Ignored parameters "ignored": "CVA6ConfigRvfiTrace", } diff --git a/core/Flist.cva6 b/core/Flist.cva6 index 904310906c..8ffb28ffdd 100644 --- a/core/Flist.cva6 +++ b/core/Flist.cva6 @@ -57,7 +57,6 @@ ${CVA6_REPO_DIR}/vendor/openhwgroup/cvfpu/src/fpu_div_sqrt_mvp/hdl/preprocess_mv ${CVA6_REPO_DIR}/core/include/${TARGET_CFG}_config_pkg.sv ${CVA6_REPO_DIR}/core/include/riscv_pkg.sv -${CVA6_REPO_DIR}/common/local/rvfi/rvfi_pkg.sv ${CVA6_REPO_DIR}/core/include/ariane_dm_pkg.sv // Note: depends on fpnew_pkg, above ${CVA6_REPO_DIR}/core/include/ariane_pkg.sv diff --git a/core/Flist.cva6_gate b/core/Flist.cva6_gate index ec60f654a1..5819cc9c21 100644 --- a/core/Flist.cva6_gate +++ b/core/Flist.cva6_gate @@ -10,7 +10,6 @@ ${CVA6_REPO_DIR}/core/include/${TARGET_CFG}_config_pkg.sv ${CVA6_REPO_DIR}/core/include/riscv_pkg.sv -${CVA6_REPO_DIR}/common/local/rvfi/rvfi_pkg.sv ${CVA6_REPO_DIR}/core/include/ariane_dm_pkg.sv ${CVA6_REPO_DIR}/core/include/ariane_pkg.sv // TODO: ariane_axi_pkg is dependent on this. diff --git a/core/cva6.sv b/core/cva6.sv index 926f80aa67..ba29e0bb9c 100644 --- a/core/cva6.sv +++ b/core/cva6.sv @@ -41,8 +41,8 @@ module cva6 import ariane_pkg::*; #( logic [ariane_pkg::NRET*(riscv::XLEN/8)-1:0] mem_rmask; logic [ariane_pkg::NRET*(riscv::XLEN/8)-1:0] mem_wmask; logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_rdata; - logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_wdata; }, - parameter type rvfi_port_t = rvfi_instr_t [NrCommitPorts-1:0], + logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_wdata; + }, // parameter ariane_pkg::ariane_cfg_t ArianeCfg = ariane_pkg::ArianeDefaultConfig, parameter type cvxif_req_t = cvxif_pkg::cvxif_req_t, @@ -69,7 +69,7 @@ module cva6 import ariane_pkg::*; #( input logic debug_req_i, // debug request (async) // RISC-V formal interface port (`rvfi`): // Can be left open when formal tracing is not needed. - output rvfi_port_t rvfi_o, + output rvfi_instr_t [NrCommitPorts-1:0] rvfi_o, output cvxif_req_t cvxif_req_o, input cvxif_resp_t cvxif_resp_i, // L15 (memory side) diff --git a/core/include/ariane_pkg.sv b/core/include/ariane_pkg.sv index 6bcef0e4c7..c596cdc648 100644 --- a/core/include/ariane_pkg.sv +++ b/core/include/ariane_pkg.sv @@ -146,7 +146,6 @@ package ariane_pkg; // to uniquely identify the entry in the scoreboard localparam ASID_WIDTH = (riscv::XLEN == 64) ? 16 : 1; localparam BITS_SATURATION_COUNTER = 2; - localparam NR_COMMIT_PORTS = cva6_config_pkg::CVA6ConfigNrCommitPorts; localparam ENABLE_RENAME = cva6_config_pkg::CVA6ConfigRenameEn; @@ -690,7 +689,6 @@ package ariane_pkg; // --------------- localparam RVFI = cva6_config_pkg::CVA6ConfigRvfiTrace; - typedef rvfi_pkg::rvfi_instr_t [NR_COMMIT_PORTS-1:0] rvfi_port_t; typedef struct packed { logic [riscv::VLEN-1:0] pc; // PC of instruction diff --git a/core/include/cv32a60x_config_pkg.sv b/core/include/cv32a60x_config_pkg.sv index 071b472bff..2766514250 100644 --- a/core/include/cv32a60x_config_pkg.sv +++ b/core/include/cv32a60x_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `define RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv32a6_embedded_config_pkg.sv b/core/include/cv32a6_embedded_config_pkg.sv index 79da7ffc9b..6c6f52d254 100644 --- a/core/include/cv32a6_embedded_config_pkg.sv +++ b/core/include/cv32a6_embedded_config_pkg.sv @@ -73,13 +73,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 0; - `define RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv b/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv index 1ca6badd94..a68f4434e2 100644 --- a/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv +++ b/core/include/cv32a6_ima_sv32_fpga_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `undef RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv32a6_imac_sv0_config_pkg.sv b/core/include/cv32a6_imac_sv0_config_pkg.sv index 4a8d434b7b..665992f0d8 100644 --- a/core/include/cv32a6_imac_sv0_config_pkg.sv +++ b/core/include/cv32a6_imac_sv0_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `define RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv32a6_imac_sv32_config_pkg.sv b/core/include/cv32a6_imac_sv32_config_pkg.sv index c9ad04791e..08eddf066c 100644 --- a/core/include/cv32a6_imac_sv32_config_pkg.sv +++ b/core/include/cv32a6_imac_sv32_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `define RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv32a6_imafc_sv32_config_pkg.sv b/core/include/cv32a6_imafc_sv32_config_pkg.sv index e1eba4738e..a1dda130ba 100644 --- a/core/include/cv32a6_imafc_sv32_config_pkg.sv +++ b/core/include/cv32a6_imafc_sv32_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `define RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv64a6_imafdc_sv39_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_config_pkg.sv index c081122281..f7c7cdf218 100644 --- a/core/include/cv64a6_imafdc_sv39_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `define RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv b/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv index cf0cc1b225..f03e71be26 100644 --- a/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv +++ b/core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `undef RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/core/include/cv64a6_imafdcv_sv39_config_pkg.sv b/core/include/cv64a6_imafdcv_sv39_config_pkg.sv index 82e4675e6c..2889a01890 100644 --- a/core/include/cv64a6_imafdcv_sv39_config_pkg.sv +++ b/core/include/cv64a6_imafdcv_sv39_config_pkg.sv @@ -74,13 +74,6 @@ package cva6_config_pkg; localparam CVA6ConfigMmuPresent = 1; - `define RVFI_PORT - - // Do not modify - `ifdef RVFI_PORT - localparam CVA6ConfigRvfiTrace = 1; - `else - localparam CVA6ConfigRvfiTrace = 0; - `endif + localparam CVA6ConfigRvfiTrace = 1; endpackage diff --git a/corev_apu/fpga/src/ariane_xilinx.sv b/corev_apu/fpga/src/ariane_xilinx.sv index 2e2d8a175d..d85b8c9bd3 100644 --- a/corev_apu/fpga/src/ariane_xilinx.sv +++ b/corev_apu/fpga/src/ariane_xilinx.sv @@ -12,6 +12,7 @@ // Author: Florian Zaruba module ariane_xilinx ( +// WARNING: Do not define input parameters. This causes the FPGA build to fail. `ifdef GENESYSII input logic sys_clk_p , input logic sys_clk_n , @@ -159,7 +160,6 @@ localparam int unsigned NrCommitPorts = cva6_config_pkg::CVA6ConfigNrCommitPorts // RVFI localparam int unsigned IsRVFI = 0; localparam type rvfi_instr_t = logic; -localparam type rvfi_port_t = logic; // 24 MByte in 8 byte words @@ -710,7 +710,6 @@ ariane #( .NrCommitPorts ( NrCommitPorts ), .IsRVFI ( IsRVFI ), .rvfi_instr_t ( rvfi_instr_t ), - .rvfi_port_t ( rvfi_port_t ), .ArianeCfg ( ariane_soc::ArianeSocCfg ) ) i_ariane ( .clk_i ( clk ), diff --git a/corev_apu/include/traced_instr_pkg.sv b/corev_apu/include/traced_instr_pkg.sv deleted file mode 100644 index 4a1f4dd5e7..0000000000 --- a/corev_apu/include/traced_instr_pkg.sv +++ /dev/null @@ -1,24 +0,0 @@ -// See LICENSE.Berkeley for license details. - -// Author: Abraham Gonzalez, UC Berkeley -// Date: 24.02.2020 -// Description: Traced Instruction and Port (using in Rocket Chip based systems) - -package traced_instr_pkg; - - typedef struct packed { - logic clock; - logic reset; - logic valid; - logic [63:0] iaddr; - logic [31:0] insn; - logic [1:0] priv; - logic exception; - logic interrupt; - logic [63:0] cause; - logic [63:0] tval; - } traced_instr_t; - - typedef traced_instr_t [ariane_pkg::NR_COMMIT_PORTS-1:0] trace_port_t; - -endpackage diff --git a/corev_apu/src/ariane.sv b/corev_apu/src/ariane.sv index a5789657ee..28b49701e3 100644 --- a/corev_apu/src/ariane.sv +++ b/corev_apu/src/ariane.sv @@ -19,7 +19,6 @@ module ariane import ariane_pkg::*; #( // RVFI parameter int unsigned IsRVFI = 0, parameter type rvfi_instr_t = logic, - parameter type rvfi_port_t = logic, // parameter ariane_pkg::ariane_cfg_t ArianeCfg = ariane_pkg::ArianeDefaultConfig, parameter int unsigned AxiAddrWidth = ariane_axi::AddrWidth, @@ -43,11 +42,9 @@ module ariane import ariane_pkg::*; #( // Timer facilities input logic time_irq_i, // timer interrupt in (async) input logic debug_req_i, // debug request (async) -`ifdef RVFI_PORT // RISC-V formal interface port (`rvfi`): // Can be left open when formal tracing is not needed. - output rvfi_pkg::rvfi_instr_t [NrCommitPorts-1:0] rvfi_o, -`endif + output rvfi_instr_t [NrCommitPorts-1:0] rvfi_o, `ifdef PITON_ARIANE // L15 (memory side) output wt_cache_pkg::l15_req_t l15_req_o, @@ -66,7 +63,6 @@ module ariane import ariane_pkg::*; #( .NrCommitPorts ( NrCommitPorts ), .IsRVFI ( IsRVFI ), .rvfi_instr_t ( rvfi_instr_t ), - .rvfi_port_t ( rvfi_port_t ), // .ArianeCfg ( ArianeCfg ), .AxiAddrWidth ( AxiAddrWidth ), @@ -86,11 +82,7 @@ module ariane import ariane_pkg::*; #( .ipi_i ( ipi_i ), .time_irq_i ( time_irq_i ), .debug_req_i ( debug_req_i ), -`ifdef RVFI_PORT .rvfi_o ( rvfi_o ), -`else - .rvfi_o ( ), -`endif .cvxif_req_o ( cvxif_req ), .cvxif_resp_i ( cvxif_resp ), `ifdef PITON_ARIANE diff --git a/corev_apu/tb/ariane_testharness.sv b/corev_apu/tb/ariane_testharness.sv index 6c8fd08198..a78e650673 100644 --- a/corev_apu/tb/ariane_testharness.sv +++ b/corev_apu/tb/ariane_testharness.sv @@ -43,8 +43,8 @@ module ariane_testharness #( logic [ariane_pkg::NRET*(riscv::XLEN/8)-1:0] mem_rmask; logic [ariane_pkg::NRET*(riscv::XLEN/8)-1:0] mem_wmask; logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_rdata; - logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_wdata; }, - parameter type rvfi_port_t = rvfi_instr_t [NrCommitPorts-1:0], + logic [ariane_pkg::NRET*riscv::XLEN-1:0] mem_wdata; + }, // parameter int unsigned AXI_USER_WIDTH = ariane_pkg::AXI_USER_WIDTH, parameter int unsigned AXI_USER_EN = ariane_pkg::AXI_USER_EN, @@ -640,7 +640,6 @@ module ariane_testharness #( .NrCommitPorts ( NrCommitPorts ), .IsRVFI ( IsRVFI ), .rvfi_instr_t ( rvfi_instr_t ), - .rvfi_port_t ( rvfi_instr_t [NrCommitPorts-1:0] ), .ArianeCfg ( ariane_soc::ArianeSocCfg ) ) i_ariane ( .clk_i ( clk_i ), @@ -650,9 +649,7 @@ module ariane_testharness #( .irq_i ( irqs ), .ipi_i ( ipi ), .time_irq_i ( timer_irq ), -`ifdef RVFI_PORT .rvfi_o ( rvfi ), -`endif // Disable Debug when simulating with Spike `ifdef SPIKE_TANDEM .debug_req_i ( 1'b0 ), @@ -684,10 +681,12 @@ module ariane_testharness #( end rvfi_tracer #( + .NrCommitPorts(NrCommitPorts), + .rvfi_instr_t(rvfi_instr_t), + // .HART_ID(hart_id), .DEBUG_START(0), - .DEBUG_STOP(0), - .NrCommitPorts(NrCommitPorts) + .DEBUG_STOP(0) ) rvfi_tracer_i ( .clk_i(clk_i), .rst_ni(rst_ni), diff --git a/corev_apu/tb/rvfi_tracer.sv b/corev_apu/tb/rvfi_tracer.sv index 9c8688edba..6101b1c6bb 100644 --- a/corev_apu/tb/rvfi_tracer.sv +++ b/corev_apu/tb/rvfi_tracer.sv @@ -8,14 +8,18 @@ // Original Author: Jean-Roch COULON - Thales module rvfi_tracer #( + // Pipeline + parameter int unsigned NrCommitPorts = 0, + // RVFI + parameter type rvfi_instr_t = logic, + // parameter logic [7:0] HART_ID = '0, parameter int unsigned DEBUG_START = 0, - parameter int unsigned NrCommitPorts = 0, parameter int unsigned DEBUG_STOP = 0 )( input logic clk_i, input logic rst_ni, - input rvfi_pkg::rvfi_instr_t[NrCommitPorts-1:0] rvfi_i, + input rvfi_instr_t[NrCommitPorts-1:0] rvfi_i, output logic[31:0] end_of_test_o );