Skip to content

Commit

Permalink
Change cache decorator to lru_cache
Browse files Browse the repository at this point in the history
This fixes compatibility with Python 3.8, as cache decorator is only available
since Python 3.9 and is an alias for lru_cache(maxsize=None)

Internal-tag: [#53526]
Signed-off-by: Krzysztof Obłonczek <[email protected]>
  • Loading branch information
koblonczek committed Jan 9, 2024
1 parent 6385a04 commit 5d1223f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fpga_topwrap/elaboratable_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2023 Antmicro
# SPDX-License-Identifier: Apache-2.0

from functools import cache
from functools import lru_cache
from typing import Iterable, Mapping, Union

from amaranth import *
Expand Down Expand Up @@ -48,7 +48,7 @@ def get_ports_hier(self) -> SignalMapping:
"rst": self.rst,
}

@cache
@lru_cache(maxsize=None)
def _cached_wrapper(
self, port_width: int, port_flow: wiring.Flow, name: str, port_name: str, iface_name: str
) -> WrapperPort:
Expand Down

0 comments on commit 5d1223f

Please sign in to comment.