Looking for effective VM translator

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for effective VM translator

Steku
Dear colleagues

I managed to implement Hack on the FPGA.

Link to my other post

Now I would like to put it to some use but I realised, that I will never be able to write the VM translator able to generate code optimized enough to really squeeze the entire Hack OS into the 32K ROM + some usefult program written originally in Jack, translated to VM language, translated to ASM and finally to machine code to be uploaded to my physical FPGA-based Hack.

I discovered some working VM translators on the Git Hub, but they are also far from being able to generate optimized code.

I would appreciate if any of you colud be kind enough to share your VM translators with me - one of the best optimizations I can think of is avoiding repeating the code handling the return from the function call - with the VM translator I'm using it's more than 25% of the entire asm code! Possibly your VM translators are able to avoid such a waste of ROM.

P.S.
Sorry if I'm breaking 2 rules here:
- asking for a project result without actually executing the project (I'm really more into physical Hack realisation vs. writing optimal compilers),
- double posting.
Reply | Threaded
Open this post in threaded view
|

Re: Looking for effective VM translator

ivant
Hi,

I'm not sure how good my translator is, compared to others, but I'm OK to send it to you. I'll clean it up a bit and send it to you tomorrow.

Cheers,
Ivan
Reply | Threaded
Open this post in threaded view
|

Re: Looking for effective VM translator

Steku
This post was updated on .
Dear Ivan.

The VM translator I used before - 62.861 lines of asm code.
Your VM translator - 23.197 lines.

What a difference!

Thank you very, very much.

I can now put my H/W Hack into some testing with plenty of ROM for some nice code.

Enjoy the flashing LEDs! You can even try to read the code being executed!
Crude FPGA Hack movie on YouTube

Piotr