AVR Board
7 segment display AVR Programmer
AVR  arduino  atmel  board  code  core  data  design  development  device  features  flash  memory  USB  registers  microcontroller  power  program  programming  software 

AVR Soft Cores



pAVR - Pipelined AVR microcontroller

pAVR on OpenCores


This project implements an 8 bit controller that is compatible with Atmel's AVR architecture, using VHDL (Very High speed integrated circuits Hardware Description Language). pAVR is an 8 bit controller fully compatible with Atmel's AVR architecture. pAVR stands for "pipelined AVR". You can also find here the core pAVR sources, some tests and results of synthesis on Xilinx Spartan 3 FPGA.

pAVR is not a specific controller of the AVR family, but rather a maximally featured AVR. It is configurable enough to be able to simulate most AVR family controllers. The goal was to obtain an AVR processor that is as powerful as possible (in terms of MIPS), with a work budget of about 6 months*man. AVR is about 3x faster than the original core, if built with the same technology.

The sources are modularized. They are written starting from a set of common-sense conventions (the process splitting strategy, signals naming, etc)., so that pAVR is quite an easily maintainable design. A comprehensive documentation is provided. Extensive testing was carried out.

FPGA Xilinx Spartan
Features
  • 6 pipeline stages
  • 1 clock/instruction for most instructions
  • estimated clock frequency: ~50 MHz & 0.5 um; assuming that Atmel's core runs at 15 MHz & 0.5 um. That's ~3x Atmel original core's performance.
  • estimated MIPS at 50 MHz: 28 MIPS (typical), 50 MIPS (peak). That's ~3x Atmel original core's performance. At 15 MHz, Atmel's core has 10 MIPS typical, and 15 MIPS peak.
  • CPI (clocks per instruction): 1.7 clocks/instruction (typical), 1 clock/instruction (peak). That's ~0.75x (typical), 1.00x (peak) Atmel original core's performance.
  • up to 32 interrupt sources. Each interrupt has programmable priority and jump address.
  • heavily parameterized design that permits flexible costumization
  • pAVR architecture is rather computational-friendly than control-friendly. Jumps, branches, skips, calls and returns are relatively expansive in terms of clocks. A branch prediction scheme and a smarter return procedure might be considered as upgrades.



FPGA Altera Stratix

AVR core

Microcontroller core compatible with one used in AT mega 103 and written in VHDL. It has the same instruction timing and the same instruction set (with a few exceptions).

Features

• Core features:
– 32 x 8 general purpose registers
– Twenty three interrupt vectors
– Supports up to 128 Kb of program and up to 64 Kb of data memory

• Peripheral features:
– Programmable UART
– Two 8-bit Timer/Counters with separate prescalers and PWM
– Eight external interrupt sources
– Two parallel ports

Status

The core was tested with several ASM and C programs. It was implemented in Altera EPF10K50ETC144-3 device and tested with AVR port of uC/OS-II The Real-Time Kernel, written by Ole Saether.(I used special version of the design with external SRAM for both program and data memories).



FPGA Xilinx Virtex5

AVRtinyX61core

This is a Atmel AVR ATtiny261/461/861 compatible core. It should be (more or less) fully code compliant, but it is not clock-cycle compliant. The reason it was developed was to have a simple core to develop C-code to. The implementation is rather strait forward without any pipelining. One reason was also to see how hard it was to implement a standard mcu in vhdl and make it run on gcc-generated code. The implementation is a bit quick-n-dirty, I spent about 15h coding the core and about 15h to writing test bench and simulate the core. Please note, you should not use the AVRStudio for development to this core, the files generated by AVRStudio is compatible with the core, BUT, if you don't buy the mcu from Atmel, you shouldn't use their software!

The test bench uses code (C and Asm) compiled only with the help of gnu-tools.

Info

  • Features:
    • Fully instruction compliant
    • Can address up to 64kword of instructions and 64kbyte of sram
    • Hex-file from a standard avr-gcc compile will work in this core
  • Difference to standard core:
    • The core is slow compared to original mcu, an instruction takes 3-6 cycles to execute
  • Tested:
    • With simple asm-code that tests all instructions
    • With a XTEA encryption/decryption algorithm to test math
  • Non tested:
    • Not all combinations of instructions, registers and constants are tested
    • hex2vhdl converter (may give wrong addresses)
  • Not implemented:
    • Writing of registers with ST, STS and STD (writing of sreg and sp might work)
    • Reading of registers with LD , LDS and LDD
    • SLEEP, WDR, SPM
    • IRQ
  • Future:
    • If you miss something in the core please just send me an email avmcu@o...
    • My future plans is to optimize the core mostly for size but also for speed
    • Add generic to control number of address lines for PM and DM.
    • Add generic to skip SPH register
    • IRQ may be implemented in the future as a generic option if anybody requests it
    • Some simple io-units e.g. io-port, spi, uart, pwm and input-capture units
    • Some documentation of the core implementation
    • Fixed in 2008-10-08 release: Add detection of unimplemented usage of LD/LDS/LDD/ST/STS/STD to indirect read or write register map (when X, Y or Z points to 0-0x1F). (Does gcc really use this anywhere?)
  • Wishes from me:
    • Please send me an email if you intend to test or use this core, send some information about your project or product. It would be nice to know if it will be used in any product.
    • Please don't forget to send me bug-reports, any bug fixes you do in the core must be released on the web anyway due to the lgpl license.
  • Comment about the testbench:
    • Fixed in 2008-10-08 release: tb_pm_hex is by default configured for max 2048 words (4096 bytes) of pm space, change generic g_pm_size to be able to use larger programs.
    • Fixed in 2008-10-08 release: the rjmp/rcall directly addresses the hole memory of up to 8 kBytes with "negative" addresses, this could give a error in the tb_pm_hex but does not effect real world applications. To fix simulation just use the lower 12 bits of the PM_A in tb_pm_hex/pm. "a_int := CONV_INTEGER(PM_A(11 downto 0));". If you use less then 4kBytes of pm code, then this problem will not be visible.
  • Other comments:
    • If you use this core in a project then please send me an email with a link to the projects home page so I could add a link to your project on this page.
    • If you modify the core you must make the changes available according to LGPL, just send me the link and I will add the link to this page or just send me a zip file that I could add to this page.

Status

  • Mcu is ready and tested
  • Tb (with tb-source for core) is ready and tested
  • Extensive testing of core in real world not done
  • Synted (and par) for Xilinx Spartan3-400 with Ise 8.1, final results after place-and-route:
    • Optimized for speed: about 83 MHz, 150 ff, 1700 lut
    • Optimized for area: about 70 MHz, 130 ff, 1600 lut
  • Reported: Synted (and par) with Quartus, about 80% of a for Altera EP1C3.
  • Reported: One person have tested to implement a complete function with advanced mathematics in a Virtex E, no issues found so far with the core, in his application this core seems to run about 3.7-4 times slower (in cycle count) then a standard AVR.
  • The new release (2008-10-08) might be slightly larger (0.x%) but works better in simulation. There is no change to the cores instruction handling between first and this release.