POEtic CPU Emulator

Remark

The POEtic circuit contains a 32-bit RISC CPU which handles the evolutionary part of the system and also interfaces the organic subsystem with the external world. The POEtic CPU has been developed at the UPC in Barcelona/Spain. For more informations look at the POEtic project site.

This emulator tries to be as close as possible to the POEtic CPU. However bugs are always possible and the final program should always be tested by simulating the VHDL model or by downloading the program on the real CPU.

Description

Before running a program, the memory map of the CPU must be configured. By default the memory map stored in default.map is loaded. The memory map describes which peripherals are present in the system, at which address they are mapped, and what is their type. The following memory map is the default one:

; This is the POEtic uC memory map
; Start Size Type
0x0 0x400 ROM
0x400 0x1C00 RAM
0x2000 0x10 DLL dll\msvc\basic\debug\basic.dll
0x2010 0x10 DLL dll\msvc\counter\debug\counter.dll
0x2020 0x10 DLL dll\msvc\print\debug\print.dll

Each line represents a peripheral and is composed of 3 or more parameters. The first number indicates the start address of the peripheral. The second number indicates how many words are assigned to that peripheral. The third element is the type of the peripheral. Currently RAM,ROM and DLL are available. RAM and ROM behave in the same way, except that CPU writes to the ROM have no effect. The DLL type indicates an external peripheral which is implemented in a DLL. In this case the fourth parameter is the path to the DLL. Optionaly more parameters can be placed after the path to the dll. They will be passed as arguments to the initialization function of the DLL.

Once the memory map is specified the program can be loaded in memory. The file format is the assembler listing format of the WinTim32 assembler. The program can then be executed using the standard Run and Trace commands. While the program executes the register window highlights the registers which have changed. Breakpoints can be set by clicking on the leftmost part of the of program window.

Custom peripherals

Custom peripherals can be easily added with a DLL. The following functions must be exported from the DLL:

int Initialize(int(*ptr_pprint)(char *str),char *param);
void About(char *str);
void Reset();
void Clock();
void WriteMem(poeticword address,poeticword word);
void CPUWriteMem(poeticword address,poeticword word);
poeticword ReadMem(poeticword address,poeticword word);

In the simplest case only CPUWriteMem and ReadMem need to be implemented. Those functions are called whenever the CPU reads or writes to an address which is assigned to that DLL. WriteMem is called when the emulator itself (not the emulated code) writes to memory. Reset and Clock are called after reset and each clock (note however that the clock is not emulated realistically: all instructions takes one clock cycle). When the memory map is loaded Initialize is called with the parameters placed in the memory map file. About can be used to describe the function or name of the peripheral.

Download

POEtic CPU Emulator released 13.08.2003 (w/o CPU manual). Compatible with POEtic CPU version 1.4.
POEtic CPU Emulator released 13.06.2003 (w/o CPU manual)

POEtic CPU Manual (not publicly available)

POEtic CPU Emulator Source code: available on request

Published: 13.06.03/dr      Last update: 13.08.03/dr