Lecture 1: Introduction Advanced Digital VLSI Design I Bar-Ilan University, Course 83-614 Semester B, 2021 11 March 2021 Outline

© AdamMarch Teman, 11, 2021 Introduction Section 2 Section 3 Section 4 Section 5 Conclusions

Motivation Course Motivation Snapdragon??? • How many of you understand this recent news item?

Snapdragon 710I mobilethought platform so… (SDM710) specifications: • CPU – 8x Qualcomm 360 CPU @ up to 2.2 GHz (in two clusters) • GPU – Qualcomm 616, DirectX 12 • DSP – 680 • Memory I/F – LPDDR4x, 2x 16-bit up to 1866MHz, • Video: H.264 (AVC), H.265 (HEVC), VP9, VP8 • Camera: Qualcomm Spectra 250 ISP • Audio – Qualcomm Aqstic & aptX audio • Cellular Connectivity–Snapdragon X15 LTE modem • Wireless : 802.11ac Wi-Fi, 5, NFC • Manufacturing 10nm LPP 4 © AdamMarch Teman, 11, 2021 Motivation •Welcome to EnICS. • To get you started on your graduate studies, let me introduce you to a wonderful invention…

• Don’t you think it’s about time you know what’s inside?

5 © AdamMarch Teman, 11, 2021 Course Objective

• To make sure that you – graduate students working on design – get to know the environment around your circuits. • Basic Terminology • Components • Systems (on a chip) • • Methodology

• And since we’re leading one of the flagship programs of the Israel Innovation Authority • I’m going to familiarize you with RISC-V

6 © AdamMarch Teman, 11, 2021 Course Syllabus

• Well, that’s a tough one… • In general, I call it “, , SoC, and Embedded ” • I’ll let you know exactly what we’re going to learn as we go along. • But some of the subjects I plan to cover include • What is an SoC • RISC-V – what, where, why, how • Concepts in Architecture • The Software Stack • The • Basic Interfaces: AMBA (AXI), UART, SPI… • Testing • Basic concepts in Operating Systems

7 © AdamMarch Teman, 11, 2021 Okay, how much work do we have to do?

• Well, this course is not a freebie! • But hopefully, you’ll get something out of it. • Are you ready? Are you sure? Really…?

• Your grade will consist of: • 60% - Homework • 10% - ISSCC paper presentation • 30% - Review Quiz

8 © AdamMarch Teman, 11, 2021 What, what, what???

• Calm down and let me explain…

• 60% = Homework • The homework will help you get your “hands on” some of the material and prepare you for a research tapeout. • We assume that many of you haven’t done or (have forgotten) the DDP course, so the exercises will be a bit of a subset of those exercises. • We will gradually build your skillset to enable you to build a hardware accelerator. • Finally, you will need to design your own accelerator.

Analog guys, don’t have a heart attack. Your project will be to deliver a custom macro!

9 © AdamMarch Teman, 11, 2021 What, what, what??? (2)

• 10% - ISSCC paper presentation • You will each choose a paper from ISSCC2021* and present it to the class. • I will put up a sign-up sheet and we will have one presentation a week • * I will consider other papers, but you will have to get my permission.

• 30% - Review Quiz • And yes, we are going to hear a lot of terminology and concepts, so at the end of the semester, there will be a quiz. • It will be on Moodle, multiple-choice style. • Hopefully, it will make you review the material and digest it!

10 © AdamMarch Teman, 11, 2021 Where do we get our homework?

• By GIT, of course!

• Udi has kindly opened a gitlab repository for you. • You will all soon get invitations to join it. • The first homework will be after Pesach, but you should start to “warm up” to GIT already!

• Recommended lecture: • The Missing Semester – Version Control: https://missing.csail.mit.edu/2020/version-control/

11 © AdamMarch Teman, 11, 2021 And some more GIT humor

© AdamMarch Teman, 11, 2021 MPU, MCU, SoC

13 Our good old friend Moore

• 1.2*1021 (1.2 sextillion) • The number of transistors in 2014! • Transistors > grains of rice harvested in 2004 • 106 times estimated number of ants on earth

Source: Raghunathan, ECE 695R © AdamMarch Teman, 11, 2021 What do we do with all the transistors?

• Scaling option #1 (component-driven scaling) • Microprocessors, GPUs • Pre-2005: Deeper pipelines, more complex logic for instruction-level parallelism, more • 2005- : More cores, more cache • Memory chips • Easy – just keep increasing capacity • Scaling option #2 (system-driven scaling) • Integrate more and more system Source: Raghunathan, ECE 695R functions onto a chip

15 © AdamMarch Teman, 11, 2021 MPU, MCU, SoC

(MPU) • A computer where the processing logic and control is included on a single .

4-bit 4004 Bellmac 32 AMD Opteron First monolithic First 32-bit First 64-bit microprocessor microprocessor microprocessor© AdamMarch Teman, 11, 2021 MPU, MCU, SoC (2)

(MCU) • A microcontroller is a small computer on a single integrated circuit chip. • A microcontroller contains one or more CPUs along with memory and programmable input/output .

TI TMS-1000 PIC Microcontroller ATmega328P First high-volume Over 12B parts sold The chip at the heart of microcontroller (2013) the Uno

17 © AdamMarch Teman, 11, 2021 MPU, MCU, SoC (3)

(SoC) • A system on a chip is an integrated circuit that integrates all or most components of a computer or other electronic system. • An SoC integrates an MCU, MPU or perhaps several processor cores with peripherals like a GPU, Wi-Fi and radio modems, and/or one or more – all on a single substrate or microchip. • An SoC can be seen as integrating an MCU with more advanced peripherals.

Intel 5810 AMD286ZX/LX First SoC (1974) First Largescale SoC First Mac 18 © AdamMarch Teman, 11, 2021 From Microprocessor to Microcontroller

Source: Mohit Arora

19 © AdamMarch Teman, 11, 2021 To System-on-Chip

Source: Greaves, U. Cambridge 20 © AdamMarch Teman, 11, 2021 Embedded Systems

21 Embedded Systems

• An is combination of and software that is specifically designed for a particular function. • “Loosely defined, it is any device that includes a programmable computer but is not itself intended to be a general purpose computer” by W. Wolf • “An embedded computer system includes a with mechanical, chemical and electrical devices attached to it, programmed for a specific dedicated purpose, and packaged as a complete system” by J. Valvano • “Embedded Systems are the electronic systems that contain a microprocessor or a microcontroller, but we do not think of them as – the computer is hidden or embedded in the system.” by T. Morton • A cyber-physical system is one that combines physical devices, known as the plant, with computers that control the plant. • The embedded computer is the cyber-part of the cyber-physical system. 22 © AdamMarch Teman, 11, 2021 Embedded Systems (2)

• An embedded system is designed to handle a particular . • e.g, washing machines, electronic shavers, Digital TV, digital cameras, air-conditioning etc. • However, some embedded devices may perform variety of functions. • such as a , Digital TV etc.

Source: Mohit Arora 23 © AdamMarch Teman, 11, 2021 General vs. Embedded Computer System • General Computer System • Embedded Computer System • Microprocessor • Hardware that includes the core • Large Primary Memory and necessary I/O for a specific (RAM, ROM, Cache) function. • Large Secondary Memory • Embeds main application (HDD, SSD, DVD) software into embedded Flash. • (OS) • Embeds a real time operating • General purpose user system (RTOS) which interfaces and supervises the application software. application software tasks running on the hardware.

24 © AdamMarch Teman, 11, 2021 Embedded System Characteristics

• Limited hardware and software functionality • Limited performance, reduced consumption, memory, hardware functionality • Limited real-time operating system (RTOS) or even no OS (“Bare Metal”) and scaled-down applications • Custom designed for a dedicated function • Primarily designed for one specific function • High quality and reliability • Some embedded devices are highly reliable and can work for long operation hours without failure • Sophisticated functionality • Some embedded systems require running complex and providing a fancy

25 © AdamMarch Teman, 11, 2021 Embedded System Characteristics (2)

• Low and real time operation • Many embedded computing systems have to perform in real time – if the data isn’t ready by a certain deadline, the system breaks. • Some functions require low latency for quality of service • Multirate support • Several real-time activities may be going on at the same time. • They may simultaneously control some operations that run at slow rates and others that run at high rates (e.g., audio vs. video) • System Costs • Low manufacturing cost • Low power and energy budgets

26 © AdamMarch Teman, 11, 2021 Embedded System Example #1

• Air Conditioning System

Source: Mohit Arora 27 © AdamMarch Teman, 11, 2021 Embedded System Example #2

• Portable Music Player

28 Source: Mohit Arora © AdamMarch Teman, 11, 2021 3.8 V, 25 Watt- Capacitive multitouch hour battery Example #3 LCD screen

• Let’s look inside an Apple iPad 2: 10.1mm

4X GPU Source: P&H, Chapter 1

Computer board 12.1mm 2X ARM Core @1GHz

DDR Interface 29 45nm SoC 32GB Flash Apple A5 SoC © AdamMarch Teman, 11, 2021 Components of Embedded Systems

30 A Typical Embedded Microcontroller

• Embedded Processor • Embedded Memory • Peripherals and I/Os • and Watchdog • and Analog • Interrupt Controller • Clocking and Reset • Additional Application Specific

31 © AdamMarch Teman, 11, 2021 Components of Embedded Hardware

• Embedded Processor • Optimized for general purpose use • Lower functionality and performance than desktop processor • Runs software (RTOS) • Master of transactions • Embedded Memory Source: Greaves, U. Cambridge • Low access time and high density • ROM as primary bootloader (preprogrammed) • RAM (volatile) to store transient input or output data • Usually no secondary storage (HDD) • Code size is important!

32 © AdamMarch Teman, 11, 2021 Components of Embedded Hardware (2)

• Communication Buses • Multiple Masters/Slaves • Multiplexing address/data • Arbitration • High Speed/Low Speed/Bridge

• DMA Controller Source: Greaves, U. Cambridge • Offload memory access from CPU by becoming a bus master • Allows continuing CPU operation during long bus transfers

33 © AdamMarch Teman, 11, 2021 Components of Embedded Hardware (3) • Peripherals and I/Os • Peripherals are I/O devices connected to the serial and parallel ports. • Communicates through common interface protocols (e.g., UART, SPI, I2C). • General Purpose Input/Output Pins • Timers and Watchdog • Various timers for counts internal Source: Greaves, U. Cambridge clock pulses or external events • Interrupts the processor on a certain count value • “Watchdog ” is used to detect and recover from code runaway or other malfunctions • Sensors and Analog • e.g., temperature , Digital to Analog converter, Analog to Digital Converter, Operational Amplifiers 34 © AdamMarch Teman, 11, 2021 Components of Embedded Hardware (4)

• Interrupt Controller • Real Time operation requires interrupt support • Low latency and fast response to an interrupt event. • Clocking and Reset • External crystal reference • Internal phase-locked loop (PLL) • Power-on-Reset (POR) circuitry • Power Management: • Power supply • Support variety of power modes • Always-on peripherals (e.g., RTC)

Source: Greaves, U. Cambridge 35 © AdamMarch Teman, 11, 2021 Application Software and RTOS

• Features of : • Program code resides in embedded Flash or ROM. (no secondary storage) • Storage space for variables is allocated in the RAM. • Programs should execute continuously (do not call “exit” function) • Should be capable of handling all possible exceptional conditions. • RTOS (real-time operating system) • Scheduler that manages the execution of multiple tasks • Should schedule tasks and interrupt service routines such that they are completed within their deadlines • Sets the rules during execution of application processes to enable finishing of a process within the assigned time interval and with assigned priority. • Provides semaphores to prevent multiple tasks from simultaneously writing into • Shared memory.

37 © AdamMarch Teman, 11, 2021 Summary

• Today, we discussed the definition of different categories of computing hardware: • Microprocessors • Microcontrollers • System on a Chip • General Purpose Computers • Embedded Systems • And we took a brief look at the components of an embedded computing system.

• From here on, we will go deeper into these components and how they communicate and work together.

38 © AdamMarch Teman, 11, 2021 Main References

• Arora, “Embedded System Design - Introduction to SoC System Architecture,” Learning Bytes Publishing 2016 • Chakravarthi, “A Practical Approach to VLSI System on Chip (SoC) Design,” Springer 2020 • Wolf, “Computer as Components - Principles of Embedded Computing System Design,” Elsevier 2012 • Anand Raghunathan, Purdue ECE 695R: System-on-Chip Design • https://nanohub.org/courses/ECE695R/o1a • David Greaves, Cambridge: SoC Design and Modeling • Patterson, Hennessy “Computer Organization and Design – The RISC-V Edition”

© AdamMarch Teman, 11, 2021