This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
173 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
AEMB 32-bit Microprocessor Core. | ||
=============================== | ||
|
||
Smallest and fastest processor it its class! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (C) 2011 Aeste Works (M) Sdn Bhd. | ||
|
||
TMP := $(shell mktemp -d)/v | ||
DMP := $(shell hostname)-$(shell date -I) | ||
RND := $(shell od -d -N2 -vAn /dev/urandom) | ||
|
||
VER = $(wildcard verilog/*.v) | ||
|
||
LIB = -y ../rtl/verilog | ||
LOG = $(DMP).log | ||
VCD = $(DMP).vcd | ||
|
||
edk63: edk63.v vvp clean | ||
|
||
edk63.v: | ||
iverilog $(LIB) -tnull -M$(TMP).ls verilog/edk63.v | ||
uniq $(TMP).ls | sed 1d > $(TMP).fs | ||
iverilog -c$(TMP).fs -E -tnull -o $(TMP).v verilog/edk63.v | ||
|
||
vvp: | ||
iverilog -Wall -o $(TMP).vvp $(TMP).v | ||
time -p vvp -l $(LOG) $(TMP).vvp +randseed=$(RND) +dumpfile=$(VCD) | ||
|
||
clean: | ||
rm -rf $(TMP)* | ||
|
||
clear: | ||
rm -f *.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# Makefile for AEMB Software | ||
# | ||
|
||
CC = mb-g++ | ||
LFLAGS = -Wl,-defsym -Wl,_STACK_SIZE=0x2000 -Wl,-defsym -Wl,_HEAP_SIZE=0x2000 | ||
CFLAGS = -mtune=v5.00 -mxl-soft-div -msoft-float -mxl-barrel-shift -mno-xl-soft-mul -g | ||
IFLAGS = -I cc/ | ||
OFLAGS = -Os | ||
|
||
OBJDUMP = mb-objdump | ||
OBJCOPY = mb-objcopy | ||
|
||
testbench: testbench.cc sim | ||
@echo "DONE" | ||
|
||
uxe: uxe.cc sim | ||
@echo "DONE" | ||
|
||
testbench.cc: cc/testbench.cc | ||
$(CC) $(CFLAGS) $(IFLAGS) $(LFLAGS) $(OFLAGS) -specs=aemb.specs -o rom.elf cc/testbench.cc | ||
|
||
uxe.cc: cc/uxe.cc | ||
$(CC) $(CFLAGS) $(IFLAGS) $(LFLAGS) $(OFLAGS) -specs=aemb.specs -o rom.elf cc/uxe.cc | ||
|
||
sim: | ||
$(OBJDUMP) -DSCz rom.elf > rom.dump | ||
$(OBJCOPY) -O srec rom.elf rom.srec | ||
srec_cat rom.srec -fill 0xAE -within rom.srec -range-pad 4 -o ../sim/dump.vmem -vmem 32 | ||
|
||
clean: | ||
rm *.dump *.srec *.elf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
** AEMB Micro Execution Environment | ||
** Copyright (C) 2011 Aeste Works (M) S/B. | ||
** | ||
** This file is part of AEMB. | ||
** | ||
** AEMB is free software: you can redistribute it and/or modify it | ||
** under the terms of the GNU General Public License as published by | ||
** the Free Software Foundation, either version 3 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** AEMB 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 General Public | ||
** License for more details. | ||
** | ||
** You should have received a copy of the GNU General Public License | ||
** along with AEMB. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
AEMB Early Boot-Loader | ||
@file uxe.cc | ||
*/ | ||
|
||
#define BOOT_BASE 0x00020000 ///< Base address of the kernel | ||
|
||
#define SRAM_BASE 0x00001000 ///< Base address of RAM block | ||
#define SRAM_SIZE 0x00010000 ///< Size of RAM block | ||
|
||
#include "aemb/core.hh" | ||
|
||
typedef void (boot_addr)(void); | ||
|
||
// Replacements for STDIO | ||
|
||
void uxe_putc(char c) | ||
{ | ||
volatile char *COUT = (char *) 0xFFFFFFC0; | ||
*COUT = c; | ||
} | ||
|
||
void uxe_putw(char * msg) | ||
{ | ||
for (char *c = msg; *c != 0; c++) uxe_putc(*c); | ||
} | ||
|
||
void uxe_puts(char * msg) | ||
{ | ||
uxe_putw(msg); | ||
uxe_putc('\n'); | ||
} | ||
|
||
|
||
// Main execution environment. | ||
|
||
int main () | ||
{ | ||
// Welcome banner | ||
uxe_puts("Micro Execution Environment 11.07"); | ||
uxe_puts("Copyright (C) 2011 Aeste Works (M) S/B."); | ||
//uxe_puts("\nThis program comes with ABSOLUTELY NO WARRANTY;\nThis is free software, and you are welcome to redistribute it under certain conditions;\nFor more details, see the GPL3.txt file included.\n"); | ||
|
||
// Load kernel image (SD/MMC) | ||
|
||
// Print kernel base address (only works with 0-9) | ||
uxe_putw("Boot @"); | ||
for (unsigned int i = 0, k = BOOT_BASE; i < 8; ++i, k <<= 4) { | ||
uxe_putc( (k >> 28) + 0x30 ); | ||
} | ||
uxe_putc('\n'); | ||
|
||
// Jump to next stage | ||
((boot_addr*) BOOT_BASE)(); | ||
|
||
// This should *NEVER* execute. | ||
return -1; | ||
} |