From ee24841b0b157a6fafbb28e3de07c52b0156617f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 4 Mar 2019 09:10:07 +0000 Subject: [PATCH] comments and whitespace cleanup --- TLB/src/WalkingPriorityEncoder.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/TLB/src/WalkingPriorityEncoder.py b/TLB/src/WalkingPriorityEncoder.py index c5207734..6be4d9b3 100644 --- a/TLB/src/WalkingPriorityEncoder.py +++ b/TLB/src/WalkingPriorityEncoder.py @@ -2,44 +2,44 @@ from nmigen import Array, Module, Signal from nmigen.lib.coding import PriorityEncoder, Decoder class WalkingPriorityEncoder(): - + def __init__(self, width): # Internal self.current = Signal(width) self.encoder = PriorityEncoder(width) - + # Input self.write = Signal(1) self.input = Signal(width) - + # Output self.match = Signal(1) self.output = Signal(width) - + def elaborate(self, platform=None): m = Module() - + m.submodules += self.encoder - + with m.If(self.write == 0): with m.If(self.encoder.n == 0): m.d.sync += [ self.output.eq(self.encoder.o), self.match.eq(1) ] - m.d.sync += self.current.eq(self.current ^ (1 << self.encoder.o)) - m.d.sync += self.encoder.i.eq(self.current ^ (1 << self.encoder.o)) - + m.d.sync += self.current.eq(self.current ^ \ + (1 << self.encoder.o)) + m.d.sync += self.encoder.i.eq(self.current ^ \ + (1 << self.encoder.o)) + with m.Else(): m.d.sync += self.match.eq(0) m.d.sync += self.encoder.i.eq(0) - + with m.Else(): m.d.sync += self.encoder.i.eq(self.input) m.d.sync += self.current.eq(self.input) m.d.sync += self.encoder.i.eq(self.input) - m.d.sync += self.match.eq(0) - - - - return m \ No newline at end of file + m.d.sync += self.match.eq(0) + + return m -- 2.30.2