On Sun, Apr 24, 2022 at 10:40 PM Simon Safar <si...@simonsafar.com> wrote: > On Sat, Apr 23, 2022, at 2:26 PM, Max Filippov wrote: > > It's for a (future...) Lisp compiler! Somewhat in the style of MicroPython; > > the idea > > is to make code editable on the fly, without reflashing (... or restarting, > > even). > > Interesting. Do you use libisa or do you do instruction encoding on your own? > > It's my own; it's generating opcodes from the tree of tables in the Xtensa > reference. > A large part of the actual code looks a lot like those tables themselves; > there are still > some missing parts for some (e.g. overriding some defaults on which > instruction is > taking what kinds of parameters), which I'm just filling in on the go.
I see. I once did something like that for QEMU TCG: https://github.com/OSLL/qemu-xtensa/commit/53604287d6fdad1ce9659135a8ecbb569be90380 > It's fairly hacky, but it might fit together well with the eventual purpose > of maybe > running some of this in that 40k RAM onboard & keeping it all Lisp. 40k of RAM is a reasonable concern (: I would guess though that libisa + xtensa core description are purely code and constant data, and as such they may be put into FLASH and not consume any RAM. > (I'll put it up somewhere eventually once it's not a complete mess & starts > doing > something interesting! assuming this ever happens, of course.) Have fun and good luck! -- Thanks. -- Max