Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 51269ad4a037
Choose a base ref
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c1b2d2aed430
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 26, 2019

  1. Copy the full SHA
    c1b2d2a View commit details
Showing with 9 additions and 4 deletions.
  1. +9 −4 nmigen/hdl/ir.py
13 changes: 9 additions & 4 deletions nmigen/hdl/ir.py
Original file line number Diff line number Diff line change
@@ -20,11 +20,16 @@ class UnusedElaboratable(Warning):
class Elaboratable(metaclass=ABCMeta):
_Elaboratable__silence = False

def __new__(cls, *args, src_loc_at=0, **kwargs):
def __new__(cls, *args, **kwargs):
src_loc_at = kwargs.get("src_loc_at", 0)
src_loc = traceback.extract_stack(limit=2 + src_loc_at)[0]

self = super().__new__(cls)
self._Elaboratable__src_loc = traceback.extract_stack(limit=2 + src_loc_at)[0]
self._Elaboratable__used = False
return self
self._Elaboratable__src_loc = src_loc
# Don't warn if the initializer raises.
self._Elaboratable__used = True
self.__init__(*args, **kwargs)
self._Elaboratable__used = False

def __del__(self):
if self._Elaboratable__silence: