[Libre-soc-bugs] [Bug 1094] insndb instruction database visitor-walker is needed

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jun 2 21:23:26 BST 2023


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

--- Comment #9 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Dmitry Selyutin from comment #7)
> I've almost completed a hierarchy reorganization for insndb. Now it's really
> insndb:
> $ ls src/openpower/insndb/
> __init__.py  __pycache__  asm.py  dis.py  types.py
> 
> pysvp64.py -> asm.py
> pysvp64dis.py -> dis.py
> power_insn.py -> types.py

db.py instead of types.py? "insn/db.py" "insn/asm.py"?

maybe types.py works better, dunno.

> This is done in order to keep structure clean and obvious. The setuup.py
> script is updated as well. Visitors will reside here too.

suggest a separate "visitor.py" file.

> Next, I'll
> implement some script which simply dumps the instruction database based on
> visitors: it came to my mind that this is much simpler to do for starters
> instead of binutils.

yes very much so, iirc it's kinda "the canonical thing to do" with
visitor-walkers.

insndb/asciidump.py?  insndb/print.py?

btw if you want a hint on doing indentation: the "child_begin" function
increments "self.tabdebth", and "child_end" function decrements it.

real simple.

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


More information about the libre-soc-bugs mailing list