A new descriptive method to use ARM AHB and APB Bus architecture to add new IP Cores and enhance functionality of 32 bit Processor (Leon3). AHB and APB addressing and GUI enhancement is also discussed.
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
1. Title: A 32-Bit Parameterized Leon-3 Processor
with Custom Peripheral Integration
TALAL KHALIQ
MSEE-7 (DSSP)
SUPERVISOR: DR. AWAIS M. KAMBOH
1
2. Motivation
General Purpose Processors are designed to handle every day tasks.
They are not designed to perform a special tasks which include:
Floating Point Operation (FPU)
DSP Algorithms (FFT, DCT etc)
Video Processing
Encryption / Decryption
For this purpose, separate hardware was added to perform these tasks
but they had major drawback: POWER
2
3. Motivation
Introduction of System-on-Chip Architectures led to:
Standard Bus Architectures
High Performance
Low Power Consumption
Coprocessors (Hardware Accelerators) could be added to the
processor for this task
3
4. Motivation (Example)
General Purpose tasks
Most common applications
Serial data processing
Specialized tasks (e.g.
graphics, video)
Most visual applications
Parallel data processing
General purpose,
programmable scalar and
vector cores
High-speed bus architecture
Low latency memory model
4
5. Motivation (Example)
5
ARM ML Processor:
Is optimized for machine learning algorithms
Has dditional programmable layer engines support the
execution of non-convolution layers
Has Onboard memory which allows central storage for weights
and feature maps, thus reducing traffic to the external memory
and therefore, power.
6. Problem Statement
Most of the coprocessor designs that we have studied concentrate only on the
coprocessor architecture and do not incorporate design decisions for
interfacing it in an SoC environment.
Nowadays many powerful public domain IP cores are available for complicated
component like 32 bit processor i.e. LEON3.
It needs some expertise, work and experimentation to implement a
hardware/software co-design project.
We take an effort to present step-by-step description for implementing desired
coprocessor or peripheral on LEON3 processor.
6
7. Selection of 8 bit Processor (8051 uC)
An Open Source IP Core for 8051 Microcontroller written in VHDL from Oregano
Systems was chosen. Its main features due to which it was chosen are as under:
Instruction set compatible to the industry standard 8051 microcontroller
Active timer/counter and serial interface units selectable via additional special
function register
Parameterizeable via VHDL constants
256 bytes internal RAM
Up to 64 Kbytes ROM and up to 64 Kbytes External RAM
Source code freely available
7
8. Synthesis on FPGA (8051 uC)
Top module for 8051 was written in VHDL which used:
8051 Core
Memory Cores using Core Generator:
128 x 8 RAM
64k x 8 ROM
64k x 8 External RAM
PLL Core (100MHz board clock to 11.675MHz)
8
12. 32-bit Processor: Leon3 Introduction
Leon 3 is 32 bit processor based on SPARC V8 Architecture
Support for Multiprocessing Configurations
7 Stage Pipeline
Can achieve 125 MHz on FPGA and 400 MHz on 0.13um ASICs
Optional high performance IEEE-754 Floating Point Unit
Optional SPARC Reference Memory Management Unit
12
13. Leon3 Advantages
Open Source in VHDL and netlist
Multiprocessor Support
Configuration through GRLIB
Support for FPGAs and ASICs
Uniform Method for Hardware & Software debug
Hardware (excluding EDA Tools) & Software tools are downloadable
13
16. What we want to achieve (Leon3)
Custom Template (with File Hierarchy) for Simulation and Synthesis
New peripherals to enhance the processor's capabilities, and to adapt them for
better performance in a given domain of applications
Create Custom IP
Add Interface or Wrapper
Co-Processor Extension
Create Software Application to use created IP
16
19. APB Slave Software Interface
19
Leon3 Processor
AMBA AHB BUS
Memory
Co-Processor
Wrapper
0x4000000 0x8000000
Int *MMRegister = (int*) 0x8000000; //Base Address of Co-Processor Wrapper
// write the value 0xFF into the register
*MMRegister = 0xFF;
// read the register
int value = *MMRegister;
AHB/
APB
Bridge
AMBA APB BUS
0x8000800
22. Multiplier Peripheral Software
22
Base pointer for Multiplier
Peripheral is 0x80000800
For N=4,8 and 16
Pointer at 0x80000800 is 32-bit
Integer which takes 16-bit
multiplier and multiplicand
concatenated together to get
product value in 32-bit.
Link between variables and
pointer values is shown above
For N=32
Separate variables for
multiplier and multiplicand.
Product is 64-bit which needs
to be declared as two integers
concatenated or double (in
embedded C) As shown below.
23. AHB Slave Interface
23
The Advanced High-Performance Bus (AHB) is part of the AMBA
hierarchy of buses and is intended for:
High Performance Designs with multiple bus masters and
High bandwidth operations
High clock frequency operations
24. AHB Software Interface
24
Leon3 Processor
AMBA AHB BUS
PROM
Memory
Co-Processor
Wrapper
0x4000000 0xFF00000
Int *MMRegister = (int*) 0xFF00000; //Base Address of Co-Processor Wrapper
// write the value 0xFF into the register
*MMRegister = 0xFF;
// read the register
int value = *MMRegister;
25. AES-128 Pipelined Cipher
25
AES-128 pipelined cipher core which is downloaded as open source
project from OpenCores, uses AES algorithm which is a symmetric
block cipher to encrypt information.
It takes 128-bit Plain text and Key Data (symmetric block cipher) and
outputs 128-bit ciphered data.
This core is designed in Verilog and needs to be packaged in VHDL to
interface it with AMBA bus and Leon Processor.
27. AES-128 Software Pointers
27
In software, the representation of a 128-register is used using 32-bit (Integer)
pointer.
The base address of this pointer is determined by Slave bus index of the AES
Wrapper i.e. bus index for Slave (HINDEX=8) will be 0xFF000000 with 1-
Mbytes memory and Address (HADDR) at 16FF0.
We use 4 32-bit Write and Read Registers. For Key and Plain Text values,
HADDR(6:2) is decoded at '0000' as '0' and '1' respectively.
29. Timeline
Custom Template (with File Hierarchy) for Simulation and Synthesis March 2018
Create Custom IP June 2018
Add Interface or Wrapper August 2018
Co-Processor Extension and Software Application Sep 2018
AES Integration Oct 2018
29
Memory-Mapped Interface allocates part of the memory address (as shared memory) of Leon3 for communication between peripheral and software. It is generally more reliable and easy-to-use interface to be used for added hardware or peripheral.
Coprocessor Interface uses a dedicated port on the processor. This port is driven using a particular set of instructions, the coprocessor instructions.