From: Luke Kenneth Casson Leighton Date: Sun, 7 Nov 2021 13:25:45 +0000 (+0000) Subject: allow name of ALU to be set in ReservationStations2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6fcb421056092058277c18d18b0c49cc41fdccc8;p=nmutil.git allow name of ALU to be set in ReservationStations2 --- 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