|
Post by DarioG on Jan 15, 2020 17:04:04 GMT
|
|
|
Post by DarioG on Jan 17, 2020 20:56:48 GMT
tested (!) and improved; support for both 26 and 32bit mode included ARMAcorn.C (37.15 KB) complete with test code: ARMAcorn_PIC.zip (16.13 KB)
|
|
|
Post by DarioG on Jan 19, 2020 13:44:35 GMT
Curious how... among the 5 emulators I made up recently, the "instruction cycle" lies always between 600 and 750nS (@200mhz). Which in turn means that "the powerful the emulated CPU, the better it performs". Which makes some sense, I suppose. Especially since the underlying CPU is a 32bit itself.
|
|
|
Post by du00000001 on Jan 19, 2020 13:55:15 GMT
While I'd expect a target-specific emulation for 8-Bitters to run somewhat faster than a 16- or 32-Bit emulation, the overall result doesn't come unexpected: provided your decoding of the opcodes is efficient, the emulation itself might execute somewhat slower for CISC cores (as these tend to "do" more within a single op) than for RISC. So the 750 ns might stem from the 8051, the 500 ns from some RISC. But basically, the emulation effort (on average) doesn't differ much between architectures.
|
|
|
Post by DarioG on Jan 19, 2020 14:30:20 GMT
Yeah, and yeah makes sense There's a loop, some outer switch(), then some further ifs or switch... and they happen for any opcode, be it a 8bit operation or 32; from 70 to 150+ instructions - of course just C without special tricks (for example, near-memory accesses or fine-optimized register allocation. I can imagine that running the same code on a 8bit machine, things would be different. I want to try them on a PIC24 or dsPIC, just to see!
|
|
|
Post by DarioG on Jan 20, 2020 15:31:32 GMT
Unoptimized 16bit CPU (dsPIC33CH) with XC16 (see other thread...) says that circa 1.2/1.5uS are needed per every emulated instruction (@180mhz) Well, makes sense not bad. With optimization it may get down to a similar value to PIC32.
|
|
|
Post by du00000001 on Jan 20, 2020 15:42:36 GMT
dsPIC33CH would be running at a maximum of 90 MIPS @ 180 MHz (less, if massive branching is required - 90 MIPS only with highly linear code - not sure whether the lower limit would be 45 MIPS or more like 22.5 MIPS ). So the performance of the 16-Bitter is not THAT bad.
|
|
|
Post by DarioG on Jan 20, 2020 15:53:09 GMT
And, as I re-state, its assembler is MUCH better than MIPS
|
|
|
Post by DarioG on Jan 20, 2020 23:59:19 GMT
Just as a matter of fact, an "hypotethical" dsPIC33FJ running @200mhz performs around 750nS/1uS per instruction (with optimization=1). Considering the deep usage of bitfields which would benefit from BFEXT instructions, I suppose that, when the bug is corrected and optimizations are enabled, the dsPIC33C will do even better.
|
|