Re: [myhdl-list] ListElementNotUnique error
Brought to you by:
jandecaluwe
From: <dan...@we...> - 2006-05-24 15:27:14
|
Jens Petter Abrahamsen wrote: > Hi, I hope someone who knows more MyHDL/Python than myself can have a > look at this: > > I keep getting the following error from toVerilog(): > List contains Signals that are not unique to it Have you tried first simulating it? Usually simulation returns more meaningful error messages. > > I have a list of signals. The signals are driven inside a module, called > like this: > > signal_list = [Signal(intbv(0)[WIDTH:]) for i in range(NUMBER)] > insts = [module_name(signal_list[i]) for i in range(NUMBER)] > I haven't worked with lists of instances yet, but when you look at the following example: http://www.jandecaluwe.com/Tools/MyHDL/manual/model-instarray.html The instantiation is done a bit different than you do it. > I want to compare the outputs from all the instances, to select the > highest one. So after the previous code, I add the following: > > @always(clk.negedge) > def select_best(): > """Compare values and select the best one""" > best=0 > for nr in range(NR_REGS): > if signal_list[nr] > signal_list[best]: # I have also tried > .val on them > best=nr > > max.next = best ^^^^^^^^^^^^^^^ Is that indention wrong from copying it? The variable best is local to select_best(). You should not be able to access it outside or am I am wrong? > ^^^^^^^^ I think here is a: return select_best missing. Hope that helps. Cheers, Guenter |