add partitioned signal class
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Jan 2020 12:25:20 +0000 (12:25 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Jan 2020 12:25:20 +0000 (12:25 +0000)
src/ieee754/part/partsig.py [new file with mode: 0644]

diff --git a/src/ieee754/part/partsig.py b/src/ieee754/part/partsig.py
new file mode 100644 (file)
index 0000000..252beb4
--- /dev/null
@@ -0,0 +1,25 @@
+"""
+Copyright (C) 2020 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+
+dynamic-partitionable class similar to Signal, which, when the partition
+is fully open will be identical to Signal.  when partitions are closed,
+the class turns into a SIMD variant of Signal.  *this is dynamic*.
+
+http://bugs.libre-riscv.org/show_bug.cgi?id=132
+"""
+
+from nmigen import (Module, Signal, Elaboratable,
+                    )
+
+class PartitionedSignal(Elaboratable):
+    def __init__(self, partition_points, *args, **kwargs)
+                 reset=0, reset_less=False,
+                 attrs=None, decoder=None, src_loc_at=0):
+        self.partpoints = partition_points
+        self.sig = Signal(*args, **kwargs)
+
+    def elaboratable(self, platform):
+        self.m = m = Module()
+        return m
+
+