soc/integration: revert `bus` argument for add_ram/add_rom
authorJędrzej Boczar <jboczar@antmicro.com>
Thu, 16 Jul 2020 08:26:12 +0000 (10:26 +0200)
committerJędrzej Boczar <jboczar@antmicro.com>
Thu, 16 Jul 2020 08:26:12 +0000 (10:26 +0200)
litex/soc/integration/soc.py

index d52402c956aaa083f7fe67f9872d86c9f3f7f2c7..aee695c1072317265b5341c8fdc7bec88e5ffa51 100644 (file)
@@ -753,28 +753,19 @@ class SoC(Module):
         setattr(self.submodules, name, SoCController(**kwargs))
         self.csr.add(name, use_loc_if_exists=True)
 
-    def add_ram(self, name, origin, size, contents=[], mode="rw", bus=None):
-        if bus is None:
-            bus = wishbone.Interface(data_width=self.bus.data_width)
-
-        if isinstance(bus, wishbone.Interface):
-            ram = wishbone.SRAM(size, bus=bus, init=contents, read_only=(mode == "r"))
-        elif isinstance(bus, axi.AXILiteInterface):
-            ram = axi.AXILiteSRAM(size, bus=bus, init=contents, read_only=(mode == "r"))
-        else:
-            raise TypeError(bus)
-
+    def add_ram(self, name, origin, size, contents=[], mode="rw"):
+        ram_bus = wishbone.Interface(data_width=self.bus.data_width)
+        ram     = wishbone.SRAM(size, bus=ram_bus, init=contents, read_only=(mode == "r"))
         self.bus.add_slave(name, ram.bus, SoCRegion(origin=origin, size=size, mode=mode))
         self.check_if_exists(name)
-        self.logger.info("{} RAM {} {} {}.".format(
-            colorer("Wishbone" if isinstance(bus, wishbone.Interface) else "AXILite"),
+        self.logger.info("RAM {} {} {}.".format(
             colorer(name),
             colorer("added", color="green"),
             self.bus.regions[name]))
         setattr(self.submodules, name, ram)
 
-    def add_rom(self, name, origin, size, contents=[], bus=None):
-        self.add_ram(name, origin, size, contents, mode="r", bus=bus)
+    def add_rom(self, name, origin, size, contents=[]):
+        self.add_ram(name, origin, size, contents, mode="r")
 
     def add_csr_bridge(self, origin):
         self.submodules.csr_bridge = wishbone.Wishbone2CSR(