Re: [myhdl-list] Newbie problem with instances()
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2009-03-31 21:45:07
|
Georg Acher wrote: > On Tue, Mar 31, 2009 at 07:18:04PM +0200, Jan Decaluwe wrote: >> You have hit a backwards incompatibility: >> >> http://www.myhdl.org/doc/0.6/whatsnew/0.6.html#instances-function > > Ouch... That explains everything. I guess I'll have to go over the 20 files > and look if it's just a sequential function or intended to be an instance... > :-( It it worked with earlier versions, it means that every generator was intended to be a MyHDL instance. If you want to use instances(), you'll have to adapt all of them to use decorators. That's the bad news. The good news is that there's no need to consider their specific functionality :-) >> Only generators produced by MyHDL decorators are now considered by instances(). >> MyHDL decorators are used as a way to discriminate between "MyHDL generators" >> and regular ones. In particular, this makes it possible to use regular >> generators in MyHDL models for different purposes. (Users had reported >> problems when instances() didn't make this difference.) >> >> That having said, I personally don't like instances() that much. I tend >> to return generators explicitly. > > Removing instances() would IMO make MyHDL quite unusable... It's already > tedious to explicitely return the implicitely instantiated modules. If I > have to care manually about the correct instantiation of my modules, I can > just use raw threads and shared variables ;-) It may be tedious and feel redundant if no conditionals are involved. But in MyHDL, you can use conditionals to control which generators are returned, for example to support recursion or simply different implementations dependent on some condition. In other HDLs this is either not possible (Verilog), or cumbersome (VHDL configurations.) Granted, instances() would still work when you use conditional returns, but it in those cases it probably much clearer to return generators explicitly. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as an HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |