From c77afcb7e6c9d7ce9dad46d1f3c9d967d0254060 Mon Sep 17 00:00:00 2001 From: David Harris Date: Mon, 19 Feb 2024 22:28:55 -0800 Subject: [PATCH] Removed floprc with synchronous reset and synchornous clear --- src/generic/flop/floprc.sv | 38 -------------------------------------- src/privileged/privdec.sv | 4 ++-- 2 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 src/generic/flop/floprc.sv diff --git a/src/generic/flop/floprc.sv b/src/generic/flop/floprc.sv deleted file mode 100644 index 59f2e2862..000000000 --- a/src/generic/flop/floprc.sv +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////// -// floprc.sv -// -// Written: David_Harris@hmc.edu 9 January 2021 -// Modified: -// -// Purpose: D flip-flop with synchronous reset and clear -// -// A component of the CORE-V-WALLY configurable RISC-V project. -// https://github.com/openhwgroup/cvw -// -// Copyright (C) 2021-23 Harvey Mudd College & Oklahoma State University -// -// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 -// -// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file -// except in compliance with the License, or, at your option, the Apache License version 2.0. You -// may obtain a copy of the License at -// -// https://solderpad.org/licenses/SHL-2.1/ -// -// Unless required by applicable law or agreed to in writing, any work distributed under the -// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions -// and limitations under the License. -//////////////////////////////////////////////////////////////////////////////////////////////// - -module floprc #(parameter WIDTH = 8) ( - input logic clk, - input logic reset, - input logic clear, - input logic [WIDTH-1:0] d, - output logic [WIDTH-1:0] q); - - always_ff @(posedge clk) - if (reset | clear ) q <= #1 0; - else q <= #1 d; -endmodule diff --git a/src/privileged/privdec.sv b/src/privileged/privdec.sv index bc9f9235f..23c0c2f15 100644 --- a/src/privileged/privdec.sv +++ b/src/privileged/privdec.sv @@ -80,8 +80,8 @@ module privdec import cvw::*; #(parameter cvw_t P) ( if (P.U_SUPPORTED) begin:wfi logic [P.WFI_TIMEOUT_BIT:0] WFICount, WFICountPlus1; - assign WFICountPlus1 = WFICount + 1; - floprc #(P.WFI_TIMEOUT_BIT+1) wficountreg(clk, reset, ~wfiM, WFICountPlus1, WFICount); // count while in WFI + assign WFICountPlus1 = wfiM ? '0 : WFICount + 1; // restart counting on WFI + flopr #(P.WFI_TIMEOUT_BIT+1) wficountreg(clk, reset, WFICountPlus1, WFICount); // count while in WFI // coverage off -item e 1 -fecexprrow 1 // WFI Timout trap will not occur when STATUS_TW is low while in supervisor mode, so the system gets stuck waiting for an interrupt and triggers a watchdog timeout. assign WFITimeoutM = ((STATUS_TW & PrivilegeModeW != P.M_MODE) | (P.S_SUPPORTED & PrivilegeModeW == P.U_MODE)) & WFICount[P.WFI_TIMEOUT_BIT];