Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
7 migen/fhdl/structure.py
@@ -113,7 +113,7 @@ def __init__(self, v, n):
self.n = n
class Signal(Value):
- def __init__(self, bits_sign=None, name=None, variable=False, reset=0, name_override=None, min=None, max=None):
+ def __init__(self, bits_sign=None, name=None, variable=False, reset=0, name_override=None, min=None, max=None, related=None):
from migen.fhdl.size import bits_for
Value.__init__(self)
@@ -139,7 +139,10 @@ def __init__(self, bits_sign=None, name=None, variable=False, reset=0, name_over
self.variable = variable # deprecated
self.reset = reset
self.name_override = name_override
- self.backtrace = tracer.trace_back(name)
+ self.backtrace = []
+ if related is not None:
+ self.backtrace += related.backtrace
+ self.backtrace += tracer.trace_back(name)
def __repr__(self):
return "<Signal " + (self.backtrace[-1][0] or "anonymous") + " at " + hex(id(self)) + ">"
View
9 migen/fhdl/tools.py
@@ -128,6 +128,15 @@ def generate_reset(rst, sl):
def insert_reset(rst, sl):
return [If(rst, *generate_reset(rst, sl)).Else(*sl)]
+def insert_resets(f):
+ newsync = dict()
+ for k, v in f.sync.items():
+ if f.clock_domains[k].rst is not None:
+ newsync[k] = insert_reset(ResetSignal(k), v)
+ else:
+ newsync[k] = v
+ f.sync = newsync
+
class _Lowerer(NodeTransformer):
def __init__(self):
self.target_context = False
View
11 migen/fhdl/verilog.py
@@ -201,15 +201,6 @@ def _printcomb(f, ns, display_run):
r += "\n"
return r
-def _insert_resets(f):
- newsync = dict()
- for k, v in f.sync.items():
- if f.clock_domains[k].rst is not None:
- newsync[k] = insert_reset(ResetSignal(k), v)
- else:
- newsync[k] = v
- f.sync = newsync
-
def _printsync(f, ns):
r = ""
for k, v in sorted(f.sync.items(), key=itemgetter(0)):
@@ -303,7 +294,7 @@ def convert(f, ios=None, name="top",
raise KeyError("Unresolved clock domain: '"+cd_name+"'")
f = lower_complex_slices(f)
- _insert_resets(f)
+ insert_resets(f)
f = lower_basics(f)
fs, lowered_specials = _lower_specials(special_overrides, f.specials)
f += lower_basics(fs)

No commit comments for this range

Something went wrong with that request. Please try again.