OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 47 to Rev 48
    Reverse comparison

Rev 47 → Rev 48

/amber/trunk/doc/WishList.txt
5,7 → 5,7
 
Add a branch prediction buffer to the A25 core. This would improve performance by between 5% and 10%. But its quite a complex change and would increase the size of the core a little as well.
 
Speed up the A25 execute stage by forcing instructions that use complex shifts to take two cycles. These instructions are quite rare. The vast majority of instructions use no shift or a simple shift of 1 bit left or right, or 8 bits left or right. A simplified barrel shifter on the critical path would allow the core to run 10% to 20% faster in a given technology. Any instruction using a complex shift would require two passes through the execute stage, stalling everything behind it. The first pass it would use the a complex barrel shifter, and in the second pass it would use the ALU.
Done. Speed up the A25 execute stage by forcing instructions that use complex shifts to take two cycles. These instructions are quite rare. The vast majority of instructions use no shift or a simple shift of 1 bit left or right, or 8 bits left or right. A simplified barrel shifter on the critical path would allow the core to run 10% to 20% faster in a given technology. Any instruction using a complex shift would require two passes through the execute stage, stalling everything behind it. The first pass it would use the a complex barrel shifter, and in the second pass it would use the ALU.
 
Add a fast multiplier using the FPGA DSP blocks. The multiplier module is designed to have a clean interface so it is easy to replace it with a higher performance one. This would make a big difference for applications that contain a large number of multiplications.
 
/amber/trunk/doc/ReleaseChecklist.txt
9,3 → 9,4
Both cores must pass timing; Spartan6 at 40MHz, Virtex6 at 80Mhz, with max caches
Check all synthesis warnings, clean up as many as possible.
4. Regenerate the vmlinux patch file, if any changes to the kernel source files.
/amber/trunk/sw/vmlinux/initrd Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
amber/trunk/sw/vmlinux/initrd Property changes : Deleted: svn:mime-type ## -1 +0,0 ## -application/octet-stream \ No newline at end of property Index: amber/trunk/sw/vmlinux/vmlinux =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: amber/trunk/sw/vmlinux/initrd-200k-dhry =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: amber/trunk/sw/vmlinux/initrd-200k-dhry =================================================================== --- amber/trunk/sw/vmlinux/initrd-200k-dhry (nonexistent) +++ amber/trunk/sw/vmlinux/initrd-200k-dhry (revision 48)
amber/trunk/sw/vmlinux/initrd-200k-dhry Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: amber/trunk/sw/vmlinux/patch-2.4.27-amber2.bz2 =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: amber/trunk/sw/vmlinux/initrd-200k-hello-world =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: amber/trunk/sw/vmlinux/initrd-200k-hello-world =================================================================== --- amber/trunk/sw/vmlinux/initrd-200k-hello-world (nonexistent) +++ amber/trunk/sw/vmlinux/initrd-200k-hello-world (revision 48)
amber/trunk/sw/vmlinux/initrd-200k-hello-world Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: amber/trunk/sw/vmlinux/README.txt =================================================================== --- amber/trunk/sw/vmlinux/README.txt (revision 47) +++ amber/trunk/sw/vmlinux/README.txt (revision 48) @@ -10,21 +10,25 @@ If you build the kernal from source these 2 files get replaced. + # +++++++++++++++++++++++++++++++++++++++++++ # How to run Amber Linux kernel on a development board # +++++++++++++++++++++++++++++++++++++++++++ -1. Download the bitfile to configure the FPGA using Impact ir Chipscope +1. Download the bitfile to configure the FPGA using Impact or Chipscope 2. Connect HyperTerminal to the serial port on the FPGA to connect to the boot loader 3. Download the disk image > b 800000 -Then select the file $AMBER_BASE/sw/vmlinux/initrd to transfer +Then select one of the provided disk image files to transfer, e.g. + $AMBER_BASE/sw/vmlinux/initrd-200k-hello-world + 4. Download the kernel image > l Then select the file $AMBER_BASE/sw/vmlinux/vmlinux to transfer -5. Execute th ekernel -> j +5. Execute the kernel +> j 80000 + # +++++++++++++++++++++++++++++++++++++++++++ # How to build Amber Linux kernel from source # +++++++++++++++++++++++++++++++++++++++++++ @@ -66,9 +70,11 @@ ${AMBER_CROSSTOOL}-objcopy -R .comment -R .note vmlinux ${AMBER_CROSSTOOL}-objcopy --change-addresses -0x02000000 vmlinux $AMBER_BASE/sw/tools/amber-elfsplitter vmlinux > vmlinux.mem + # Add the ram disk image to the .mem file -$AMBER_BASE/sw/tools/amber-bin2mem ${AMBER_BASE}/sw/vmlinux/initrd 800000 >> vmlinux.mem -${AMBER_CROSSTOOL}-objdump -C -S -EL vmlinux_unstripped > vmlinux.dis +# You can use one of the provided disk images or generate your own (see below) +$AMBER_BASE/sw/tools/amber-bin2mem ${AMBER_BASE}/sw/vmlinux/initrd-200k-hello-world 800000 >> vmlinux.mem +${AMBER_CROSSTOOL}-objdump -C -S -EL vmlinux_unstripped > vmlinux.dis cp vmlinux.mem $AMBER_BASE/sw/vmlinux/vmlinux.mem cp vmlinux.dis $AMBER_BASE/sw/vmlinux/vmlinux.dis @@ -91,7 +97,10 @@ export LINUX_WORK_DIR=/proj/amber2-linux +# Create the Linux build directory +test -e ${LINUX_WORK_DIR} || mkdir ${LINUX_WORK_DIR} cd ${LINUX_WORK_DIR} + # Need root permissions to mount disks su root dd if=/dev/zero of=initrd bs=200k count=1 @@ -115,6 +124,7 @@ chmod 600 ${LINUX_WORK_DIR}/mnt/dev/* cp $AMBER_BASE/sw/hello-world/hello-world.flt ${LINUX_WORK_DIR}/mnt/sbin/init +#cp $AMBER_BASE/sw/dhry/dhry.flt ${LINUX_WORK_DIR}/mnt/sbin/init chmod +x ${LINUX_WORK_DIR}/mnt/sbin/init # Check @@ -123,6 +133,19 @@ # Unmount umount ${LINUX_WORK_DIR}/mnt rm -rf ${LINUX_WORK_DIR}/mnt -exit +exit # from being root -cp initrd $AMBER_BASE/sw/vmlinux +cp initrd $AMBER_BASE/sw/vmlinux/initrd- + +--- + +If 200k is not large enough, you can change the size as follows. +You'll need to change a couple of values in the ATAG data structure defined in the +boot loader. Specifically the ATAG_RAMDISK_SIZE parameter and the ATAG_INITRD_SIZE +parameter in file $AMBER_BASE/sw/boot-loader/start.S. Then create an initrd image +with a different bs number, for example; +dd if=/dev/zero of=initrd bs=400k count=1 + +The initrd image size gets picked up automatically by the kernel, as long as the +ram disk defined in the ATAG data is large enough to contain it. +
/amber/trunk/sw/vmlinux/vmlinux.mem.bz2 Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/amber/trunk/sw/vmlinux/vmlinux.dis.bz2 Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
amber/trunk/sw/vmlinux Property changes : Modified: svn:ignore ## -1,2 +1,3 ## vmlinux.dis vmlinux.mem +initrd Index: amber/trunk/sw/mini-libc/libc_asm.S =================================================================== --- amber/trunk/sw/mini-libc/libc_asm.S (revision 47) +++ amber/trunk/sw/mini-libc/libc_asm.S (revision 48) @@ -483,7 +483,14 @@ ldmia sp!, {r4-r8, pc}^ + @ initialize malloc + .globl init_malloc +init_malloc: + ldr r1, AdrMalloc + str r1, [r1] + mov pc, lr + /* void *malloc(size_t size); */ .globl malloc malloc:
/amber/trunk/sw/dhry/dhry.c
82,7 → 82,8
REG int Number_Of_Runs;
 
/* Initializations */
 
init_malloc();
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
 
256,7 → 257,7
=> 1 dhrystone = 569 cycles on a 1 instruction per cycle Vax machine.
*/
}
_testpass();
}
 
 
/amber/trunk/sw/dhry/sections.lds
48,36 → 48,16
 
SECTIONS {
 
. = 0x00080000;
. = 0x008000;
.text : { start*(.text); *(.text); }
._start :
{
start*(.text)
}
.text :
{
*(.text)
}
.data : { *(.data); }
 
.rodata : { *(.rodata); }
.rodata :
{
*(.rodata)
}
.bss : { *(.bss); }
 
.data :
{
*(.data)
}
.stack : { __stack = . ; }
 
.bss :
{
*(.bss)
}
 
.stack :
{
__stack = . ;
}
 
}
/amber/trunk/sw/dhry/Makefile
1,90 → 1,50
# ----------------------------------------------------------------
# //
# Makefile for the dhry application. //
# //
# This file is part of the Amber project //
# http://www.opencores.org/project,amber //
# //
# Description //
# Simple makefile that defines the sources and target. //
# Uses the common.mk common makefile script. //
# //
# Author(s): //
# - Conor Santifort, csantifort.amber@gmail.com //
# //
#/ ///////////////////////////////////////////////////////////////
# //
# Copyright (C) 2010 Authors and OPENCORES.ORG //
# //
# This source file may be used and distributed without //
# restriction provided that this copyright statement is not //
# removed from the file and that any derivative work contains //
# the original copyright notice and the associated disclaimer. //
# //
# This source file is free software; you can redistribute it //
# and/or modify it under the terms of the GNU Lesser General //
# Public License as published by the Free Software Foundation; //
# either version 2.1 of the License, or (at your option) any //
# later version. //
# //
# This source is distributed in the hope that it will be //
# useful, but WITHOUT ANY WARRANTY; without even the implied //
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
# PURPOSE. See the GNU Lesser General Public License for more //
# details. //
# //
# You should have received a copy of the GNU Lesser General //
# Public License along with this source; if not, download it //
# from http://www.opencores.org/lgpl.shtml //
# //
# ----------------------------------------------------------------
# Assembly source files
 
SRC = dhry.c dhry_2.c start.S
TGT = dhry
LDS = sections.lds
 
USE_MINI_LIBC = 1
CREATE_FLT_OUTPUT = 1
 
LIBC_OBJ = ../mini-libc/printf.o ../mini-libc/libc_asm.o ../mini-libc/memcpy.o
DEP += ../include/amber_registers.h ../mini-libc/stdio.h
TOOLSPATH = ../tools
AMBER_CROSSTOOL ?= amber-crosstool-not-defined
 
AS = $(AMBER_CROSSTOOL)-as
CC = $(AMBER_CROSSTOOL)-gcc
CXX = $(AMBER_CROSSTOOL)-g++
AR = $(AMBER_CROSSTOOL)-ar
LD = $(AMBER_CROSSTOOL)-ld
DS = $(AMBER_CROSSTOOL)-objdump
OC = $(AMBER_CROSSTOOL)-objcopy
ELF = $(TOOLSPATH)/amber-elfsplitter
BMF32 = ../tools/amber-memparams32.sh
BMF128 = ../tools/amber-memparams128.sh
 
MMP32 = $(addsuffix _memparams32.v, $(basename $(TGT)))
MMP128 = $(addsuffix _memparams128.v, $(basename $(TGT)))
MEM = $(addsuffix .mem, $(basename $(TGT)))
DIS = $(addsuffix .dis, $(basename $(TGT)))
ifdef USE_MINI_LIBC
OBJ = $(addsuffix .o, $(basename $(SRC))) $(LIBC_OBJ)
else
OBJ = $(addsuffix .o, $(basename $(SRC)))
endif
 
ifdef LDS
TLDS = -T $(LDS)
else
TLDS =
endif
 
ifndef TGT
TGT = aout.elf
endif
 
ifdef MIN_SIZE
# optimize for size
OPTIMIZE = -Os
else
# optimize for speed
OPTIMIZE = -O3
endif
 
MAP = $(addsuffix .map, $(basename $(TGT)))
ASFLAGS = -I../include
CFLAGS = -c $(OPTIMIZE) -march=armv2a -mno-thumb-interwork -ffreestanding -I../include
DSFLAGS = -C -S -EL
LDFLAGS = -Bstatic -Map $(MAP) --strip-debug --fix-v4bx
 
 
ifdef USE_MINI_LIBC
debug: mini-libc $(ELF) $(MMP) $(DIS)
else
debug: $(ELF) $(MMP) $(DIS)
endif
 
$(MMP): $(MEM)
$(BMF32) $(MEM) $(MMP32)
 
$(MEM): $(TGT)
$(ELF) $(TGT) > $(MEM)
 
$(TGT): $(OBJ)
$(LD) $(LDFLAGS) -o $(TGT) $(TLDS) $(OBJ)
$(OC) -R .comment -R .note $(TGT)
 
$(OBJ): $(DEP)
 
mini-libc:
$(MAKE) -s -C ../mini-libc MIN_SIZE=1
 
$(ELF):
$(MAKE) -C $(TOOLSPATH)
$(DIS): $(TGT)
$(DS) $(DSFLAGS) $^ > $@
 
clean:
@rm -rfv *.o *.elf *.dis *.map *.mem *.v $(MMP) dhry
 
include ../include/common.mk
/amber/trunk/sw/dhry/start.S
55,10 → 55,6
mov r0, #1
mcr 15, 0, r0, cr2, cr0, 0 @ cache enable
@ initialize malloc
ldr r1, AdrMalloc
str r1, [r1]
@ initialize the stack pointer
ldr sp, AdrStack
 
amber/trunk/sw/dhry Property changes : Modified: svn:ignore ## -2,4 +2,6 ## dhry.mem dhry.dis dhry -dhry_memparams.v +dhry_memparams*.v +dhry.flt.gdb +dhry.flt Index: amber/trunk/sw/boot-loader/boot-loader.c =================================================================== --- amber/trunk/sw/boot-loader/boot-loader.c (revision 47) +++ amber/trunk/sw/boot-loader/boot-loader.c (revision 48) @@ -149,10 +149,6 @@ load_run(1,0); break; - case 'j': /* Jump to 0x80000 */ - load_run(0,0); - break; - case 's': /* Status */ _core_status(); /* Flush out the uart with spaces */ @@ -186,6 +182,13 @@ } break; + case 'j': /* Jump to
*/ + if (get_hex ( buf, 2, &address, &length )) { + load_run(0, address); + } + break; + + case 'p': /* Print String */ /* Recover the address from the string - the address is written in hex */ if (get_hex ( buf, 2, &address, &length )) { @@ -244,58 +247,76 @@ { int file_size; char * message = "Send file w/ 1K Xmodem protocol from terminal emulator now..."; - - /* testing tyhe boot loader itself in simulation */ - if ( type == 2 ) { - print_help(); - _core_status(); - print_spaces(16); - _testpass(); - } + + switch (type) { - /* Load a file but don't run it */ - else if ( type == 1 ) { - /* Load a file using the xmodem protocol */ - printf ("%s\n", message); + case 1: /* Load a binary file to FILE_LOAD_BASE */ + /* Load a file using the xmodem protocol */ + printf ("%s\n", message); - /* Destination, Destination Size */ - file_size = xmodemReceive((char *) FILE_LOAD_BASE, FILE_MAX_SIZE); - if (file_size < 0 || file_size > FILE_MAX_SIZE) { - printf ("Xmodem error file size 0x%x \n", file_size); - return; - } - - printf("\nelf split\n"); - elfsplitter(FILE_LOAD_BASE, file_size); - } + /* Destination, Destination Size */ + file_size = xmodemReceive((char *) FILE_LOAD_BASE, FILE_MAX_SIZE); + if (file_size < 0 || file_size > FILE_MAX_SIZE) { + printf ("Xmodem error file size 0x%x \n", file_size); + return; + } + + printf("\nelf split\n"); + elfsplitter(FILE_LOAD_BASE, file_size); + break; + - /* Hello world special start address - simulations only */ - else if ( type == 4 ) { - _jump_to_program(0x0080e400); - } + case 2: /* testing the boot loader itself in simulation */ + print_help(); + _core_status(); + print_spaces(16); + _testpass(); + break; - /* Load a binary file into memory */ - else if ( type == 5 ) { - /* Load a file using the xmodem protocol */ - printf ("%s\n", message); - /* Destination, Destination Size */ - file_size = xmodemReceive((char *) address, FILE_MAX_SIZE); - if (file_size < 0 || file_size > FILE_MAX_SIZE) { - printf ("Xmodem error file size 0x%x \n", file_size); - return; - } - } + case 3: /* vmlinux in simulation */ + printf("j 0x%08x\n", LINUX_JUMP_ADR); + /* Flush the uart tx buffer with spaces */ + print_spaces(16); + printf("\n"); + /* pc jump */ + _jump_to_program(LINUX_JUMP_ADR); + _testpass(); + break; - /* Run the program */ - else { - printf("j 0x%08x\n", JUMP_ADR); - /* Flush the uart tx buffer with spaces */ - print_spaces(16); - printf("\n"); - /* pc jump */ - _jump_to_program(JUMP_ADR); - _testpass(); + + case 4: /* programs starting at 0x8000 in simulation */ + printf("j 0x%08x\n", APP_JUMP_ADR); + /* Flush the uart tx buffer with spaces */ + print_spaces(16); + printf("\n"); + /* pc jump */ + _jump_to_program(APP_JUMP_ADR); + _testpass(); + break; + + + case 5: /* Load a binary file into memory, to 'address' */ + /* Load a file using the xmodem protocol */ + printf ("%s\n", message); + /* Destination, Destination Size */ + file_size = xmodemReceive((char *) address, FILE_MAX_SIZE); + if (file_size < 0 || file_size > FILE_MAX_SIZE) { + printf ("Xmodem error file size 0x%x \n", file_size); + return; + } + break; + + + default: /* Run the program */ + printf("j 0x%08x\n", address); + /* Flush the uart tx buffer with spaces */ + print_spaces(16); + printf("\n"); + /* pc jump */ + _jump_to_program(address); + _testpass(); + break; } } @@ -325,9 +346,9 @@ print_spaces(29); printf(": Print help message\n"); - printf("j"); - print_spaces(29); - printf(": Execute loaded elf, jumping to 0x%08x\n", JUMP_ADR); + printf("j
"); + print_spaces(19); + printf(": Execute loaded elf, jumping to
\n"); printf("p
"); print_spaces(19);
/amber/trunk/sw/boot-loader/boot-loader.h
42,7 → 42,8
#define DLY_1S 1000
#define DLY_300MS 300
 
#define JUMP_ADR 0x00080000 /* Boot loader jumps to this default address */
#define LINUX_JUMP_ADR 0x00080000 /* Boot loader jumps to this address to run vmlinux */
#define APP_JUMP_ADR 0x00008000 /* Boot loader jumps to this address to run test programs */
#define FILE_LOAD_BASE 0x01000000
#define DEBUG_BUF 0x01800000
#define FILE_MAX_SIZE 0x00800000 /* 8MB max Xmodem transfer file size */
/amber/trunk/sw/boot-loader/start.S
210,12 → 210,12
.word ATAG_RAMDISK
.word 1 @ flags: bit 0 = load, bit 1 = prompt
.word 0x000000d0 @ size in 1k blocks
.word 0x00800000 @ image start block #
.word 0x00800000 @ physical address of start of ramdisk
 
.word ATAG_INITRD_SIZE
.word ATAG_INITRD
.word 0x02800000 @ start @ 8MB
.word 0x00032000 @ size = 200k
.word 0x02800000 @ virtual address of start of initrd image
.word 0x00032000 @ size = 200k
.word ATAG_NONE
.word 0x0
/amber/trunk/sw/hello-world/sections.lds
48,7 → 48,7
 
SECTIONS {
 
. = 0x00000000;
. = 0x008000;
.text : { start*(.text); *(.text); }
/amber/trunk/sw/ethmac-test/sections.lds
48,7 → 48,7
 
SECTIONS {
 
. = 0x00080000;
. = 0x00008000;
.text :
{
/amber/trunk/hw/tools/run.sh
226,15 → 226,13
TEST_TYPE=1
elif [ ${AMBER_TEST_NAME} == vmlinux ]; then
TEST_TYPE=3
elif [ ${AMBER_TEST_NAME} == hello-world ]; then
TEST_TYPE=4
elif [ -d ../../sw/${AMBER_TEST_NAME} ]; then
# Does this test type need the boot-loader ?
if [ -e ../../sw/${AMBER_TEST_NAME}/sections.lds ]; then
grep 80000 ../../sw/${AMBER_TEST_NAME}/sections.lds > /dev/null
grep 8000 ../../sw/${AMBER_TEST_NAME}/sections.lds > /dev/null
if [ $? == 0 ]; then
# Needs boot loader, starts at 0x80000
TEST_TYPE=3
# Needs boot loader, starts at 0x8000
TEST_TYPE=4
else
TEST_TYPE=2
fi
/amber/trunk/hw/tests/timeouts.txt
1,60 → 1,60
flow4 3936
tmp 2756
adc 3228
sub 3356
sbc 4256
barrel_shift 5924
barrel_shift_rs 3260
change_sbits 4004
change_mode 3524
bl 3420
bcc 3068
ldr 5712
ldr_str_pc 3428
strb 3948
ldm1 4372
ldm2 3880
ldm3 3684
ldm4 3676
stm1 8708
stm2 4120
ldm_stm_onetwo 5868
stm_stream 69180
mul 175432
mla 362840
swp 3848
irq 96492
firq 29972
swi 3468
undefined_ins 4444
addr_ex 3640
irq_stm 11504
cache1 14884
cache2 3156
cache3 102596
cache_swap 69936
cacheable_area 8428
cache_flush 21828
flow1 4500
flow2 5992
flow3 4716
conflict_rd 4088
hiboot_mem 3240
ddr31 106792
ddr32 216400
ddr33 24656
ethmac_reg 6476
ethmac_mem 73360
ethmac_tx 23744
uart_reg 3632
uart_tx 133872
uart_rx 133924
uart_rxint 126924
bic_bug 3392
movs_bug 3396
flow_bug 3292
mlas_bug 3812
inflate_bug 3220
swp_lock_bug 3220
cache_swap_bug 25448
add 1692
add 1716
adc 1440
sub 1536
sbc 2676
barrel_shift 4432
barrel_shift_rs 1380
change_sbits 2232
change_mode 1680
bl 1572
bcc 1200
ldr 4276
ldr_str_pc 1576
strb 2300
ldm1 2556
ldm2 2016
ldm3 1832
ldm4 1808
stm1 7012
stm2 2332
ldm_stm_onetwo 5284
stm_stream 52924
mul 180768
mla 383544
swp 2040
irq 101116
firq 29568
swi 1620
undefined_ins 2676
addr_ex 1772
irq_stm 12332
cache1 16408
cache2 1484
cache3 122460
cache_swap 85704
cacheable_area 6348
cache_flush 19460
flow1 3072
flow2 5748
flow3 3396
conflict_rd 2832
hiboot_mem 1436
ddr31 99868
ddr32 205836
ddr33 24684
ethmac_reg 4740
ethmac_mem 79896
ethmac_tx 20364
uart_reg 2028
uart_tx 134116
uart_rx 132420
uart_rxint 127120
bic_bug 1524
movs_bug 1616
flow_bug 1452
mlas_bug 1972
inflate_bug 1408
swp_lock_bug 1356
cache_swap_bug 32656

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.