From 6c8e839cef74279b3f6ef5b72263f205ecd8af9c Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 1 Jun 2021 10:26:18 +0200 Subject: [PATCH] soc/cores/freqmeter: Minor simplification. --- litex/soc/cores/freqmeter.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/litex/soc/cores/freqmeter.py b/litex/soc/cores/freqmeter.py index b7794ee51..e2c968a2a 100644 --- a/litex/soc/cores/freqmeter.py +++ b/litex/soc/cores/freqmeter.py @@ -52,12 +52,8 @@ class FreqMeter(Module, AutoCSR): period_done = Signal() period_counter = Signal(32) self.comb += period_done.eq(period_counter == period) - self.sync += \ - If(period_done, - period_counter.eq(0), - ).Else( - period_counter.eq(period_counter + 1) - ) + self.sync += period_counter.eq(period_counter + 1) + self.sync += If(period_done, period_counter.eq(0)) # Frequency measurement event_counter = ClockDomainsRenamer("fmeter")(GrayCounter(width))