[Libre-soc-isa] [Bug 686] create Power ISA test API

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Sep 9 14:12:57 BST 2021


https://bugs.libre-soc.org/show_bug.cgi?id=686

--- Comment #15 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to klehman9 from comment #13)
> https://git.libre-soc.org/?p=soc.git;a=commit;
> h=aa95068eda3dcd508383dda33c0e389a2b718401
> 
> Rest of the sim.
> 
> As for the HDL, spent quite a bit of time trying to get it to work.  Perhaps
> I'm missing something obvious, but it doesn't like "yield from" within the
> get_intregs method.  I'll commit the byzantine mess where it actually uses
> yield from and iterates...but basically returns no data into the list.

ah so this is one of the oddities of python yield.  you don't use "yield from"
*IN* the get_intregs method, you use "yield from" **ON** the get_intregs
method.

   x = HDLState(args)
   yield from x.get_intregs()

NOT

   class HDLState:
       def get_intregs(...)
            yield from xxx

you'll need to look up a tutorial on python yield, but basically the above
covers it.

basically, "yield" will yield "the thing", and "yield from" will DRILL DOWN
into the "thing", allowing *IT* to perform "yielding" of results.

summary: you prefix a function with "yield from", you prefix the things
you want to *be* yielded with *just* "yield"

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libre-SOC-ISA mailing list