OpenCores
URL https://opencores.org/ocsvn/attiny_atmega_xmega_core/attiny_atmega_xmega_core/trunk

Subversion Repositories attiny_atmega_xmega_core

[/] [attiny_atmega_xmega_core/] [doc/] [README.md] - Rev 13

Compare with Previous | Blame | View Log

# XMEGA_CORE_IP_V2

This is an optimized IP of the Atmel MEGA and XMEGA processor, that is very simple to use.

* The ROM address BUS and RAM address BUS length are parametrized but not less than 8bit each address BUS.
* The watchdog counter size is aparametrized, if you set 0 counter length the core will not use the watchdog.
* The number of lines of the interrupt controller is parametrized and if number of lines is set to 0 the interrupt controller is not used.

Now I add support for this core on CPP-SDK https://git.morgothdisk.com/C-CPP/MULTIPLATFORM-CPP-SDK/tree/master/ExampleXmega_FPGA .


Utilization report from implementation for CORE_TYPE_XMEGA with default settings:

|Resource | Utilization | Available | Utilization % |
|:--------|------------:|----------:|--------------:|
|`LUT`    | ~1166       |  20800    |  ~0.87        |
|`LUTRAM` |    32       |  46200    |   0.07        |
|`FF`     |   137       |  41600    |   0.05        |
|`BRAM`   |   2.5       |    365    |   0.68        |
|`IO`     |    13       |    285    |   4.56        |
|`PLL`    |     1       |     10    |     10        |

This results is with one parametrized paralel port connected to onboard LED's, 1KBytes of RAM, 4KWords * 16bit of ROM ( the configuration is setup to emulate one Xmega8E5 ) without watchdog and without interrupt module.

**********************************************************************************************************************

Utilization report from implementation for CORE_TYPE_XMEGA with default settings:

|Resource | Utilization | Available | Utilization % |
|:--------|------------:|----------:|--------------:|
|`LUT`    | ~1277       |  20800    |  ~0.95        |
|`LUTRAM` |    32       |  46200    |   0.07        |
|`FF`     |   263       |  41600    |   0.10        |
|`BRAM`   |   2.5       |    365    |   0.68        |
|`IO`     |    18       |    285    |   6.32        |
|`PLL`    |     1       |     10    |     10        |

This results is with two paralel ports, one input fully software configurable port and one output parametrized port connected to onboard LED's, 1KBytes of RAM, 4KWords * 16bit of ROM ( the configuration is setup to emulate one Xmega8E5 ) 1 interrupt source from port A.

**********************************************************************************************************************

Utilization report from implementation for CORE_TYPE_MINIMAL with default settings:

|Resource | Utilization | Available | Utilization % |
|:--------|------------:|----------:|--------------:|
|`LUT`    |  ~695       |  20800    |  ~0.52        |
|`LUTRAM` |    32       |  46200    |   0.07        |
|`FF`     |    98       |  41600    |   0.04        |
|`BRAM`   |   1.5       |    365    |   0.27        |
|`IO`     |    13       |    285    |   6.32        |
|`PLL`    |     1       |     10    |     10        |

This results is with one parametrized paralel port connected to onboard LED's, 128Bytes of RAM, 1KWords * 16bit of ROM ( the configuration is setup to emulate one Attiny26 ) without watchdog and without interrupt module.

**********************************************************************************************************************

Utilization report from implementation for CORE_TYPE_MINIMAL with default settings:

|Resource | Utilization | Available | Utilization % |
|:--------|------------:|----------:|--------------:|
|`LUT`    |  ~825       |  20800    |  ~0.62        |
|`LUTRAM` |    32       |  46200    |   0.07        |
|`FF`     |   226       |  41600    |   0.08        |
|`BRAM`   |   1.5       |    365    |   0.41        |
|`IO`     |    18       |    285    |   6.32        |
|`PLL`    |     1       |     10    |     10        |

This results is with two paralel ports, one input fully software configurable port and one output parametrized port connected to onboard LED's, 128Bytes of RAM, 1KWords * 16bit of ROM ( the configuration is setup to emulate one Attiny26 ) 1 interrupt source from port A.

**********************************************************************************************************************

More details about instruction set implementation of different core type you can read here: https://en.wikipedia.org/wiki/Atmel_AVR_instruction_set

The core is configurable from minimal core to XMEGA core using one CORE_TYPE parameter.


|Family|Members|Arithmetic|Branches|Transfers|Bit-Wise|
|:-----|:------|:---------|:-------|:--------|:-------|
|Minimal AVR1 Core|AT90S1200, ATtiny11, ATtiny12, ATtiny15, ATtiny28|ADD ADC SUB SUBI SBC SBCI AND ANDI OR ORI EOR COM NEG SBR CBR INC DEC TST CLR SER|RJMP RCALL RET RETI CPSE CP CPC CPI SBRC SBRS SBIC SBIS BRBS BRBC BREQ BRNE BRCS BRCC BRSH BRLO BRMI BRPL BRGE BRLT BRHS BRHC BRTS BRTC BRVS BRVC BRIE BRID|LD ST MOV LDI IN OUT LPM (not in AT90S1200)|SBI CBI LSL LSR ROL ROR ASR SWAP BSET BCLR BST BLD SEC CLC SEN CLN SEZ CLZ SEI CLI SES CLS SEV CLV SET CLT SEH CLH NOP SLEEP WDR|
|Classic Core up to 8K Program Space|AT90S2313, AT90S2323, ATtiny22, AT90S2333, AT90S2343, AT90S4414, AT90S4433, AT90S4434, AT90S8515, AT90C8534, AT90S8535, ATtiny26|new instructions: ADIW SBIW|new instructions: IJMP ICALL|new instructions: LD (now 9 modes) LDD LDS ST (9 modes) STD STS PUSH POP|(nothing new)|
|Classic Core with up to 128K|ATmega103, ATmega603, AT43USB320, AT76C711|(nothing new)|new instructions: JMP CALL|new instructions: ELPM|(nothing new)|
|Enhanced Core with up to 8K|ATmega8, ATmega83, ATmega85, ATmega8515|new instructions:MUL MULS MULSU FMUL FMULS FMULSU[2]|(nothing new)|new instructions: MOVW LPM(3modes) SPM|(nothing new)|
|Enhanced Core with up to 128K|ATmega16, ATmega161, ATmega163, ATmega32, ATmega323, ATmega64, ATmega128, AT43USB355, AT94 (FPSLIC), AT90CAN series, AT90PWM series, ATmega48, ATmega88, ATmega168, ATmega162, ATtiny13, ATtiny25, ATtiny45, ATtiny85, ATtiny2313, ATmega164, ATmega324, ATmega328, ATmega644, ATmega165, ATmega169, ATmega325, ATmega3250, ATmega645, ATmega6450, ATmega406|(nothing new)|(nothing new)|(nothing new)|new instructions: BREAK|
|Enhanced Core with up to 4M|ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561|(nothing new)|new instructions:EIJMP EICALL|(nothing new)|(nothing new)|
|XMEGA Core|ATxmega series|new instructions:DES|(nothing new)|new instructions:(from second revision silicon - AU,B,C parts) XCH LAS LAC LAT|(nothing new)|
|Reduced AVRtiny Core|ATtiny40, ATtiny20, ATtiny10, ATtiny9, ATtiny5, ATtiny4|(Identical to minimal core, except for reduced CPU register set)|(Identical to classic core with up to 8K, except for reduced CPU register set)|Identical to classic core with up to 8K, with the following exceptions: LPM(removed) LDD(removed) STD(removed) LD(also accesses program memory) LDS(different bit pattern) STS(different bit pattern) Reduced CPU register set|(Identical to enhanced core with up to 128K, except for reduced CPU register set)|



At this moment has implemented the next instructions:

One clock cycle instructions:

* LDI
* MOVW
* MUL
* MULS
* FMUL
* FMULS
* MULSU
* FMULSU
* INC
* DEC
* ASR
* LSR
* ROR
* SUB
* SBC
* ADD
* ADC
* SWAP
* AND
* EOR
* OR
* MOV
* BLD
* SUBI
* SBCI
* ORI_SBR
* ANDI_CBR
* COM
* NEG
* ADIW
* SBIW

Two clock cycle instructions:

* JMP
* IJMP
* RCALL
* CALL
* ICALL
* PUSH
* POP
* LDS16
* STS
* STD
* ST_X
* ST_XP
* OUT
* IN
* CBI
* SBI
* LPM_R

Three clock cycle instructions:

* CPSE
* SBRC
* SBRS
* SBIC
* SBIS
* LDS
* LDD
* LD_YZP
* LD_YZN
* ST_YZN
* LD_X
* LD_XP
* LD_XN
* ST_XN
* LPM_R
* LPM_R_P

Four clock cycle instructions:

* RET
* RETI

******** Some changes has been made to the instruction execution timings and may differ from the above table.

**********************************************************************************************************************

The implementation project is made for NexysVideo from Digilent and core setup is XMEGA.

The next IO are connected to RAM bus:

* RTC IP located at addr 0x40, this can generate a period interrupt and is connected to line 0 of the interrupt controller.
* PIO IP port located at addr 0x60 input 5 buttons port, this port is parametrized to be dinamically configured by thru software commands and has connected and can generate one interrupt that is connected to line 1 of the interrupt controller.
* PIO IP port located at addr 0x80 switch inputs port, this port is parametrized to be configured using parameters and has connected and can generate one interrupt that is connected to line 2 of the interrupt controller.
* PIO IP port located at addr 0xA0 output port for LED's, this port is parametrized to be configured using parameters and has connected and can generate one interrupt that is connected to line 3 of the interrupt controller.
* PIO IP port located at addr 0xC0 this PIO is connected on the JA PMOD connector and can generate an interrupt that is connected to the line 4 of the interrupt controller.
* PIO IP port located at addr 0xE0 this PIO is connected on the JB PMOD connector and can generate an interrupt that is connected to the line 5 of the interrupt controller..
* PIO IP port located at addr 0x100 this PIO is connected on the JC PMOD connector and can generate an interrupt that is connected to the line 6 of the interrupt controller..
* SPI IP that is connected at addr 0x600, this module drive the Nexus Video onboard OLED display and can generate one interrupt that is connected to the line 7 of the interrupt controller.
* UART IP that is connected at addr 0x400, this module is parametrized to be dinamically configured thru software that has connected and can generate three interrupts: UART_RXC (Uart RX complete), UART_TXC (Uart TX complete), UART_DRE (Tx data register empty) that are connected to line 8, 9 and 10 of the interrupt controller.
* TWI IP that is connected at addr 0x800, this module is connected on JC1=SDA & JC3=SCL connector of the Nexis Video where is connected the PmodNAV board, The CppSDK example application read the LSM9DS1 device and dislay the results on onboard OLED display..
* GFX 2D simple accelerator at addr 0x300, this IP paint filled rectangles and single pixels with a speed of one pixel oc core clock.
* LCD IP pannel controller that has the BRAM VRAM configured in 8bit/color and is starting from address 0 of the microcontroller RAM, the LCD controller IP is parametrized to drive a 1440x900 display pannel at ~60Hz.
* HDMI IP serializer that is connected to the HDMI output connector of the NEXIS VIDEO board is drived by the LCD IP.

On this configuration if a PMODNAV 9-axis from Digilent is connected to JC PMOD connector it will display the values of the LSM9DS1 temperature, acceleration, giroscope and compass if the SW0 is down, and it will display the LPS25HB temperature and pressure if SW0 is up, on Onboard OLED display and on a HDMI display parametrized for a resolution of 1440x900 at 60HZ.

The current configuration is:

Clocks:
*    ~100Mhz core clock.
*    533.333Mhz HDMI IP clock that generate 106.666Mhz LCD IP clock.

Core configuration:
*   Configuration MEGA_XMEGA_1
*   Interrupt controller 11 lines.

Memory configuration:
*   ROM use Block RAM with 14 bit address bus length(32KB, 16KWords).
*   RAM use Block RAM with 12 bit address bus length(4KB).

RTC:
*   Address 0x40.
*   Counter size 32bit.

PIOA:
*   Address 0x60.
*   Dinamically configured by the microcontroller and connected to 5 onboard push buttons.
*   Connected to the five push buttons of Nexus Video board.

PIOB:
*   Address 0x80.
*   Statically configured like input PIO and connected to 8 onboard switches.
*   Connected to the eight switches of the Nexus Video board.

PIOC:
*   Address 0xA0.
*   Statically configured like output PIO and connected to 8 onboard LED's.
*   Connected to the eight LED's of the Nexus Video board.

PIOD:
*   Address 0xC0.
*   Dinamically configured by the microcontroller.
*   Connected to the JA PMOD connector of the Nexis Video board.

PIOE:
*   Address 0xE0.
*   Dinamically configured by the microcontroller.
*   Connected to the JB PMOD connector of the Nexis Video board.

PIOF:
*   Address 0x100.
*   Dinamically configured by the microcontroller.
*   Connected to the JC PMOD connector of the Nexis Video board.

PIOG:
*   Address 0x120.
*   Statically configured like output PIO.
*   Connected to the four wires (VDD, VBAT, RES, DC) of the onboard OLED display of the Nexus Video board.

UARTA:
*   Address 0x400.
*   Dinamically configured by the microcontroller.
*   Default UART pins of the Nexus Video board.

SPIA:
*   Address 0x600.
*   Dinamically configured by the microcontroller.
*   SCLK & SDIN of the onboard OLED dissplay pins of the Nexus Video board.

TWIA:
*   Address 0x800.
*   Dinamically configured by the microcontroller.
*   JC3=SCL, JC1=SDA on PMOD connector of the Nexus Video board.

2D Controller:
*   Address 0x300.

LCD Contoller:
*   Address is the 2D accelerator + 0x10.
*   Thru gfx_accel IP (2D Controller).
*   Resolution 1440*900 60Hz.
*   Pixel color is 8 bit (automatically converted from 24bit color space to 8bit color space).

HDMI Controller:
*   Driven by the LCD IP.
*   Connected to the HDMI out of the Nexus Video board.

Utilization report from implementation for MEGA_XMEGA_1 with default settings:

In this configuration the resource needed from Nexus Video board is:

|Resource | Utilization | Available | Utilization % |
|:--------|------------:|----------:|--------------:|
|`LUT`    | ~3803       | 133800    |  ~2.84        |
|`LUTRAM` |    32       |  46200    |   0.07        |
|`FF`     |  1656       | 267600    |   0.62        |
|`BRAM`   |   329       |    365    |  90.14        |
|`DSP`    |     2       |    740    |   0.27        |
|`IO`     |    65       |    285    |  22.81        |
|`PLL`    |     1       |     10    |  10.00        |


**********************************************************************************************************************

# To do:

* Add a HALT signal to the processor to facilitate DMA access.
* Add a DMA controller IP.
* Add a external SDRAM/DDR/DDR2/DDR3 controller IP with all glue necessary IP's.



![AVR Instruction set manual](https://git.morgothdisk.com/VERILOG/VERILOG-XMEGA-CORE-V3/raw/master/avr-instruction-set-manual.pdf)

![Atmel AVR Instruction set overview](https://git.morgothdisk.com/VERILOG/VERILOG-XMEGA-CORE-V3/raw/master/Atmel_AVR_Instruction_set_overview.png)

![XmegaFpgaTopImplementation](https://git.morgothdisk.com/VERILOG/VERILOG-XMEGA-CORE-V3/raw/master/XmegaFpgaTopImplementation.png)


Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.