Skip to content

tobbelobb/simulate-avr-cpu

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

Synopsis

This code is meant to simulate the state of an AVR microprocessor like the ATmega 328 or similar.

Code example

Modifying the processors state is supposed to be done with function/macro calls looking like:

(ldi r20 1)
(ldi r21 41)
(add r21 r20)
(print-register r21)
 ==> 00110100 00110010

Motivation

Libraries of really good AVR assembly would make cheap CPUs applicable in a wider range of situations. However, writing AVR Assembly is really hard work. This tool is meant to facilitate automation of AVR Assembly code generation. The reduced instruction set and small memory of AVR CPUs makes automatic assembly feasible to both write and test.

Inspiration

I found out about "stochastic superoptimization" in this presentation. Also check out their papers one of them here and STOKE repo.

Why Lisp?

Macros, flexible type system and performance.

Performance?

Optimizing most often starts with profiling, so maybe this blog post for a little on per-function profiling. For statistical profiling, see this blog post. To see how SBCL can be sometimes be used for headless 'gcc -O3'-style compilation, check this blog post and these blog posts.

See also the excellent SBCL manual.

Licence

GPLv3

About

Intended to simulate the AVR processor and be able to run code like (ldi r20 1) and investigate AVR memory afterwards.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published