Bare Metal System Software Development

Slides:



Advertisements
Similar presentations
©Brooks/Cole, 2003 Chapter 5 Computer Organization.
Advertisements

C Language Programming. C has gradually replaced assembly language in many embedded applications. Data types –C has five basic data types: void, char,
C Programming for Embedded Systems. fig_06_00 Computer Layers Low-level hardware to high-level software (4GL: “domain-specific”, report-driven, e.g.)
ECE 265 – LECTURE 9 PROGRAM DESIGN 8/12/ ECE265.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
Development. Development Environment Editor Assembler or compiler Embedded emulator/debugger IAR Embedded Workbench Kickstart Code Composer Essentials.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To be able to use the bitwise logical operators in programs ❏ To be able to use.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC Data Structures January 2012.
GBT Interface Card for a Linux Computer Carson Teale 1.
Memory Layout and SLC500™ System Addresses. Processor Memory Division An SLC 500 processor's memory is divided into two storage areas. Like two drawers.
8-1 Embedded Systems Fixed-Point Math and Other Optimizations.
1 Instruction Set Architecture (ISA) Alexander Titov 10/20/2012.
Chapter 5 Computer Organization. Distinguish between the three components of a computer hardware. List the functionality of each component. Understand.
©Brooks/Cole, 2003 Chapter 5 Computer Organization.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
The Concept of Universal Service
Bitwise Operations C includes operators that permit working with the bit-level representation of a value. You can: - shift the bits of a value to the left.
Introduction to Computing Systems
Chapter # 2 Part 2 Programs And data
Chapter Topics The Basics of a C++ Program Data Types
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Assembler Directives Code generation flow
Names and Attributes Names are a key programming language feature
CS501 Advanced Computer Architecture
Microcontrollers & GPIO
Computing Systems Organization
Chapter 6: Data Types Lectures # 10.
Microprocessor Systems Design I
The Stack Chapter 5 Lecture notes for SPARC Architecture, Assembly Language Programming and C, Richard P. Paul by Anu G. Bourgeois.
Manipulating Bit Fields in C
ECE 3430 – Intro to Microcomputer Systems
Basic Elements of C++.
Microprocessor Systems Design I
C Language VIVA Questions with Answers
Database Management Systems (CS 564)
UART and UART Driver B. Ramamurthy.
The PCI bus (Peripheral Component Interconnect ) is the most commonly used peripheral bus on desktops and bigger computers. higher-level bus architectures.
CS703 - Advanced Operating Systems
L7 – Assembler Directives
ECE 4110–5110 Digital System Design
Overview of Embedded SoC Systems
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Design Flow System Level
Basic Elements of C++ Chapter 2.
Baremetal C Programming for Embedded Systems
Lecture 16 PicoBlaze I/O & Interrupt Interface
Chapter 1 C for Embedded Systems.
Bare Metal System Software Development
FPro Bus Protocol and MMIO Slot Specification
UART and UART Driver B. Ramamurthy.
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Chapter 1 C for Embedded Systems.
Chapter 14 Bitwise Operators Objectives
Using Fpro SoC with Hardware Accelerators
Lecture 3: Main Memory.
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Introduction to Operating Systems
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Chapter # 2 Part 2 Programs And data
Data Flow Description of Combinational-Circuit Building Blocks
Introduction to Microprocessor Programming
Data Flow Description of Combinational-Circuit Building Blocks
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
C Programming Pointers
FPro Video Subsystem: VGA Frame Buffer Core
Chapter 6 –Symbolic Instruction and Addressing
A simple function.
Using FPro SoC with customized hardware cores
Using FPro SoC with customized hardware cores
Presentation transcript:

Bare Metal System Software Development ECE 448 Lecture 9 Bare Metal System Software Development ECE 448 – FPGA and ASIC Design with VHDL

Required Reading P. Chu, FPGA Prototyping by VHDL Examples Chapter 9, Bare Metal System Software Development Source Code of Examples http://academic.csuohio.edu/chu_p/rtl/fpga_mcs_vhdl.html ECE 448 – FPGA and ASIC Design with VHDL

Software Hierarchy Desktop-like system Bare Metal Systems

Basic Embedded Program Architecture

Address Map of a Simple System

I/O Register Map of a Timer Core

I/O Address Map of the FPro System The subsystem provides 64 slots to connect up to 64 (i.e., 26) I/O cores Each I/O core is allocated with 32 (i.e., 25) registers Each register is 32 bits wide (i.e., a word) The subsystem requires a memory space of 211 (i.e., 26 ∗ 25) words or 213 bytes. The 11-bit word address for the MMIO subsystem appears as sss_sssr_rrrr in which ssssss is the slot number and rrrrr is the register offset. When combined with the video subsystem, its 22-bit word address becomes 00_0000_0000_0sss_sssr_rrrr However, most I/O cores will not use all 32 registers and will not always need 32 data bits

C Pointers

C Pointer to I/O Register

Robust I/O Register Access The address assignment of the FPro system is fixed for the slots in the MMIO subsystem and various modules in the video subsystem. Only two parts may change: Bridge base address Slot assignment in the MMIO subsystem Instead of using hard literals, we express the information using symbolic constants and record them in chu_io_map.h : a C/C++ header file used for software development chu_io_map.vhd : a VHDL package declaration to be used in conjunction with hardware development

Robust I/O Register Access (cont.) The processor treats the MMIO and video subsystems as a single I/O module and communicates with the module via the bridge The bridge base address is the starting address of the module and is assigned when a system is created For the MicroBlaze MCS configuration, it is a fixed value of 0xc0000000 For an IP core attached to the MMIO subsystem, its base address can be calculated using the assigned slot number. Recall that each slot contains 32 words (128 bytes). The base address of slot n is Bridge_base_address + n ∗ 32 ∗ 4

Slot assignment of the vanilla FPro system

Slot and constant definitions in chu_io_map.h

inttypes.h C has many predefined data types, such as short, int, and long. The width (i.e., number of bits) of each data type is left to the compiler and implementation. While interacting with low-level device activities, it is often important to know the exact width and format of registers and data. To facilitate this, C provides a header file, inttypes.h, which explicitly specifies the width and format of each data type. It is good practice to use these data types for low-level coding.

Data Types in inttypes.h int8_t: signed 8-bit integer uint8_t: unsigned 8-bit integer int16_t: signed 16-bit integer uint16_t: unsigned 16-bit integer int32_t: signed 32-bit integer uint32_t: unsigned 32-bit integer int64_t: signed 64-bit integer uint64_t: unsigned 64-bit integer

I/O Macros in chu_io_rw.h

GpoCore class definition in gpio_core.h

GpoCore class implementation in gpio_core.cpp

GpiCore class definition in gpio_core.h

GpiCore class implementation in gpio_core.cpp

I/O Register Map of a Timer Core

TimerCore class definition in timer_core.h

TimerCore class implementation in timer_core.cpp

FPro utility routine declarations and macros in chu_init.h

FPro utility routine declarations and macros in chu_init.h

FPro utility routine implementation in chu_init.cpp

Vanilla FPro test program in main_vanilla_test.cpp