move scoreboard multi rd/wr to new folder
[soc.git] / src / soc / scoreboard / fu_mem_picker_vec.py
1 from nmigen import Elaboratable, Module, Signal, Cat
2
3
4 class FUMem_Pick_Vec(Elaboratable):
5 """ these are allocated per-FU (horizontally),
6 and are of length fu_row_n
7 """
8 def __init__(self, fu_row_n):
9 self.fu_row_n = fu_row_n
10 self.st_pend_i = Signal(fu_row_n, reset_less=True)
11 self.ld_pend_i = Signal(fu_row_n, reset_less=True)
12
13 self.storable_o = Signal(reset_less=True)
14 self.loadable_o = Signal(reset_less=True)
15
16 def elaborate(self, platform):
17 m = Module()
18
19 # Readable if there are no writes pending
20 m.d.comb += self.storable_o.eq(~self.ld_pend_i.bool())
21
22 # Writable if there are no reads pending
23 m.d.comb += self.loadable_o.eq(~self.st_pend_i.bool())
24
25 return m
26