SlideShare a Scribd company logo
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Master’s Research Project 2009
1
CONTROL
UNIT
ADRESS
CAL-CIRCUIT
REG
BLOCK
ALU
Pre-Fetch UNIT Memory Access Unit
CPU12
Presented by: Ibrahim Hazmi
Supervised by: Dr. Paul Beckett
HC12 Micro-controller Design Using VHDL
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE BLACK BOXES
2
CONTROL
UNIT
ADRESS
CAL-CIRCUIT
REG
BLOCK
ALU
Pre-Fetch UNIT Memory Access Unit
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE BLACK BOXES
3
CONTROL
UNIT
ADRESS
CAL-CIRCUIT
ALU
Pre-Fetch UNIT Memory Access Unit
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE BLACK BOXES
4
CONTROL
UNIT
ADRESS
CAL-CIRCUIT
Pre-Fetch UNIT Memory Access Unit
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE BLACK BOXES
5
CONTROL
UNIT
Pre-Fetch UNIT Memory Access Unit
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE BLACK BOXES
6
Pre-Fetch UNIT Memory Access Unit
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE BLACK BOXES
7
Memory Access Unit
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE BLACK BOXES
8
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Introduction : What I am doing
I am Re-designing or Re-Engineering an existing
microcontroller in order to gain the following:
1. Practical and Detailed Understanding of Embedded
System Design
2. Combining the Understanding of the Embedded System
with the skills in HDL Design
3. HC12 is a microcontroller which has everything inside,
so it is worth it to start with.
4. According to my knowledge, HC12 is not available to the
public as a VHDL code, so it is great if we could make it
available for academic and research purposes.
I am Re-Designing the CPU12, the Heart of the HC12
(Block Diagram of HC12, MCU12, CPU12 – Black)
For Me CPU12 was a black box let us see how I’ve
imagined that Black Box?
9
Wednesday 01/07/2009 10IBRAHIM HAZMI - SECE
• AT the Beginning, I was taking every
part of Micro as a separate part and
design it without any guidelines except
its functionality, which was bringing
difficulty to join all parts together at the
end. Also it was leading me to put
unnecessary circuits into it.
• In this project, I’ve learnt a good
methodology in designing a
microprocessor:
• I need to thank Two Ideas in this regard:
Methodology
Wednesday 01/07/2009
Wednesday 01/07/2009 11IBRAHIM HAZMI - SECE
• 1st:
“In designing a CPU, we must first define its instruction set,
and how the instructions are encoded and executed. We need
to answer questions such as how many instructions do we
want? What are the instructions? What operation code
(opcode) do we assign to each of the instructions? How many
bits do we use to encode an instruction? Once we have
decided on the instruction set, we can proceed to designing a
datapath that can execute all the instructions in the instruction
set. In this step we are creating a custom datapath, so we
need to answer questions such as what functional units do we
need? How many registers do we need? Do we use a single
register file or separate registers? How are the different units
connected together?”
Enoch O. Hwang, 2005, Digital Logic and Microprocessor Design With VHDL, La Sierra University, Riverside
This Quote was my leader to understand how to start when
designing a microprocessor. Dr Hwang From in USA
Methodology
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
2nd: Partitioning
I was thinking of designing everything at a time
and that waste most of my time. I was ending
usually with disappointing. Mr. Paul, my
supervisor, was behind the idea of partitioning in
which I started design CPU12 block by block
considering the relations between all blocks and
the target instruction set.
Methodology
12
What I have achieved:
Imagined a block Diagram of the whole Design and
partitioned it to 5 Main Blocks
Designed and coded Data Path. (all ALU REG Blocks)
Designed some parts of the Control Unit (CU).
Put the main parts of the Pre-Fetch Unit (PFU).
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
REGISTERs BLOCK
13
R_Block
CLK
Accin Accout
A(D_High)
D
B (D_Low)
XI
CC
16
RA
RB
RCC
RSP
RXI
RYI
RPC
8
8
RD
8
8
16
16 16
88
1616
YI
1616
SP
1616
PC
1616
CLR
CLR
Ld
Ld
Ld
Ld
Ld
Ld
En
A
L
U
B
A
L
U
A
ALU
BUS
CAL_CC
R
CU_CCR
R
EL
ALU
BUS-MUX
PC+1/+2
ADDMUX
ALU
CLRA
CLRB
LdA
LdB
LdX
LdY
LdSP
LdC
CLdP
C
MACC
MX
MY
MSP
MCC
MPC
MOUT1
MOUT2
00000000C
C
BUS
LALU
L
ALU
BUS-MUX
CTRLUNI
T
ADDM
UX
BUS-MUX
ALU
MI1
MI2
MO1
MO2
MAB
M0F
INC_1_
2
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
REGISTERs BLOCK
14
D
A B
MUXAcc
BUSALU
RMUX1
RMU
X2
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
REGISTERs BLOCK
15
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
REGISTERs BLOCK
16
IXH IXL IYH IYL SPH SPL
Internal Data Bus
CCR
BMUX
A B
BA
ALU
All Arithmetic and Logic Operations + Pre/Post
Increment/decrement + CCR Check!
RMUX2RMUX1
BUS-MUX
PC
H
PC
L
PCMUX
+1/+2
MUXIX MUXSPMUXIY MUXAcc
AMUX
MUXCC
Pre/Post
Imm
Address C
C
C
U
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
ACCUMULATOR
17
Internal System Bus
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
REGISTERS AND ALU
18
ALU
A B
D
MAR MDR
PC
IR
1
6
1
6
ADDR15:0 DATA15:0
T
Program
Counter
Instruction
Register
Memory Data
Register
Memory Address
Register
Arithmetic Logic
Unit
Temporary
Register
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
REGISTERS AND ALU
19
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE CONTROL UNIT: Decoding
20
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THE CONTROL UNIT: FSM
21
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
SIMULATIONS
22
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Timing Simulation - REG
23
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Timing Simulation - ALU
24
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Immediate (0000) and Direct(0001)
25
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Extended(0010) & Indexed(0011)
26
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
IDX1 — 9-bit signed (0100)
27
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
IDX2 — 16-bit signed (0101)
28
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Pre/post 10_inc/dec (0110)
29
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Accumulator A Offset (0111)
30
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Accumulator B Offset(1000)
31
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
[D, IDX] - Indexed-indirect; Acc D offset (1011)
32
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
[IDX2]—IDX-IND; 16-bit (1010)
33
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
INH — Inherent; no_op (1100)
34
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Conclusion
• As a designer, the first thing I have defined
at the beginning of the design was
Partitioning
• Then started with the simplest in order to
improve the Design based on thinking,
reading and people additions.
• The Design was simply two main parts: Data
Path and Control Unit, including the address
calculation unit and memory interface.
35
CONTINUE
•Design PFU (Pre-Fetch Unit), Finish CU
(Control Unit) and connect them to Data Path.
Future Work
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Conclusion - Detailes
Based on the work that has been done on the design of the CPU12:
The objective of the Project was to design the two units of the CPU12, (Data
Path and Control Unit), individually then combine them together to run a
simple sequence of instructions.
Additional challenge was to make the design as structural as it possible, and
that has been satisfied for the Data Path Unit whereas Control unit was
designed as a state machine which is totally in behavioural Level.
There were many trials to come out with final Data Path Unit circuits. For
instance, the Register block has been designed several times and in different
considerations.
The answer to the question: What is the first thing I should know in doing such
design was the key of the understanding and imagination of what id going on.
It leads, at then end, to draw a reasonable block diagram that meets the
requirements.
The Idea of Partitioning was behind the ability to design CPU12 block by block
considering the relations between all blocks and the targeted instruction set.
During my work in this design, I’ve got the Idea of starting with the simplest
then improve the Design based on thinking, reading and people additions.
I’ve gained a good understanding of how embedded systems work, how to
manage a microcontroller processes and how to connect its parts together in
order to run a simple code.
36
Wednesday 01/07/2009 37IBRAHIM HAZMI - SECE
“The "immediate" operands are the part of
instruction, so it's the loaded into instruction
queue by fetching unit. Other operands have to
be read during execution of instruction. These
operands cannot be loaded directly by fetching
unit because the operands may be changed
while the instruction is waiting in queue.”
POINT OF DISCUSSION
My question is about the fetch unit - including the
Instruction queue - is it the only way that CPU12
speaks to memory or the CPU12 accesses memory
directly when it gets the instruction's operands?
I'm bit confused!
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
Thing need to be checked
• Make sure that the operations on CCR affect New-CCR
correctly.
• Shift - Memory against Accumulators A and D.
• Could some operations be done inside the Accumulators?
(Inc/Dec/Sh)?
• Do All Shifts need to be done through ALU because there
are some shifts on Memory Data.
• Transfer? TFR abcdxys,abcdxys /Load and Store paths?
• Apply Max/Min function using Comparator signals?
• A Swap B is done through the Accumulators Circuit.
• What happen if a Register is incremented from FFFF to be
0000? Carry?
• Check the functionality of the Divider!
38
Done in the Final submission!
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
References
1. Enoch O. Hwang, 2005, Digital Logic and Microprocessor Design With VHDL, La Sierra University, Riverside,
USA.
2. Altera Co, 2009, AN 311: Standard Cell ASIC to FPGA Design, Methodology and Guidelines
3. E. Ostúa, J. Juan Chico, J. Viejo, M. J. Bellido, D. Guerrero, A. Millán & P. Ruiz-de-Clavijo, AN SOC DESIGN
METHODOLOGY FOR LEON2 ON FPGA, Universidad de Sevilla.
4. Volnei A. Pedroni, 2004, Circuit Design with VHDL, MIT Press, Cambridge, Massachusetts, London, England
5. PONG P. CHU, 2006, RTL HARDWARE DESIGN USING VHDL, Cleveland State University, WlLEY
INTERSCIENCE.
6. Peter J. Ashenden, 1990, The VHDL Cookbook, Dept. Computer Science, University of Adelaide, SA, 1ST
Edition
7. M. Morris Mano, 1993, Computer System Architecture, 3rd Edition, Prentice Hall Int.
8. Digitaaltehnika erikursus, Digital Design Methodology
9. Freescale Semiconductor, 2006, CPU12 Reference Manual (CPU12RM); Motorola M68HC12 and HCS12
Microcontrollers, Rev. 4.0
10. HC11: http://online.sfsu.edu/~valverde/ENGR/ENGR478_s07/welcome.htm, Dr. Ricardo V., 2004, Lecture
Notes; ENGR 478,
11. LC3: http://www.et.byu.edu/groups/ece224web/lectures/LC3-2.pdf, 20/07/2009
12. http://www.eng.auburn.edu/~nelson/, 13/03/2009.
13. http://oucsace.cs.ohiou.edu/~avinashk/, 13/03/2009.
14. http://cs.lasierra.edu/~ehwang/mybook/toc.html, 13/03/2009.
15. http://lap2.epfl.ch/courses/archord1/, 13/03/2009.
16. http://www.ece.tamu.edu/~vinith/ecen248/index_files/lab_manual_spring09.pdf, 13/03/2009
17. http://www.eda-stds.org/rassp/, 13/03/2009.
18. http://vlsi.ee.hacettepe.edu.tr/links.html, 13/03/2009.
19. Reto Z., 1999, Lecture notes on Computer Arithmetic: Principles, Architectures, and VLSI Design, Integrated
Systems Laboratory, Swiss Federal Institute of Technology (ETH), Switzerland.
39
Wednesday 01/07/2009IBRAHIM HAZMI - SECE
THANK YOU
40

More Related Content

What's hot

Analog, IO Test Chip Validation
Analog,  IO Test Chip  ValidationAnalog,  IO Test Chip  Validation
Analog, IO Test Chip ValidationSMIT A. PATEL
 
Fpga Knowledge
Fpga KnowledgeFpga Knowledge
Fpga Knowledge
ranvirsingh
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-scheduling
Hesham Elmasry
 
Fpga optimus main_print
Fpga optimus  main_printFpga optimus  main_print
Fpga optimus main_printSushant Burde
 
Conditional branches
Conditional branchesConditional branches
Conditional branches
Dilip Mathuria
 
eTPU to GTM Migration Presentation
eTPU to GTM Migration PresentationeTPU to GTM Migration Presentation
eTPU to GTM Migration Presentation
Parker Mosman
 
SFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress UpdateSFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress Update
Linaro
 
Cpld fpga
Cpld fpgaCpld fpga
Cpld fpga
anishgoel
 
Complete ASIC design flow - VLSI UNIVERSE
Complete ASIC design flow - VLSI UNIVERSEComplete ASIC design flow - VLSI UNIVERSE
Complete ASIC design flow - VLSI UNIVERSE
VLSIUNIVERSE
 
FPGA
FPGAFPGA
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
Linaro
 
Logic synthesis with synopsys design compiler
Logic synthesis with synopsys design compilerLogic synthesis with synopsys design compiler
Logic synthesis with synopsys design compilernaeemtayyab
 
Timing closure document
Timing closure documentTiming closure document
Timing closure documentAlan Tran
 
Ch1 introduction os
Ch1 introduction osCh1 introduction os
Ch1 introduction os
Syaiful Ahdan
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
Rajan Kumar
 
Ch2.1 computer system structures
Ch2.1 computer system structures Ch2.1 computer system structures
Ch2.1 computer system structures
Syaiful Ahdan
 
eTPU to GTM Migration
eTPU to GTM MigrationeTPU to GTM Migration
eTPU to GTM Migration
Parker Mosman
 

What's hot (20)

Analog, IO Test Chip Validation
Analog,  IO Test Chip  ValidationAnalog,  IO Test Chip  Validation
Analog, IO Test Chip Validation
 
Fpga Knowledge
Fpga KnowledgeFpga Knowledge
Fpga Knowledge
 
Module 3-cpu-scheduling
Module 3-cpu-schedulingModule 3-cpu-scheduling
Module 3-cpu-scheduling
 
Fpga optimus main_print
Fpga optimus  main_printFpga optimus  main_print
Fpga optimus main_print
 
FIFOPt
FIFOPtFIFOPt
FIFOPt
 
Conditional branches
Conditional branchesConditional branches
Conditional branches
 
eTPU to GTM Migration Presentation
eTPU to GTM Migration PresentationeTPU to GTM Migration Presentation
eTPU to GTM Migration Presentation
 
SFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress UpdateSFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress Update
 
Cpld fpga
Cpld fpgaCpld fpga
Cpld fpga
 
Fpga technology
Fpga technologyFpga technology
Fpga technology
 
Complete ASIC design flow - VLSI UNIVERSE
Complete ASIC design flow - VLSI UNIVERSEComplete ASIC design flow - VLSI UNIVERSE
Complete ASIC design flow - VLSI UNIVERSE
 
FPGA
FPGAFPGA
FPGA
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
 
Logic synthesis with synopsys design compiler
Logic synthesis with synopsys design compilerLogic synthesis with synopsys design compiler
Logic synthesis with synopsys design compiler
 
Timing closure document
Timing closure documentTiming closure document
Timing closure document
 
Ch1 introduction os
Ch1 introduction osCh1 introduction os
Ch1 introduction os
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
Ch2.1 computer system structures
Ch2.1 computer system structures Ch2.1 computer system structures
Ch2.1 computer system structures
 
eTPU to GTM Migration
eTPU to GTM MigrationeTPU to GTM Migration
eTPU to GTM Migration
 
Back end[1] debdeep
Back end[1]  debdeepBack end[1]  debdeep
Back end[1] debdeep
 

Similar to ResearchProject2009

Ch2 embedded processors-i
Ch2 embedded processors-iCh2 embedded processors-i
Ch2 embedded processors-i
Ankit Shah
 
Renesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal BootRenesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal Boot
andrewmurraympc
 
AMD_11th_Intl_SoC_Conf_UCI_Irvine
AMD_11th_Intl_SoC_Conf_UCI_IrvineAMD_11th_Intl_SoC_Conf_UCI_Irvine
AMD_11th_Intl_SoC_Conf_UCI_Irvine
Pankaj Singh
 
Sol linux cmg-t_1_1.pptx
Sol linux cmg-t_1_1.pptxSol linux cmg-t_1_1.pptx
Sol linux cmg-t_1_1.pptx
Bob Sneed
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noida
Edhole.com
 
unit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptxunit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptx
KandavelEee
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
Edhole.com
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
Kuniyasu Suzaki
 
Top 10 Supercomputers With Descriptive Information & Analysis
Top 10 Supercomputers With Descriptive Information & AnalysisTop 10 Supercomputers With Descriptive Information & Analysis
Top 10 Supercomputers With Descriptive Information & Analysis
NomanSiddiqui41
 
Computer organization-and-architecture-questions-and-answers
Computer organization-and-architecture-questions-and-answersComputer organization-and-architecture-questions-and-answers
Computer organization-and-architecture-questions-and-answers
appasami
 
CS6303 - Computer Architecture
CS6303 - Computer ArchitectureCS6303 - Computer Architecture
CS6303 - Computer Architecture
Sree sowdambika College of Engineering
 
TI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootTI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBoot
andrewmurraympc
 
OpenCAPI next generation accelerator
OpenCAPI next generation accelerator OpenCAPI next generation accelerator
OpenCAPI next generation accelerator
Ganesan Narayanasamy
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdf
RajMantry
 
Pipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan ChowdhuryPipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan Chowdhury
S. M. Risalat Hasan Chowdhury
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building and
cseij
 
BMC: Bare Metal Container @Open Source Summit Japan 2017
BMC: Bare Metal Container @Open Source Summit Japan 2017BMC: Bare Metal Container @Open Source Summit Japan 2017
BMC: Bare Metal Container @Open Source Summit Japan 2017
Kuniyasu Suzaki
 
Co notes3 sem
Co notes3 semCo notes3 sem
Co notes3 sem
dilshad begum
 

Similar to ResearchProject2009 (20)

Ch2 embedded processors-i
Ch2 embedded processors-iCh2 embedded processors-i
Ch2 embedded processors-i
 
Renesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal BootRenesas DevCon 2010: Starting a QT Application with Minimal Boot
Renesas DevCon 2010: Starting a QT Application with Minimal Boot
 
AMD_11th_Intl_SoC_Conf_UCI_Irvine
AMD_11th_Intl_SoC_Conf_UCI_IrvineAMD_11th_Intl_SoC_Conf_UCI_Irvine
AMD_11th_Intl_SoC_Conf_UCI_Irvine
 
Sol linux cmg-t_1_1.pptx
Sol linux cmg-t_1_1.pptxSol linux cmg-t_1_1.pptx
Sol linux cmg-t_1_1.pptx
 
Top schools in noida
Top schools in noidaTop schools in noida
Top schools in noida
 
unit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptxunit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptx
 
The Andc Cluster
The Andc ClusterThe Andc Cluster
The Andc Cluster
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
Top 10 Supercomputers With Descriptive Information & Analysis
Top 10 Supercomputers With Descriptive Information & AnalysisTop 10 Supercomputers With Descriptive Information & Analysis
Top 10 Supercomputers With Descriptive Information & Analysis
 
Computer organization-and-architecture-questions-and-answers
Computer organization-and-architecture-questions-and-answersComputer organization-and-architecture-questions-and-answers
Computer organization-and-architecture-questions-and-answers
 
CS6303 - Computer Architecture
CS6303 - Computer ArchitectureCS6303 - Computer Architecture
CS6303 - Computer Architecture
 
TI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBootTI TechDays 2010: swiftBoot
TI TechDays 2010: swiftBoot
 
OpenCAPI next generation accelerator
OpenCAPI next generation accelerator OpenCAPI next generation accelerator
OpenCAPI next generation accelerator
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdf
 
Pipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan ChowdhuryPipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan Chowdhury
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building and
 
BMC: Bare Metal Container @Open Source Summit Japan 2017
BMC: Bare Metal Container @Open Source Summit Japan 2017BMC: Bare Metal Container @Open Source Summit Japan 2017
BMC: Bare Metal Container @Open Source Summit Japan 2017
 
Co notes3 sem
Co notes3 semCo notes3 sem
Co notes3 sem
 

More from Ibrahim Hejab

PACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHazPACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHazIbrahim Hejab
 
FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014Ibrahim Hejab
 
GCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignEGCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignEIbrahim Hejab
 
ProjectResearchReport2009
ProjectResearchReport2009ProjectResearchReport2009
ProjectResearchReport2009Ibrahim Hejab
 

More from Ibrahim Hejab (9)

Mawheb7
Mawheb7Mawheb7
Mawheb7
 
Mawheb6
Mawheb6Mawheb6
Mawheb6
 
Mawheb5
Mawheb5Mawheb5
Mawheb5
 
Mawheb1
Mawheb1Mawheb1
Mawheb1
 
PACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHazPACRIM15_Presentation_iHaz
PACRIM15_Presentation_iHaz
 
FPGA_BasedGCD
FPGA_BasedGCDFPGA_BasedGCD
FPGA_BasedGCD
 
FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014FPGA_Overview_Ibr_2014
FPGA_Overview_Ibr_2014
 
GCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignEGCD-FPGA-Based-DesignE
GCD-FPGA-Based-DesignE
 
ProjectResearchReport2009
ProjectResearchReport2009ProjectResearchReport2009
ProjectResearchReport2009
 

ResearchProject2009

  • 1. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Master’s Research Project 2009 1 CONTROL UNIT ADRESS CAL-CIRCUIT REG BLOCK ALU Pre-Fetch UNIT Memory Access Unit CPU12 Presented by: Ibrahim Hazmi Supervised by: Dr. Paul Beckett HC12 Micro-controller Design Using VHDL
  • 2. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE BLACK BOXES 2 CONTROL UNIT ADRESS CAL-CIRCUIT REG BLOCK ALU Pre-Fetch UNIT Memory Access Unit
  • 3. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE BLACK BOXES 3 CONTROL UNIT ADRESS CAL-CIRCUIT ALU Pre-Fetch UNIT Memory Access Unit
  • 4. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE BLACK BOXES 4 CONTROL UNIT ADRESS CAL-CIRCUIT Pre-Fetch UNIT Memory Access Unit
  • 5. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE BLACK BOXES 5 CONTROL UNIT Pre-Fetch UNIT Memory Access Unit
  • 6. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE BLACK BOXES 6 Pre-Fetch UNIT Memory Access Unit
  • 7. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE BLACK BOXES 7 Memory Access Unit
  • 8. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE BLACK BOXES 8
  • 9. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Introduction : What I am doing I am Re-designing or Re-Engineering an existing microcontroller in order to gain the following: 1. Practical and Detailed Understanding of Embedded System Design 2. Combining the Understanding of the Embedded System with the skills in HDL Design 3. HC12 is a microcontroller which has everything inside, so it is worth it to start with. 4. According to my knowledge, HC12 is not available to the public as a VHDL code, so it is great if we could make it available for academic and research purposes. I am Re-Designing the CPU12, the Heart of the HC12 (Block Diagram of HC12, MCU12, CPU12 – Black) For Me CPU12 was a black box let us see how I’ve imagined that Black Box? 9
  • 10. Wednesday 01/07/2009 10IBRAHIM HAZMI - SECE • AT the Beginning, I was taking every part of Micro as a separate part and design it without any guidelines except its functionality, which was bringing difficulty to join all parts together at the end. Also it was leading me to put unnecessary circuits into it. • In this project, I’ve learnt a good methodology in designing a microprocessor: • I need to thank Two Ideas in this regard: Methodology Wednesday 01/07/2009
  • 11. Wednesday 01/07/2009 11IBRAHIM HAZMI - SECE • 1st: “In designing a CPU, we must first define its instruction set, and how the instructions are encoded and executed. We need to answer questions such as how many instructions do we want? What are the instructions? What operation code (opcode) do we assign to each of the instructions? How many bits do we use to encode an instruction? Once we have decided on the instruction set, we can proceed to designing a datapath that can execute all the instructions in the instruction set. In this step we are creating a custom datapath, so we need to answer questions such as what functional units do we need? How many registers do we need? Do we use a single register file or separate registers? How are the different units connected together?” Enoch O. Hwang, 2005, Digital Logic and Microprocessor Design With VHDL, La Sierra University, Riverside This Quote was my leader to understand how to start when designing a microprocessor. Dr Hwang From in USA Methodology
  • 12. Wednesday 01/07/2009IBRAHIM HAZMI - SECE 2nd: Partitioning I was thinking of designing everything at a time and that waste most of my time. I was ending usually with disappointing. Mr. Paul, my supervisor, was behind the idea of partitioning in which I started design CPU12 block by block considering the relations between all blocks and the target instruction set. Methodology 12 What I have achieved: Imagined a block Diagram of the whole Design and partitioned it to 5 Main Blocks Designed and coded Data Path. (all ALU REG Blocks) Designed some parts of the Control Unit (CU). Put the main parts of the Pre-Fetch Unit (PFU).
  • 13. Wednesday 01/07/2009IBRAHIM HAZMI - SECE REGISTERs BLOCK 13 R_Block CLK Accin Accout A(D_High) D B (D_Low) XI CC 16 RA RB RCC RSP RXI RYI RPC 8 8 RD 8 8 16 16 16 88 1616 YI 1616 SP 1616 PC 1616 CLR CLR Ld Ld Ld Ld Ld Ld En A L U B A L U A ALU BUS CAL_CC R CU_CCR R EL ALU BUS-MUX PC+1/+2 ADDMUX ALU CLRA CLRB LdA LdB LdX LdY LdSP LdC CLdP C MACC MX MY MSP MCC MPC MOUT1 MOUT2 00000000C C BUS LALU L ALU BUS-MUX CTRLUNI T ADDM UX BUS-MUX ALU MI1 MI2 MO1 MO2 MAB M0F INC_1_ 2
  • 14. Wednesday 01/07/2009IBRAHIM HAZMI - SECE REGISTERs BLOCK 14 D A B MUXAcc BUSALU RMUX1 RMU X2
  • 15. Wednesday 01/07/2009IBRAHIM HAZMI - SECE REGISTERs BLOCK 15
  • 16. Wednesday 01/07/2009IBRAHIM HAZMI - SECE REGISTERs BLOCK 16 IXH IXL IYH IYL SPH SPL Internal Data Bus CCR BMUX A B BA ALU All Arithmetic and Logic Operations + Pre/Post Increment/decrement + CCR Check! RMUX2RMUX1 BUS-MUX PC H PC L PCMUX +1/+2 MUXIX MUXSPMUXIY MUXAcc AMUX MUXCC Pre/Post Imm Address C C C U
  • 17. Wednesday 01/07/2009IBRAHIM HAZMI - SECE ACCUMULATOR 17 Internal System Bus
  • 18. Wednesday 01/07/2009IBRAHIM HAZMI - SECE REGISTERS AND ALU 18 ALU A B D MAR MDR PC IR 1 6 1 6 ADDR15:0 DATA15:0 T Program Counter Instruction Register Memory Data Register Memory Address Register Arithmetic Logic Unit Temporary Register
  • 19. Wednesday 01/07/2009IBRAHIM HAZMI - SECE REGISTERS AND ALU 19
  • 20. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE CONTROL UNIT: Decoding 20
  • 21. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THE CONTROL UNIT: FSM 21
  • 22. Wednesday 01/07/2009IBRAHIM HAZMI - SECE SIMULATIONS 22
  • 23. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Timing Simulation - REG 23
  • 24. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Timing Simulation - ALU 24
  • 25. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Immediate (0000) and Direct(0001) 25
  • 26. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Extended(0010) & Indexed(0011) 26
  • 27. Wednesday 01/07/2009IBRAHIM HAZMI - SECE IDX1 — 9-bit signed (0100) 27
  • 28. Wednesday 01/07/2009IBRAHIM HAZMI - SECE IDX2 — 16-bit signed (0101) 28
  • 29. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Pre/post 10_inc/dec (0110) 29
  • 30. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Accumulator A Offset (0111) 30
  • 31. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Accumulator B Offset(1000) 31
  • 32. Wednesday 01/07/2009IBRAHIM HAZMI - SECE [D, IDX] - Indexed-indirect; Acc D offset (1011) 32
  • 33. Wednesday 01/07/2009IBRAHIM HAZMI - SECE [IDX2]—IDX-IND; 16-bit (1010) 33
  • 34. Wednesday 01/07/2009IBRAHIM HAZMI - SECE INH — Inherent; no_op (1100) 34
  • 35. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Conclusion • As a designer, the first thing I have defined at the beginning of the design was Partitioning • Then started with the simplest in order to improve the Design based on thinking, reading and people additions. • The Design was simply two main parts: Data Path and Control Unit, including the address calculation unit and memory interface. 35 CONTINUE •Design PFU (Pre-Fetch Unit), Finish CU (Control Unit) and connect them to Data Path. Future Work
  • 36. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Conclusion - Detailes Based on the work that has been done on the design of the CPU12: The objective of the Project was to design the two units of the CPU12, (Data Path and Control Unit), individually then combine them together to run a simple sequence of instructions. Additional challenge was to make the design as structural as it possible, and that has been satisfied for the Data Path Unit whereas Control unit was designed as a state machine which is totally in behavioural Level. There were many trials to come out with final Data Path Unit circuits. For instance, the Register block has been designed several times and in different considerations. The answer to the question: What is the first thing I should know in doing such design was the key of the understanding and imagination of what id going on. It leads, at then end, to draw a reasonable block diagram that meets the requirements. The Idea of Partitioning was behind the ability to design CPU12 block by block considering the relations between all blocks and the targeted instruction set. During my work in this design, I’ve got the Idea of starting with the simplest then improve the Design based on thinking, reading and people additions. I’ve gained a good understanding of how embedded systems work, how to manage a microcontroller processes and how to connect its parts together in order to run a simple code. 36
  • 37. Wednesday 01/07/2009 37IBRAHIM HAZMI - SECE “The "immediate" operands are the part of instruction, so it's the loaded into instruction queue by fetching unit. Other operands have to be read during execution of instruction. These operands cannot be loaded directly by fetching unit because the operands may be changed while the instruction is waiting in queue.” POINT OF DISCUSSION My question is about the fetch unit - including the Instruction queue - is it the only way that CPU12 speaks to memory or the CPU12 accesses memory directly when it gets the instruction's operands? I'm bit confused!
  • 38. Wednesday 01/07/2009IBRAHIM HAZMI - SECE Thing need to be checked • Make sure that the operations on CCR affect New-CCR correctly. • Shift - Memory against Accumulators A and D. • Could some operations be done inside the Accumulators? (Inc/Dec/Sh)? • Do All Shifts need to be done through ALU because there are some shifts on Memory Data. • Transfer? TFR abcdxys,abcdxys /Load and Store paths? • Apply Max/Min function using Comparator signals? • A Swap B is done through the Accumulators Circuit. • What happen if a Register is incremented from FFFF to be 0000? Carry? • Check the functionality of the Divider! 38 Done in the Final submission!
  • 39. Wednesday 01/07/2009IBRAHIM HAZMI - SECE References 1. Enoch O. Hwang, 2005, Digital Logic and Microprocessor Design With VHDL, La Sierra University, Riverside, USA. 2. Altera Co, 2009, AN 311: Standard Cell ASIC to FPGA Design, Methodology and Guidelines 3. E. Ostúa, J. Juan Chico, J. Viejo, M. J. Bellido, D. Guerrero, A. Millán & P. Ruiz-de-Clavijo, AN SOC DESIGN METHODOLOGY FOR LEON2 ON FPGA, Universidad de Sevilla. 4. Volnei A. Pedroni, 2004, Circuit Design with VHDL, MIT Press, Cambridge, Massachusetts, London, England 5. PONG P. CHU, 2006, RTL HARDWARE DESIGN USING VHDL, Cleveland State University, WlLEY INTERSCIENCE. 6. Peter J. Ashenden, 1990, The VHDL Cookbook, Dept. Computer Science, University of Adelaide, SA, 1ST Edition 7. M. Morris Mano, 1993, Computer System Architecture, 3rd Edition, Prentice Hall Int. 8. Digitaaltehnika erikursus, Digital Design Methodology 9. Freescale Semiconductor, 2006, CPU12 Reference Manual (CPU12RM); Motorola M68HC12 and HCS12 Microcontrollers, Rev. 4.0 10. HC11: http://online.sfsu.edu/~valverde/ENGR/ENGR478_s07/welcome.htm, Dr. Ricardo V., 2004, Lecture Notes; ENGR 478, 11. LC3: http://www.et.byu.edu/groups/ece224web/lectures/LC3-2.pdf, 20/07/2009 12. http://www.eng.auburn.edu/~nelson/, 13/03/2009. 13. http://oucsace.cs.ohiou.edu/~avinashk/, 13/03/2009. 14. http://cs.lasierra.edu/~ehwang/mybook/toc.html, 13/03/2009. 15. http://lap2.epfl.ch/courses/archord1/, 13/03/2009. 16. http://www.ece.tamu.edu/~vinith/ecen248/index_files/lab_manual_spring09.pdf, 13/03/2009 17. http://www.eda-stds.org/rassp/, 13/03/2009. 18. http://vlsi.ee.hacettepe.edu.tr/links.html, 13/03/2009. 19. Reto Z., 1999, Lecture notes on Computer Arithmetic: Principles, Architectures, and VLSI Design, Integrated Systems Laboratory, Swiss Federal Institute of Technology (ETH), Switzerland. 39
  • 40. Wednesday 01/07/2009IBRAHIM HAZMI - SECE THANK YOU 40