From aed5a33bef3a2252a1c03359541f727559a2b620 Mon Sep 17 00:00:00 2001 From: KrystalDelusion Date: Tue, 7 Jun 2022 10:22:04 +1200 Subject: [PATCH] Add init check Prevent rst_n from going low once it has gone high. --- docs/examples/fifo/top.sv | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/examples/fifo/top.sv b/docs/examples/fifo/top.sv index 428bf1f..3e12601 100644 --- a/docs/examples/fifo/top.sv +++ b/docs/examples/fifo/top.sv @@ -69,6 +69,15 @@ module fifo ( ? waddr - raddr : waddr + MAX_DATA - raddr; + reg init = 0; + always @(posedge clk) begin + if (rst_n) + init <= 1; + // if init is low we don't care about the value of rst_n + // if init is high (rst_n has ben high), then rst_n must remain high + assume (!init || init && rst_n); + end + // tests always @(posedge clk) begin if (rst_n) begin