From 019607ecc8eb3cbe02481fd69f8db214ec515963 Mon Sep 17 00:00:00 2001 From: Yinan Xu Date: Tue, 17 Oct 2023 23:32:30 +0800 Subject: [PATCH] Remove the legacy RAMHelper --- src/test/csrc/common/ram.cpp | 12 --------- src/test/vsrc/common/ram.v | 48 ------------------------------------ 2 files changed, 60 deletions(-) delete mode 100644 src/test/vsrc/common/ram.v diff --git a/src/test/csrc/common/ram.cpp b/src/test/csrc/common/ram.cpp index 11a8ef243..aa4499a9c 100644 --- a/src/test/csrc/common/ram.cpp +++ b/src/test/csrc/common/ram.cpp @@ -300,12 +300,6 @@ extern "C" uint64_t difftest_ram_read(uint64_t rIdx) { return rdata; } -extern "C" uint64_t ram_read_helper(uint8_t en, uint64_t rIdx) { - if (!en) - return 0; - return difftest_ram_read(rIdx); -} - extern "C" void difftest_ram_write(uint64_t wIdx, uint64_t wdata, uint64_t wmask) { if (simMemory) { if (!simMemory->in_range_u64(wIdx)) { @@ -316,12 +310,6 @@ extern "C" void difftest_ram_write(uint64_t wIdx, uint64_t wdata, uint64_t wmask } } -extern "C" void ram_write_helper(uint64_t wIdx, uint64_t wdata, uint64_t wmask, uint8_t wen) { - if (wen) { - difftest_ram_write(wIdx, wdata, wmask); - } -} - uint64_t pmem_read(uint64_t raddr) { if (raddr % sizeof(uint64_t)) { printf("Warning: pmem_read only supports 64-bit aligned memory access\n"); diff --git a/src/test/vsrc/common/ram.v b/src/test/vsrc/common/ram.v deleted file mode 100644 index 0d95cdf98..000000000 --- a/src/test/vsrc/common/ram.v +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************************** -* Copyright (c) 2020-2023 Institute of Computing Technology, Chinese Academy of Sciences -* Copyright (c) 2020-2021 Peng Cheng Laboratory -* -* DiffTest is licensed under Mulan PSL v2. -* You can use this software according to the terms and conditions of the Mulan PSL v2. -* You may obtain a copy of Mulan PSL v2 at: -* http://license.coscl.org.cn/MulanPSL2 -* -* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -* -* See the Mulan PSL v2 for more details. -***************************************************************************************/ - -import "DPI-C" function void ram_write_helper -( - input longint wIdx, - input longint wdata, - input longint wmask, - input bit wen -); - -import "DPI-C" function longint ram_read_helper -( - input bit en, - input longint rIdx -); - -module RAMHelper( - input clk, - input en, - input [63:0] rIdx, - output [63:0] rdata, - input [63:0] wIdx, - input [63:0] wdata, - input [63:0] wmask, - input wen -); - - assign rdata = ram_read_helper(en, rIdx); - - always @(posedge clk) begin - ram_write_helper(wIdx, wdata, wmask, wen && en); - end - -endmodule