PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

idea: ARM Assembler + ARM emulation + x86 builds...

An idea that we came up with in the pub... (Has anyone thought of/tried this?)

Write or obtain an ARM CPU emulator core (are there any open source ones?), and build it in to the x86 (PC or emulator) build of you're PocketPC project.

Write the ARM code (for texturemapping, blitting, or whatever), with C functions to load the code and call an ARM function. The PC build emulates the code, using the ARM CPU emulator, and the ARM build runs it natively...

Result - Much improved testing/debugging, and one version of the code that works in all builds. (yes, the emulated PC version could well be slower than real PocketPC hardware)

If there's a suitable ARM CPU emulator freely available, this could actually be quite easy to implement, other than a few makefile-related hassles.
Kzinti · 11 Jul 2003, 16:59 UTC — idea: ARM Assembler + ARM emulation + x86 builds...
bluescrn wrote:
Result - Much improved testing/debugging, and one version of the code that works in all builds. (yes, the emulated PC version could well be slower than real PocketPC hardware)


It seems to me that this wouldn't be an improved situation. If you are writting 3D code, you will start with a "C/C++" version first anyways. So you can keep that version for development on the desktop.

While optimizing the code in ARM assembly, I'd rather work with the real thing then with an emulator.
Sergey Chaban · 11 Jul 2003, 17:19 UTC
Gee, that's just crazy ;)
Anyhow, there are several freely available simulation cores, but all I'm aware of are under GPL which means you'd have to release your own code under GPL as well.
This one is the most complete:
http://sources.redhat.com/cgi-bin/cvswe ... vsroot=src
It's based on ARM's own armulator (very old version).
Also I agree with Thierry about having C version anyway and debugging on a real device (using LAN or WLAN debugging is very fast anyway).
Sergey Chaban wrote:
Also I agree with Thierry about having C version anyway and debugging on a real device (using LAN or WLAN debugging is very fast anyway).


Yes, in almost all cases you'll *start* with a C/C++ version of the rendering code, but as the project develops, and you've started using ARM code, keeping the C version and the ARM version in sync is a pain. One ARM version would be a lot nicer.

I find debugging C++ code over USB (iPaq in cradle) is painfully slow (I'm talking about 5-10 second pauses when it hits a breakpoint - on a PC with an XP1800/1Gb RAM, and 10-20secs to 'start debug'). Which is why I rely on PC builds for most development/debugging. Is it just me/my iPaq that has this problem? Also, attempts to debug on a Smartphone (SPV) have often completely failed where debugging the same app works (albeit slowly) on the iPaq...

I've not tried debugging any asm code yet... (I wasn't actually expecting it to work well/at all)
Anyone who isn't debugging/tuning code on the actual target device is asking for trouble. I'm amazed that anyone would even consider trying to do serious development work on that thing.

Ditch that USB nonsense and get a ethernet card for your device to do debugging. The debugger will step as fast as you can press the F10 key on the keyboard and it will launch your app in 1 or 2 seconds instead of 20+.
bluescrn wrote:
I find debugging C++ code over USB (iPaq in cradle) is painfully slow (I'm talking about 5-10 second pauses when it hits a breakpoint - on a PC with an XP1800/1Gb RAM, and 10-20secs to 'start debug').


If you are serious about development, you should get a CF2 Ethernet card. There aren't expensive and allow you to debug as fast as on the desktop.
Sergey Chaban · 11 Jul 2003, 23:30 UTC
Yep, debugging over USB is painfully slow. So having at least a WiFi connection is pretty much a requirement for remote debugging.
I'm working on a project where a bunch of code is in asm, surely keeping this in sync with C version takes some extra time, OTOH if both versions are identical enough in their inner workings I've found it somewhat easier to debug asm code based on the already debugged C version: looking at the intermediate values at certain points in the C version, then you know what values to expect at the corresponding point in the asm code (given the same input).
Debugging asm code works just fine but you have to insert the first break-point by hand: i.e. explicitly insert "DCD 0xE6000010" in your code (e.g. at the beginning of the debugged function). Then start as usual, debugger will stop at that point, now all debugger commands work as expected (you can set BPs, step over, step into, go to cursor, and view current state of the registers in the reg window).
Step-by-step debugging for asm code won't work only if you use SP reg in your code for purposes other than stack pointer.
If you use XScale instrs you'll need to replace eVT3 disassembler with newer msdis from the EVC4 (it's msdis110.dll), that's needed to properly display these opcodes in the disassembly window, otherwise they will show up as data words.

HTH
Digby wrote:
Anyone who isn't debugging/tuning code on the actual target device is asking for trouble. I'm amazed that anyone would even consider trying to do serious development work on that thing.


Of course you need *some* testing/debugging on real hardware, preferably several devices. But the majority of development and debugging of C/C++ code can be done on a PC (a native PC build, *not* a PPC emulator build)

Digby wrote:
Ditch that USB nonsense and get a ethernet card for your device to do debugging. The debugger will step as fast as you can press the F10 key on the keyboard and it will launch your app in 1 or 2 seconds instead of 20+.


Hadn't realised that was so much better (although I've used remote debugging over ethernet on an XBox devkit, with MS tools, and that does work very well). I'll suppose I'll have a look for a suitable card... (also need an iPaq CF jacket, though)
I've just got a Wi-Fi card, and (after a bit of a struggle) tried debugging over the network.... Yes, it's a *huge* improvement :) :)

I was rather surprised by the difference - as in terms of theoretical bandwidth, isn't USB quite close to 802.11b?
There is USB and there is USB. My experience with USB is troubles, troubles, problems, problems and destroyed USB devices.
The only USB device I've seen that somewhat lived up to expectations is a Simple CF card reader. It can transfer a couple dozen 1 MB JPEGS pretty fast.

Dan East