Andes Game Platform

Andes Technology

Architecture for Next-generation Digital Engines for SoC Outline

™Porting guide ™System Architecture ™Package dependency ™Game package details ™Performance issue ™The result of playing game on Andes platform ™The ways of enhancement performance

Page 2 Getting Started

™Environment ƒ Ubuntu 9.10 ƒ BSP 2.0 ƒ Andes tool chain v1.3.3 ƒ A working target

Page 3 Porting Guide

™ Demo open source applications porting for Andes platform ™ There are following steps ƒ Modify config.sub ƒ configure and make

Page 4 Environment settings for Andes tool chain

™Set the location of your tool chain ƒ source bashrc.nds32le--V0 ƒ export ANDESIGHT_ROOT=/home/path/toolchains/nd s32-elf-n1213-43u1h ƒ export PATH=$ANDESIGHT_ROOT/bin:$PATH

Page 5 Modify config.sub

™Find the line below "Some are omitted here ..."

Page 6 Modify config.sub

™Find the line below "Recognize the basic CPU types with company name."

Page 7 Configure

™Using build scripts

Page 8 Configure

™Assign Andes toolchains

Page 9 Deploy

™Copy the folder of your building path to SD card ™Set environment variable of library

Page 10 Make and Install

™The compile time error can find in this step

Page 11 Game platform

™ Demo how to play games on Andes platform ™ Emulate a hardware architecture of a game system ™ A game emulator will be composed of the following modules ƒ A CPU emulator or CPU simulator (the two terms are mostly interchangeable in this case) ƒ A memory subsystem module ƒ Various I/O devices emulators

Page 12 Game Menu

Page 13 System Architecture

™ ROM code ™ Game Emulator ƒ Software

ƒ Gameboy Advance ROM code ƒ Entertainment System ƒ Super Nintendo Entertainment Game Emulator System ™ Simple DirectMedia Layer (SDL) ƒ Display on frame buffer SDL ƒ Audio Linux kernel/driver ™ Linux kernel/drivers Andes Hardware ƒ Audio driver ƒ Joy Stick/GPIO ƒ SD card driver

Page 14 Joy Stick

Up X B A Left Right

Down Start Select

Page 15 Package dependency

™ InfoNES ™ VisualBoyAdvance 1.7.2 ƒ SDL 1.2.14 ƒ libpng 1.2.40 ƒ zlib 1.2.3 ™ Snes9x ƒ SDL 1.2.14 ™ Gnuboy 1.0.3 ƒ SDL 1.2.14

Page 16 Gnuboy Performance Issue

™No floating point code whatsoever. ™Use fixed point or better yet exact analytical integer methods as opposed to any approximation. ™Assembly code implementation of CPU emulation

Page 17 Game Emulator

™Game Boy ™Nintendo Entertainment System ™Super Nintendo Entertainment System

Page 18 Game Boy(1/4)

™An 8-bit handheld video game console developed and manufactured by Nintendo ™It was released in Japan on April 21, 1989 (1989- 04-21) ™It was created by Gunpei Yokoi and Nintendo's Research and Development 1 ƒ The same staff who had designed the Game & Watch series as well as several popular games for the NES.

Page 19 Game Boy(2/4)

™Directional pad ™Four operation buttons ƒ "A" ƒ "B" ƒ "SELECT" ƒ "START"

Page 20 Game Boy(3/4)

™CPU ƒ Custom 8-bit Sharp LR35902 core at 4.19 MHz ƒ The core also contains integrated sound generation ™RAM ƒ 8 kB internal S-RAM ™Video RAM ƒ 8 kB internal ™ROM ƒ On-CPU-Die 256-byte bootstrap; 256 kb, 512 kb, 1 Mb, 2 Mb, 4 Mb and 8 Mb cartridges

Page 21 Gnuboy Performance Issue

™No floating point code whatsoever. ™Use fixed point or better yet exact analytical integer methods as opposed to any approximation. ™Assembly code implementation of CPU emulation

Page 22 Game Boy(4/4)

™Sound ƒ 2 square waves, 1 programmable 32-sample 4-bit PCM wave, 1 white noise, and one audio input from the cartridge ™ Display ƒ Reflective LCD 160 × 144 pixels ™ Screen size ƒ 66 mm (2.6 in) diagonal ™ Power ƒ 6 V, 0.7 W (4 AA batteries provide ~14~35 hours) ™ Dimensions: 90 mm (W) x 148 mm (H) x 32 mm Page(D 23) / 3.5" x 5.8" 1.3" (in) Nintendo Entertainment System

™CPU ƒ Ricoh 2A03 8-bit processor (MOS Technology 6502 core) ™Controller input ƒ 2 controller port ™Best-selling game ƒ Super Mario Bros. ™Predecessor ƒ Color TV Game ™Successor ƒ Super Nintendo Entertainment System Page 24 Nintendo Entertainment System

™Game ƒ Super Mario Bros. ƒ The Legend of Kage

Page 25 Super Nintendo Entertainment System ™Built on 16-bit architectures and offered improved graphics and sound over the 8-bit NES

Page 26 Super Nintendo Entertainment System ™CPU reference ƒ Clock Rates (NTSC) • Input: 21.47727 MHz ƒ Bus • 3.58 MHz, 2.68 MHz, or 1.79 MHz ƒ Clock Rates (PAL) • Input: 21.28137 MHz ƒ Bus • 3.55 MHz, 2.66 MHz, or 1.77 MHz • 24-bit and 8-bit address buses, 8-bit data bus

Page 27 Super Nintendo Entertainment System ™Additional Features ƒ DMA and HDMA ƒ Timed IRQ ƒ Parallel I/O processing ƒ Hardware multiplication and division

Page 28 Super Nintendo Entertainment System ™CPU ƒ 16-bit 65c816 Ricoh 5A22 3.58 MHz ™Best-selling game ƒ Super Mario World ƒ Donkey Kong Country ™Predecessor ƒ Nintendo Entertainment System ™Successor ƒ

Page 29 Super Nintendo Entertainment System ™Game ƒ Super Mario World ƒ Mega Man X ƒ Super Bomber Man 5

Page 30 Five Inch Version

Page 31 Resource usage and profiling

™VisualBoyAdvance on Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz ™192/100 => 1.92 Core

Page 32 The result of playing game on Andes platform

Emulator CPU consumption DRAM smoothness rate name consumption rate 0~100

Game boy 30~5% 4% 90

Game boy 98% 32% 20 Advance

NES 98% 3% 55

SNES 98% 16% 90

Page 33 The ways of enhancement performance

™Game emulator study and optimization ™Eliminate floating point calculation ™Close hardware emulation

Page 34 Andes Platform Porting Experiment

Andes Technology

Architecture for Next-generation Digital Engines for SoC Outline

™Porting Diff package ƒ Creating working platform ƒ Getting package ƒ Adding Andes architecture ƒ Configure ƒ Make ƒ Deploy

Page 36 About Diff

™Diff is a file comparison utility ™Outputs the differences between two files. ™Show the changes between a file and a former version of the same file. ™The output is called a diff or a patch ™Like the use of the word "grep" for describing the act of searching, the word diff is used in jargon as a verb for calculating any difference.

Page 37 Getting started

™Make sure you have ƒ Linux platform ƒ Tool-chains ƒ A folder name nds32 under your home folder

Page 38 Getting package

™apt-get source diff

Page 39 Adding Andes Architecture

™nds32 | nds32le

Page 40 Adding Andes Architecture

™File under config/config.subconfig/config.sub ™nds32 | nds32le

Page 41 Using Scripts

™./build_nds.sh

Page 42 If You Forget to Add Andes Arch.

Page 43 Configure

Page 44 Compile

Page 45 Deploy

™Copy all the files and folder under $HOME/nds32 folder ™Diff usage ƒ diff [diff opts] file1 file2

Page 46 Thank You!!!

Architecture for Next-generation Digital Engines for SoC