Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 3 files changed
  • 0 comments
  • 1 contributor
7  migen/fhdl/structure.py
@@ -113,7 +113,7 @@ def __init__(self, v, n):
113 113
 		self.n = n
114 114
 
115 115
 class Signal(Value):
116  
-	def __init__(self, bits_sign=None, name=None, variable=False, reset=0, name_override=None, min=None, max=None):
  116
+	def __init__(self, bits_sign=None, name=None, variable=False, reset=0, name_override=None, min=None, max=None, related=None):
117 117
 		from migen.fhdl.size import bits_for
118 118
 
119 119
 		Value.__init__(self)
@@ -139,7 +139,10 @@ def __init__(self, bits_sign=None, name=None, variable=False, reset=0, name_over
139 139
 		self.variable = variable # deprecated
140 140
 		self.reset = reset
141 141
 		self.name_override = name_override
142  
-		self.backtrace = tracer.trace_back(name)
  142
+		self.backtrace = []
  143
+		if related is not None:
  144
+			self.backtrace += related.backtrace
  145
+		self.backtrace += tracer.trace_back(name)
143 146
 
144 147
 	def __repr__(self):
145 148
 		return "<Signal " + (self.backtrace[-1][0] or "anonymous") + " at " + hex(id(self)) + ">"
9  migen/fhdl/tools.py
@@ -128,6 +128,15 @@ def generate_reset(rst, sl):
128 128
 def insert_reset(rst, sl):
129 129
 	return [If(rst, *generate_reset(rst, sl)).Else(*sl)]
130 130
 
  131
+def insert_resets(f):
  132
+	newsync = dict()
  133
+	for k, v in f.sync.items():
  134
+		if f.clock_domains[k].rst is not None:
  135
+			newsync[k] = insert_reset(ResetSignal(k), v)
  136
+		else:
  137
+			newsync[k] = v
  138
+	f.sync = newsync
  139
+
131 140
 class _Lowerer(NodeTransformer):
132 141
 	def __init__(self):
133 142
 		self.target_context = False
11  migen/fhdl/verilog.py
@@ -201,15 +201,6 @@ def _printcomb(f, ns, display_run):
201 201
 	r += "\n"
202 202
 	return r
203 203
 
204  
-def _insert_resets(f):
205  
-	newsync = dict()
206  
-	for k, v in f.sync.items():
207  
-		if f.clock_domains[k].rst is not None:
208  
-			newsync[k] = insert_reset(ResetSignal(k), v)
209  
-		else:
210  
-			newsync[k] = v
211  
-	f.sync = newsync
212  
-
213 204
 def _printsync(f, ns):
214 205
 	r = ""
215 206
 	for k, v in sorted(f.sync.items(), key=itemgetter(0)):
@@ -303,7 +294,7 @@ def convert(f, ios=None, name="top",
303 294
 				raise KeyError("Unresolved clock domain: '"+cd_name+"'")
304 295
 	
305 296
 	f = lower_complex_slices(f)
306  
-	_insert_resets(f)
  297
+	insert_resets(f)
307 298
 	f = lower_basics(f)
308 299
 	fs, lowered_specials = _lower_specials(special_overrides, f.specials)
309 300
 	f += lower_basics(fs)

No commit comments for this range

Something went wrong with that request. Please try again.