From 3ea86730def6bd637598c0cd0de9c772246b29d3 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 17 Apr 2022 16:13:26 -0700 Subject: Refer to wrap bits instead of previous greycode in FIFO greycode calculation. --- hdl/fifo.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hdl') diff --git a/hdl/fifo.sv b/hdl/fifo.sv index 374f051..19877c4 100644 --- a/hdl/fifo.sv +++ b/hdl/fifo.sv @@ -41,7 +41,7 @@ module fifo ++youngest_wrap; end - youngest_grey = {youngest_wrap, youngest} ^ ({youngest_grey, youngest} >> 1); + youngest_grey = {youngest_wrap, youngest} ^ ({youngest_wrap, youngest} >> 1); in_ready = oldest_plus_one_wrap_grey != youngest_grey; end @@ -60,7 +60,7 @@ module fifo ++oldest_wrap; end - oldest_grey = {oldest_grey, oldest} ^ ({oldest_grey, oldest} >> 1); + oldest_grey = {oldest_wrap, oldest} ^ ({oldest_wrap, oldest} >> 1); oldest_plus_one_wrap_grey = {!oldest_wrap, oldest} ^ ({!oldest_wrap, oldest} >> 1); out_valid = oldest_grey != youngest_grey; -- cgit v1.2.3