Introduction ------------ This is basically a simulator for the core functionality of the Analog Devices (www.analog.com) AD-2181 digital signal processor. There's not much else to add to that description. Compiling --------- Should compile on most any UNIX/UNIX-like system using an ANSI C or GNU C compiler, though only tested on Linux/glibc. Also requires the GNU readline library (ftp.gnu.org). Just type 'make' in the top directory. Compiling on DOS/Win32 is theoretically possible, provided that you can get the readline library to compile for DOS as well. Let me know if you actually accomplish this (I haven't tried, it may work just fine). Running ------- The simulator will display a one-line copyright message, followed by a prompt. Probably the first thing you'll want to do is issue a 'bdmasource' command and load a file into BDMA space. Then do a 'boot', which will load the first 32 words from BDMA space into program memory. You can then do a 'dump_pm' to verify that, or just start in on executing with the 'step' command (which can be followed by a decimal number refering to how many cycles you want to run for -- default is one). You'll be returned to a prompt when its done. Formal breakpointing as well as trap-on-register/trap-on-memory-writes/etc are planned. Please take into account that the user interface was hacked in about twenty minutes. I haven't really touched it much since. BDMA Source Format ------------------ Files loaded with the 'bdmasource' command should look approximatly like this... 34 01 80 34 00 88 34 00 14 3c 00 a5 14 00 6e 0d 03 05 68 00 00 Thats just what I've found easiest to look at. Pretty much anything containing strings of hex opcodes is acceptable. Spaces and carriage returns are ignored. The other tested format is: 34 01 80 34 00 88 34 00 14 3c 00 a5 14 00 6e 0d 03 05 68 00 00 You could in fact just use this: 3401803400883400143c00a514006e0d0305680000 But that doesn't do much for readability. Or am I the only one who reads straight opcodes? Commands -------- help -- Gives nice largely unverbose help dump_irq dump_alu dump_mac dump_shifter dump_dags dump_pc dump_status dump_loop dump_count -- All of these dump their respective registers/stacks dump_pm dump_dm -- Dump a range of program/data memory starting at the address given by the first parameter, outputting a total of (second parameter) bytes. Both parameters must be in the same base (decimal (AAAA) or hex (0xAAAA)). bdmasource -- Loads a file specified by the first argument into BDMA space. Can do filename completion (hit tab). boot -- Bootstrap the DSP via BDMA space (loads first 32words) init -- Initialize DSP registers, stacks, and memories. step -- Run x cycles (where x is the first argument, default 1). jump call -- Explicitly call or jump to the specified address in hex (0x) setreg -- Assigns the value (second parameter) to the register (first parameter). All basic registers are valid (including cntr, imask, etc). Status ------ See the TODO.txt file for what needs to be done. And there are known bugs, most of which are completely undocumented, and in fact I forget them most of the time. Feel free to document them. Feel even freeer to fix them and send me patches. Go ahead and fix the missing features while you're at it. Have fun. Comments welcome. mid mid@auk.cx