fix some of instantiation errors in opencores_ethmac.py
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 3 Apr 2022 10:29:33 +0000 (11:29 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 3 Apr 2022 10:31:44 +0000 (11:31 +0100)
src/soc/bus/opencores_ethmac.py

index 3078fa67dc0aa07c99f42af24965d45040336204..5720c1ce65ce4cc06b920f30e5c800c1cfa5b3ca 100644 (file)
@@ -111,6 +111,7 @@ class EthMAC(Elaboratable):
     def elaborate(self, platform):
         m = Module()
         comb = m.d.comb
+        idx = self.idx
 
         # Calculate arbiter bus address
         wb_master_bus_adr = Signal(32)
@@ -119,7 +120,6 @@ class EthMAC(Elaboratable):
 
         # create definition of external verilog EthMAC code here, so that
         # nmigen understands I/O directions (defined by i_ and o_ prefixes)
-        idx = self.idx
         ethmac = Instance("eth_top",
                             # Clock/reset (use DomainRenamer if needed)
                             i_wb_clk_i=ClockSignal(),