add partitioned signal class
[ieee754fpu.git] / src / ieee754 / part / partsig.py
1 """
2 Copyright (C) 2020 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
3
4 dynamic-partitionable class similar to Signal, which, when the partition
5 is fully open will be identical to Signal. when partitions are closed,
6 the class turns into a SIMD variant of Signal. *this is dynamic*.
7
8 http://bugs.libre-riscv.org/show_bug.cgi?id=132
9 """
10
11 from nmigen import (Module, Signal, Elaboratable,
12 )
13
14 class PartitionedSignal(Elaboratable):
15 def __init__(self, partition_points, *args, **kwargs)
16 reset=0, reset_less=False,
17 attrs=None, decoder=None, src_loc_at=0):
18 self.partpoints = partition_points
19 self.sig = Signal(*args, **kwargs)
20
21 def elaboratable(self, platform):
22 self.m = m = Module()
23 return m
24
25