From 6fcb421056092058277c18d18b0c49cc41fdccc8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 7 Nov 2021 13:25:45 +0000 Subject: [PATCH] allow name of ALU to be set in ReservationStations2 --- src/nmutil/concurrentunit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nmutil/concurrentunit.py b/src/nmutil/concurrentunit.py index b2b7650..6280a59 100644 --- a/src/nmutil/concurrentunit.py +++ b/src/nmutil/concurrentunit.py @@ -189,12 +189,15 @@ class ReservationStations2(Elaboratable): correct constant. this could change in future. """ - def __init__(self, alu, num_rows): + def __init__(self, alu, num_rows, alu_name=None): + if alu_name is None: + alu_name = "alu" self.num_rows = nr = num_rows id_wid = num_rows.bit_length() self.p = [] self.n = [] self.alu = alu + self.alu_name = alu_name # create prev and next ready/valid and add replica of ALU data specs for i in range(num_rows): suffix = "_%d" % i @@ -223,7 +226,7 @@ class ReservationStations2(Elaboratable): def elaborate(self, platform): m = Module() pe = PriorityEncoder(self.num_rows) # input priority picker - m.submodules.alu = self.alu + m.submodules[self.alu_name] = self.alu m.submodules.selector = pe for i, (p, n) in enumerate(zip(self.p, self.n)): m.submodules["rs_p_%d" % i] = p -- 2.30.2