Remove WalkingPriorityEncoder. This module is OBE and can be recalled via git later.
authorDaniel Benusovich <flyingmonkeys1996@gmail.com>
Wed, 6 Mar 2019 06:01:30 +0000 (22:01 -0800)
committerDaniel Benusovich <flyingmonkeys1996@gmail.com>
Wed, 6 Mar 2019 06:01:30 +0000 (22:01 -0800)
TLB/src/WalkingPriorityEncoder.py [deleted file]
TLB/test/test_walking_priority_encoder.py [deleted file]

diff --git a/TLB/src/WalkingPriorityEncoder.py b/TLB/src/WalkingPriorityEncoder.py
deleted file mode 100644 (file)
index 6be4d9b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-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))
-
-            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
diff --git a/TLB/test/test_walking_priority_encoder.py b/TLB/test/test_walking_priority_encoder.py
deleted file mode 100644 (file)
index 370545b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-import sys
-sys.path.append("../src")
-sys.path.append("../../TestUtil")
-
-from nmigen.compat.sim import run_simulation
-
-from WalkingPriorityEncoder import WalkingPriorityEncoder
-
-from test_helper import assert_eq, assert_ne
-
-def testbench(dut):
-    yield dut.write.eq(1)
-    yield dut.input.eq(5)
-    yield dut.output.eq(3)
-    yield
-    yield dut.write.eq(0)
-    yield dut.input.eq(0)
-    yield
-    yield
-    yield
-    yield
-    yield
-    yield
-    yield
-    yield
-    output = yield dut.output
-    #assert_eq("Output", output, 1)
-
-if __name__ == "__main__":
-    dut = WalkingPriorityEncoder(4)
-    run_simulation(dut, testbench(dut), vcd_name="Waveforms/cam_walking_priority_encoder.vcd")
-    print("WalkingPriorityEncoder Unit Test Success")