• Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    C
  • Created about 14 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Thumb instruction set emulator
This is a Thumb (16 bit ARM) instruction set simulator. Written
primarily for my experiments and for anyone wanting to learn the
instruction set but not having to read schematics or get many registers
set right to blink your first led or turn a pixel on on a display. I
started cleaning up the armulator from ARM (wanted to remove the
if-then-elses and target specific stuff and make it a clean, simple,
core) but got frustrated with it, I probably broke it so I wrote my own.

The single file thumbulator.c is the instruction set simulator (ISS), the
other directories are test programs and/or examples depending on how you
want to look at it.

It boots similar, well the same as a cortex-m where the exception vector
table is addresses to code instead of code like you have with an ARM
based core. The thumbulator does not support thumb2 instructions at
this time, if/when that happens it will likely be a separate simulator
to keep the two separate, simple, and clean.

There are virtually no peripherals, one uart port for TX only (prints
the character to the console). A port that prints the 32 bit value
written to the console, and a port to halt the processor. Adding your
own peripherals is easy.

Not necessarily cycle accurate to any real ARM core, it is designed
around a 16 bit data bus model similar to running on a GBA, and
instruction fetches and reads and writes to memory are counted and
displayed when you finish. One main reason for this program was to use
it to compare the output of various compilers.

No guarantees to be bug free, the tests I have thrown at it so far are
both special purpose and real world applications. And so far I have
cleaned up the instructions that didnt work, I have not checked code
coverage to see if every instruction has been hit. If you happen to
try it, and happen to find something please let me know. Beware though
the compilers and the code out there can be evil, I found an llvm bug
already, one or two of the examples I used mismanaged their integer
lengths. I used to like to use zlib as test code, but its integer
lengths are chaotic and it has become useless(to me)(as embedded or
test code) without a lot of rework.

d w e l c h a t d w e l c h d o t c o m

UPDATE:

The directories here are just a bunch of experiments and entertainments
for me, thumbulator.c is basically the project.

I have a bare_metal directory in my raspberrypi project you may find
interesting to understand how to put together a little bit of bootstrap
code to jump into a C program and go from there.  The blinker directory
(in this project) is perhaps a place to use as a beginning point on an
embedded program.

Google
  ARM DDI 0100E
or
  ARM DDI 0100I

https://www.scss.tcd.ie/~waldroj/3d1/arm_arm.pdf
http://morrow.ece.wisc.edu/ECE353/arm_reference/ddi0100e_arm_arm.pdf
http://reds.heig-vd.ch/share/cours/aro/ARM_Thumb_instructions.pdf
They have a rev B here...Which was the blue covered one in print.
http://www.home.marutan.net/arcemdocs/
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/third-party/archives/ddi0100e_arm_arm.pdf
https://www.cs.miami.edu/~burt/learning/Csc521.141/Documents/arm_arm.pdf

More Repositories

1

raspberrypi

Raspberry Pi ARM based bare metal examples
Assembly
2,699
star
2

raspberrypi-zero

Raspberry Pi Zero baremetal examples
C
149
star
3

raspberrypi-pico

Raspberry Pi pico baremetal examples
C
118
star
4

rpigpu

Raspberry Pi GPU based bare metal example programs
C
104
star
5

stm32_samples

C
100
star
6

qemu_arm_samples

bare metal ARM examples to be run with qemu-system-arm
C
66
star
7

stm32f4d

C
66
star
8

mbed_samples

NXP mbed microcontroller board example programs
C
57
star
9

lsasim

Educational load/store instruction set architecture processor simulator
Verilog
38
star
10

raspberrypi-three

Baremetal examples for the Raspberry Pi 3
C
27
star
11

build_gcc

C
21
star
12

microbit

baremetal examples for the BBC micro:bit
C
21
star
13

amber_samples

Verilog
18
star
14

black_pill_too

STM32F407VGT6 breakout board baremetal examples.
C
18
star
15

ntc_chip_examples

Next Thing Co CHIP examples
C
17
star
16

yagbat

Yet Another GBA Tutorial
C
15
star
17

allwinner_samples

Example baremetal programs for some allwinner boards.
C
13
star
18

pic32_samples

Low level embedded example programs for the pic32 (UBW32 and CUI32 boards)
C
12
star
19

avr_samples

arduino and family low level example programs
C
11
star
20

msp430_samples

msp430 launchpad sample programs
C
11
star
21

atsamd_samples

Atmel SAM D bare metal examples.
C
10
star
22

beaglebone_samples

C
9
star
23

pcemu_samples

Using the pcemu to learn 8088/86 assembly language programming
9
star
24

xmos_samples

Some of my xmos sample programs
Assembly
9
star
25

tivac_launchpad

Tiva C Launchpad Bare Metal Examples
C
9
star
26

lc3

C
8
star
27

stm32f0d

stm32f0 discovery examples
C
8
star
28

stm32vld

C
7
star
29

pocket_beagle_samples

PocketBeagle baremetal examples.
C
7
star
30

lichee-rv-samples

Lichee RV bare metal examples
C
7
star
31

sifive_samples

SiFive risc-v baremetal examples
C
7
star
32

onion_omega2_samples

Onion Omega2 baremetal examples
C
6
star
33

pdp11_samples

Bare metal pdp11 samples.
C
6
star
34

blue_pill_too

Like the STM32 blue pill there is a STM32F030F4P6 based blue board which so far as I know doesnt have a cool name yet.
C
6
star
35

gigadevice_samples

GigaDevice RISC-V BareMetal examples
C
6
star
36

riscv_baremetal

RISC-V Baremetal examples.
5
star
37

avriss

avr instruction set simulator
C
5
star
38

msp432_samples

ti msp432 baremetal samples
C
5
star
39

teensy_samples

C
4
star
40

pdp8sim

pdp8 instruction set simulator
C
4
star
41

ipod_mini

C
4
star
42

mpx_samples

C
4
star
43

icestick_samples

C
4
star
44

stellaris_launchpad

C
4
star
45

msp430sim

msp430 instruction set simulator
C
4
star
46

lpc-h2148_samples

sample programs for the lpc-h2148
C
4
star
47

8051_samples

8051 bare metal examples
Eagle
3
star
48

altor32_samples

Verilog
3
star
49

nxp_samples

NXP microcontroller samples
C
3
star
50

myrisc16

C
3
star
51

nmea_clock

GPS NMEA parsing for GPS clock.
C
3
star
52

atsaml11_samples

Baremetal examples for the ATSAML10 and ATSAML11 cortex-m23 microcontrollers.
C
2
star
53

maple_samples

C
2
star
54

pdp11sim

C
2
star
55

lpcxpresso_samples

Example programs for the lpc1343 version of the lpcxpresso
C
2
star
56

sam7s_samples

at91sam7s example programs
C
2
star
57

raspberrypi-pico-2

Bare metal examples for the raspberry pi pico 2
C
1
star
58

pn532_samples

Using the pn532 rfid nfc reader
C
1
star
59

efm32_samples

Baremetal examples for the EFM32 microcontrollers.
C
1
star
60

kicad_fun

C
1
star
61

morestuff

C
1
star
62

panda_samples

Low level embedded example programs for the FEZ Panda
C
1
star
63

riscv-instructions

Makefile
1
star
64

esp8266_samples

C
1
star
65

picorv32_samples

samples to play with Clifford Wolf's picorv32 riscv32i processor
Verilog
1
star
66

mips1_core_samples

Derived from opencore m1_core
1
star
67

armmite_samples

Example low level programs for the Coridium Armmite pro.
1
star