AnyCPU http://anycpu.org/forum/ |
|
Simulation opcodes http://anycpu.org/forum/viewtopic.php?f=12&t=41 |
Page 1 of 1 |
Author: | robfinch [ Thu Feb 21, 2013 12:09 am ] |
Post subject: | Simulation opcodes |
Any processors reserve opcodes specifically to support a simulator or emulator ? The opcode would be executed by the simulator but not by the processor. One that comes to mind is 'stop' or 'end' simulation. |
Author: | Dr Jefyll [ Fri Feb 22, 2013 3:29 am ] |
Post subject: | Re: Simulation opcodes |
robfinch wrote: The opcode would be executed by the simulator but not by the processor. One that comes to mind is 'stop' or 'end' simulation. As an aside, this is a topic that reminds me of Transmeta's "Crusoe," which was a Very Long Instruction Word processor designed to execute x86 code that had been "code morphed" at runtime! That is, x86 object code would be examined at run time by the VLIW processor, translated on the fly into native code, then executed by the VLIW cpu. The quality of translation was variable, defaulting to simple, substitution-based translations that could be produced very rapidly. But if an x86 program "hot spot" such as a loop was detected, the priority would shift and the code morphing software (CMS) would invest extra time in producing an optimized translation that executed with maximum efficiency. IIRC this meant a wider scope, looking at groups of x86 instructions to find opportunities for optimization. To some extent there's a parallel between what the CMS does in software and what modern, out-of-order, superscalar CPUs do in hardware. According to https://en.wikipedia.org/wiki/Transmeta Quote: Transmeta claims several technical benefits to this approach: 1. As the market leaders Intel and/or AMD would extend the core x86 instruction set, Transmeta could quickly upgrade their product with a software upgrade rather than requiring a respin of their hardware. This method just emphasises the compatibility rather than the performance. 2. Performance and power can be tuned in software to meet market needs. 3. It would be relatively simple to fix hardware design or manufacturing flaws in the hardware using software workarounds. 4. More time could be spent concentrating on enhancing the capabilities of the core or reducing its power consumption without worrying about 33 years of backward compatibility to the x86 architecture. 5. The processor could emulate multiple other architectures, possibly even at the same time. (At its initial Crusoe launch, Transmeta demonstrated pico-Java and x86 running intermixed on the native hardware.) Jeff http://LaughtonElectronics.com |
Author: | robfinch [ Sun Feb 24, 2013 9:29 pm ] |
Post subject: | Re: Simulation opcodes |
Transmeta has an interesting idea. I believe they were interested in low power operation for things like laptops. Quote: the "simulator" is the software that runs on the host processor, correct? Yes, the simulator runs on a host processor. A simluator often has numerous commands like $stop or $display (in Verilog) which the simulator executes, but the target processor doesn't. What I'm wondering is if there are any processors that support simulator command opcodes embedded in code. Suppose there was a 'dump registers' command in the simulator. In the simulated code one might have the command '$dumpregs' embedded, this code of course does not end up in the code the target processor runs. Opcodes reserved for the simulator could be used for breakpoint positions on the target system. Or they could be used to emulate the simulator functions on the target hardware. Exactly why one would want to, I'm not sure. Not exactly sure what I'm thinking of here. I'm just curious if something like this has been done. |
Author: | BigEd [ Mon Feb 25, 2013 12:42 pm ] |
Post subject: | Re: Simulation opcodes |
It's not quite what you're asking for Rob, but in my 6502 emulator for ARM I grabbed a couple of the 0x42 (WDM) operations to perform I/O: https://github.com/BigEd/a6502#readme I suspect I'd do the same for a novel CPU: use whatever unimplemented or reserved opcodes came to hand. In which case your question comes down to whether anyone did that and documented it. I'm not aware of any such document, but that says very little. Cheers Ed |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |