



jor1k: A OR1000 Emulator running in the Web Browser
by poke53281 on Dec 4, 2012 |
poke53281
Posts: 1 Joined: Sep 3, 2012 Last seen: Feb 13, 2013 |
||
Hi everyone,
When I am learning a new programming language I do it right. Take a look at www.simulationcorner.net/opencore/jor1k.html It is a 2300 line or1k emulator running Linux written in Javascript. The code emulates the CPU including MMU, PIC and Tick timer, the UART controller, a terminal, and a small framebuffer (ocfb). The emulator should be close to or1ksim with three modifications: 1. The UART controller is infinitely fast. 2. The clock cycle per instruction is always 2 . 3. The check for triggered interrupts is done only every 8 instructions. This improves the performance a little bit. To run the emulator locally simply download the two files found in www.simulationcorner.net/opencore/ I have tested the program under Firefox and Chrome. Of course the stuff you can do with it is rather limited. Especially speed and space is lacking. So for me it is a fun project learning how things work. (Yes, I know that there is already a x86 javascript-linux emulator out there) There is one technical aspect. I tried to implement Hardware TLB Refill until I noticed, that there is so far no real specification for it. So I rewrote the TLB miss handlers found in arch/openrisc/kernel/head.s from assembler to Javascript. I am not sure if this helps speeding things up. Anyway, there are still some speed improvements possible. What do you think? Sebastian |
RE: jor1k: A OR1000 Emulator running in the Web Browser
by olof on Dec 4, 2012 |
olof
Posts: 218 Joined: Feb 10, 2010 Last seen: Dec 17, 2018 |
||
Yes, you're definitely doing it right :)
This is really cool stuff and it works great. Please pop in on #openrisc at freenode or send a mail to openrisc@lists.opencores.org and openrisc@lists.openrisc.net to share your thoughts about the TLB. We're currently in the process of fixing some things in the specification, and this sounds like useful input Thanks for sharing this -- Olof Kindgren ______________________________________________ ORSoC Website: www.orsoc.se Email: olof.kindgren@orsoc.se ______________________________________________ FPGA, ASIC, DSP - embedded SoC design |



