soc/cores/freqmeter: Minor simplification.
This commit is contained in:
parent
26db10701a
commit
6c8e839cef
|
@ -52,12 +52,8 @@ class FreqMeter(Module, AutoCSR):
|
||||||
period_done = Signal()
|
period_done = Signal()
|
||||||
period_counter = Signal(32)
|
period_counter = Signal(32)
|
||||||
self.comb += period_done.eq(period_counter == period)
|
self.comb += period_done.eq(period_counter == period)
|
||||||
self.sync += \
|
self.sync += period_counter.eq(period_counter + 1)
|
||||||
If(period_done,
|
self.sync += If(period_done, period_counter.eq(0))
|
||||||
period_counter.eq(0),
|
|
||||||
).Else(
|
|
||||||
period_counter.eq(period_counter + 1)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Frequency measurement
|
# Frequency measurement
|
||||||
event_counter = ClockDomainsRenamer("fmeter")(GrayCounter(width))
|
event_counter = ClockDomainsRenamer("fmeter")(GrayCounter(width))
|
||||||
|
|
Loading…
Reference in New Issue