+ avrsim controller target requiring a special avr simulator with a certain memory location handling, see avrsim.pp controller helper unit for what it is needed

git-svn-id: trunk@30385 -
This commit is contained in:
florian 2015-03-29 21:13:36 +00:00
parent 9ae76c3246
commit dfd4d3656b
5 changed files with 72 additions and 2 deletions

1
.gitattributes vendored
View File

@ -8206,6 +8206,7 @@ rtl/embedded/arm/stm32f10x_md.pp svneol=native#text/pascal
rtl/embedded/arm/stm32f10x_xl.pp svneol=native#text/pascal
rtl/embedded/arm/xmc4500.pp svneol=native#text/pascal
rtl/embedded/avr/atmega128.pp svneol=native#text/plain
rtl/embedded/avr/avrsim.pp svneol=native#text/plain
rtl/embedded/avr/start.inc svneol=native#text/plain
rtl/embedded/buildrtl.lpi svneol=native#text/plain
rtl/embedded/buildrtl.pp svneol=native#text/plain

View File

@ -56,6 +56,8 @@ Type
tcontrollertype =
(ct_none,
ct_avrsim,
ct_atmega16,
ct_atmega32,
ct_atmega48,
@ -120,6 +122,16 @@ Const
eeprombase:0;
eepromsize:0
),
(
controllertypestr:'AVRSIM';
controllerunitstr:'AVRSIM';
flashbase:0;
flashsize:$20000;
srambase:0;
sramsize:4096;
eeprombase:0;
eepromsize:4096;
),
(
controllertypestr:'ATMEGA16';
controllerunitstr:'ATMEGA16';

View File

@ -369,7 +369,7 @@ CPU_UNITS=allwinner_a20
endif
endif
ifeq ($(ARCH),avr)
CPU_UNITS=atmega128
CPU_UNITS=atmega128 avrsim
endif
ifeq ($(ARCH),i386)
CPU_SPECIFIC_COMMON_UNITS=sysutils math classes fgl macpas typinfo types rtlconsts

View File

@ -84,7 +84,7 @@ endif
endif
ifeq ($(ARCH),avr)
CPU_UNITS=atmega128
CPU_UNITS=atmega128 avrsim
endif
ifeq ($(ARCH),i386)

View File

@ -0,0 +1,57 @@
{******************************************************************************
Startup code for an avr simulator
******************************************************************************}
unit avrsim;
{$goto on}
{$macro on}
interface
var
OUTPUTREG : byte absolute $20;
EXITCODEREG : byte absolute $21;
HALTREQUEST : byte absolute $22;
{$define DOCALL:=call}
{$define DOJMP:=jmp}
implementation
procedure PASCALMAIN; external name 'PASCALMAIN';
procedure _FPC_haltproc(exitcode : longint); public name '_haltproc'; noreturn;
begin
EXITCODEREG:=exitcode;
HALTREQUEST:=1;
{ really stop }
while true do
;
end;
var
_data: record end; external name '__data_start';
_edata: record end; external name '__data_end';
_etext: record end; external name '_etext';
_bss_start: record end; external name '__bss_start';
_bss_end: record end; external name '__bss_end';
_stack_top: record end; external name '_stack_top';
procedure _FPC_start; assembler; nostackframe;
label
_start;
asm
.init
.globl _start
jmp _start
{
all ATMEL MCUs use the same startup code, the details are
governed by defines
}
{$i start.inc}
end;
end.