System Architecture Designer – Chapter 16 Embedded System Architecture Design Theory and Practice

This chapter has many key points, with application technology accounting for approximately 25 points.

16.1 Overview of Embedded Systems

Embedded systems are computer systems specifically built for particular applications.

16.1.1 Development History of Embedded Systems

  • First Stage: Single-Chip Microcomputer (SCM) stage, which is the era of microcontrollers. The hardware is the microcontroller, and the software remains in a non-operating system stage, using assembly language. The main characteristics are: the system structure and functions are relatively simple, processing efficiency is low, storage capacity is very limited, and there is almost no user interface.

  • Second Stage: Microcontroller (MCU) stage, continuously expanding various peripheral circuits and interface circuits required by the object system, highlighting its intelligent control capabilities. The main characteristics are that the hardware uses embedded microprocessors, there are various types of microprocessors, generality is relatively weak, system overhead is small, and efficiency is high.

  • Third Stage: System on Chip (SoC), the main characteristics are: embedded systems can run on various types of microprocessors, compatibility is good, the operating system kernel is small, and efficiency is high.

  • Fourth Stage: Internet-based embedded systems, mainly reflected in two aspects: on one hand, embedded processors integrate network interfaces, and on the other hand, embedded devices are applied in network environments.

  • Fifth Stage: Embedded systems driven by intelligence and cloud technology. Its characteristics include low power consumption, high speed, high integration, high reliability, and wide applicability. At this time, embedded systems develop in two directions: one is towards end-to-end system micro-sensor devices, and the other is towards intelligent service devices.

16.1.2 Hardware Architecture of Embedded Systems

1. Components

  • Embedded Microprocessor: Controller MCU

  • Memory: RAM/ROM

  • Internal (External) Bus Logic

  • Timer/Counters

  • Watchdog Circuit

  • I/O Interfaces: Serial, Network, USB, JTAG, etc.

  • External Devices: UART, LED

2. Embedded Microprocessors

  • Embedded Microcontroller MCU: Also known as a microcontroller, it integrates ROM/EPROM, RAM, bus, bus logic, timer/counters, watchdog, I/O, serial ports, PWM output, A/D, D/A, Flash RAM, EEPROM, etc.

  • Embedded Microprocessor MPU: A microprocessor mounted on a specially designed circuit board, retaining only the motherboard functions related to embedded applications, commonly including ARM, MIPS, POWER PC.

  • Embedded Digital Signal Processor DSP: Suitable for large computations.

  • Graphics Processing Unit GPU: Semiconductor chips capable of rendering 3D graphics and other images.

  • Embedded System on Chip SoC: Integrated circuits for specific purposes, where most of the embedded system can be integrated into one or a few chips, except for a few devices that cannot be integrated.

3. Memory

  • RAM: Random Access Memory, requires continuous power supply; once the system is powered off, all data and programs stored in it will be automatically cleared and cannot be recovered.

    • DRAM: Dynamic Random Access Memory, relatively inexpensive, usually used as the main memory in computers.

    • SRAM: Static Random Access Memory, faster and more stable processing speed, often used as cache.

    • VRAM: Video RAM, outputs video data from the graphics card to the digital-to-analog converter, commonly used in high-end graphics cards.

    • FPM DRAM: Fast Page Mode Dynamic Random Access Memory, an improved version of DRAM, mostly in 72Pin or 30Pin modules.

    • EDO DRAM: Extended Data Out Dynamic Random Access Memory, generally in 72Pin or 168Pin modules.

    • BEDO DRAM: Burst Extended Data Out Dynamic Random Access Memory, an improved version of EDO DRAM.

    • MDRAM: Multi-Bank Dynamic Random Access Memory, generally used in high-speed display cards or accelerator cards, with a few motherboards used for L2 cache.

    • WRAM: Window Random Access Memory, an improved version of VRAM, applicable in professional graphics work.

    • RDRAM: Rambus Dynamic Random Access Memory, generally used in professional graphics accelerator cards or video memory in game consoles.

    • SDRAM: Synchronous Dynamic Random Access Memory, a memory mode synchronized with the external clock of the CPU.

    • SGRAM: Synchronous Graphics Random Access Memory, an improved version of SDRAM.

    • SB SRAM: Synchronous Burst Static Random Access Memory.

    • PB SRAM: Pipelined Burst Static Random Access Memory.

    • DDR SDRAM: Double Data Rate Synchronous Dynamic Random Access Memory, as a successor to SDRAM, it has two main features: first, it is twice as fast as SDRAM; second, it uses DLL to provide a data filtering signal.

    • SLDRAM: Synchronous Link Dynamic Random Access Memory.

    • CDRAM: Cache Dynamic Random Access Memory, used as a secondary cache.

    • DDRⅡ: Second Generation Double Data Rate Synchronous Dynamic Random Access Memory.

    • DRDRAM:

  • ROM: Read-Only Memory, under normal working conditions, the code and data within it will be permanently saved and cannot be modified.

    • MASK ROM: Masked Read-Only Memory, relatively low cost.

    • PROM: Programmable Read-Only Memory, can only be written once.

    • EPROM: Erasable Programmable Read-Only Memory, has an erasing function, and can be reprogrammed after erasure.

    • EEPROM: Electrically Erasable Programmable Read-Only Memory, functions and usage are similar to EPROM, but differs in the method of data erasure, which is done at about 20V.

    • Flash Memory: Flash memory, allows modification of content without removing the IC, and data stored in it will not be lost when the power is turned off.

4. Internal (External) Bus Logic

  • On-chip Bus: Internal bus of the CPU chip, used to connect various components within the chip, such as ALU registers and instruction components.

  • System Bus: Internal bus of the computer, which is the main component connecting the computer system. For example, the bus connecting the CPU main memory and I/O interfaces. The system bus is also known as the board-level bus or internal bus.

  • Local Bus: Internal bus of the computer, usually refers to the bus for exchanging data between a small number of components, such as the bus from the CPU to the Northbridge, and the bus from memory to the Northbridge. In simpler computer systems, the local bus and system bus are the same bus.

  • Communication Bus: External bus of the embedded system host, used to connect external input/output devices or other different computer systems. The communication bus is also known as the external bus or peripheral bus.

5. Watchdog Circuit

The watchdog circuit is a system recovery capability that embedded systems must possess. The basic function of the watchdog circuit is to restart the system after a software issue or program crash occurs. The basic principle is that the watchdog counter counts automatically when functioning normally, and the program flow periodically resets it. If the system hangs or crashes at some point, the timer will overflow and enter interrupt handling, allowing the system to retain critical data within a set time interval before resetting and restarting.

16.1.3 Overview of Embedded Software Architecture

The GOA architecture actually provides a framework aimed at solving issues such as the openness of embedded systems and software portability. The main characteristics of the GOA architecture are as follows:

  • Portability

  • Interoperability

  • Scalability

  • Accessibility

16.2 Principles and Features of Embedded System Software Architecture

16.2.1 Two Typical Embedded System Architecture Patterns

Architectures can be divided into: hierarchical pattern architecture and recursive pattern architecture.

1. Hierarchical Pattern Architecture

The main design idea of hierarchical pattern architecture:

  • When a system has high-level abstractions, these abstractions are represented by abstract concepts, and these abstract concepts need to be implemented by specific low-level concepts, a hierarchical pattern can be adopted.

  • The layered pattern structure contains only one main element (domain package) and its interface, as well as constraints that describe the pattern structure.

Hierarchical patterns can be divided into two types: closed and open.

  • The closed type is characterized by: objects in one layer can only call methods provided by objects in the same layer or the next lower layer, which has good portability.

  • The open type is characterized by: objects in one layer can call methods provided by objects in the same layer or any lower layer, which has better performance.

2. Recursive Pattern Architecture

The recursive pattern addresses the problem of:

Needing to decompose a very complex system while ensuring that the decomposition process is scalable, meaning that it can continue as necessary. The benefit is that a very complex use case obtained during the requirements phase can be mapped to this design architecture using a stepwise refinement method, and during each step of refinement, the system’s reliability and real-time performance can be verified.

Creation pattern workflow:

  • Top-down

  • Bottom-up

16.2.2 Embedded Operating Systems

1. Definition

An Embedded Operating System (EOS) refers to the operating system used for embedded systems.

2. Characteristics

  • Scalability

  • Portability

  • Strong real-time performance

  • Strong compactness

  • High-quality code

  • Strong customizability

  • Standard interfaces

  • Strong stability, weak interactivity

  • Strong determinism

  • Simplicity and convenience of operation

  • Strong hardware adaptability

  • Firmness

3. Classification

  • Real-time: real-time systems (hard real-time and soft real-time), non-real-time systems

    • Real-time operating systems: aimed at control, communication, etc., such as VxWorks, Nucleus.

    • Non-real-time embedded systems: aimed at consumer electronics, such as mobile phones, set-top boxes, e-books.

  • Security: safety-critical systems and non-safety-critical systems

4. Basic Functions

  • Operating system kernel architecture: monolithic kernel, microkernel.

  • Task management: execution state, ready state, blocked state.

    • Ready → Execute

    • Execute → Ready

    • Execute → Blocked

    • Blocked → Ready

  • Memory management: addresses the issue of multiple users using main memory, including partition memory management, paging memory management, segmentation memory management, segment-page memory management, and virtual memory management.

  • Inter-task communication: relationships between tasks are independent, competitive, synchronized, and communicative.

5. Scheduling Method Classification

  • Offline and online scheduling: whether scheduling information is determined before system operation.

  • Preemptive and non-preemptive scheduling: whether running tasks can be interrupted.

  • Static and dynamic scheduling: whether task priorities are determined before execution.

6. Hard Real-time Scheduling Algorithms

  • Earliest Deadline First: determines priority based on task deadline; the earlier the deadline, the higher the priority.

  • Least Laxity First: determines priority based on task urgency or laxity; the higher the urgency, the higher the priority.

  • Rate Monotonic Scheduling Algorithm: determines effective periods based on task cycles; the shorter the cycle, the higher the priority. This algorithm is considered optimal.

7. Virtual Memory Technology Functions

  • Addressing space

  • Memory mapping

  • Physical memory allocation

  • Shared virtual memory

16.2.3 Embedded Databases

1. Main Characteristics

  • Embedded

  • Real-time

  • Mobility

  • Scalability

2. Classification

  • By embedded object: software-embedded databases, device-embedded databases, in-memory databases.

  • By system structure: embedded databases, mobile databases, small C/S structure databases.

  • By database storage: memory-based, file-based, and network-based.

3. In-memory Database Systems

These are an organic combination of real-time systems and database systems, with in-memory databases being the best technology supporting real-time transactions.

System Architecture Designer - Chapter 16 Embedded System Architecture Design Theory and Practice

eXtremeDB is a typical in-memory embedded database. eXtremeDB adopts a hierarchical design structure, with the top layer representing the database application. The next layer is the static interface of the database and the interfaces generated based on the database design, which users call for database operations; the next layer includes relevant modules of the database kernel, including record manager, transaction manager, index manager, data dictionary; the bottom layer is the storage manager, which directly manages the memory space allocated by users. The main characteristics of eXtremeDB are as follows:

  • Minimizes the resources necessary to support persistent data.

  • Maintains a very small necessary heap space.

  • Maintains a very small code size.

  • Eliminates additional code layers through tight integration of persistent storage and host application language.

  • Provides native support for dynamic data structures.

4. File-based Databases

Data is stored in a file format, meaning that data is stored on disk in a certain format. The access method for this type of database is passive; as long as the file format is known, any program can read it directly, thus its security is very low.

System Architecture Designer - Chapter 16 Embedded System Architecture Design Theory and Practice

SQLite is a typical file-based embedded database, which adopts a modular design in its architecture, consisting of four subsystems: public interface, compiler system, virtual machine, and backend. The main characteristics of SQLite are as follows:

  • SQLite is an open-source, embedded relational database.

  • The SQLite database server is embedded within your database application.

  • The SQLite database server and client run in the same process.

  • SQLite handles data types differently from other databases.

5. Embedded Network Databases

Composed mainly of three parts: client, communication protocol, and remote server. The client is mainly responsible for providing interfaces to embedded programs, the communication protocol regulates communication between the client and the remote server, and the remote server is responsible for maintaining the database data on the server. It features a small client, no need for support, scalability, and code reusability.

System Architecture Designer - Chapter 16 Embedded System Architecture Design Theory and Practice

Network-based database systems use remote databases as storage carriers, with clients accessing remote databases on servers via mobile networks. Due to their application in various fields, network-based database systems have diverse architectures, with no unified or relatively fixed structure and products, such as C/S architecture databases, B/S architecture databases, and cloud databases.

6. Main Functions of Embedded Databases

  • A sufficiently efficient data storage mechanism.

  • Data security control (locking mechanism).

  • Real-time transaction management mechanism.

  • Database recovery mechanism (historical data storage).

16.2.4 Embedded Middleware

Middleware is all system software outside the operating system kernel, device drivers, and application software, extracting some common functional modules originally belonging to the application software layer to form an independent layer of software, thus providing a flexible, secure, portable, communicative, and collaborative platform for the applications running on it. In addition to the operating system, middleware can also shield differences in network protocols, providing various communication mechanisms for applications.

1. Characteristics

  • Generality

  • Heterogeneity

  • Distribution

  • Protocol standardization

  • Interface standardization

  • Networking

  • Support for streaming applications

  • QoS quality assurance

  • Adaptability

2. Classification

  • Enterprise Service Bus Middleware

  • Transaction Processing Monitors

  • Distributed Computing Environments

  • Remote Procedure Calls

  • Object Request Brokers

  • Database Access Middleware

  • Message Passing

  • XML-based Middleware

3. Message Middleware Architecture

System Architecture Designer - Chapter 16 Embedded System Architecture Design Theory and Practice

Two basic characteristics:

  • Uses asynchronous processing mode.

  • Applications and application call relationships are loosely coupled.

4. Distributed Object Middleware Architecture

System Architecture Designer - Chapter 16 Embedded System Architecture Design Theory and Practice

Three basic characteristics:

  • Object components generally use soft bus technology.

  • Independence from programming languages, hardware and software platforms, and network protocols.

  • Objects can be implemented in any language and platform supported by software developers.

5. Main Functions

  • Network communication.

  • Storage management.

  • Data processing.

16.2.5 Embedded System Software Development Environment

1. Characteristics of Software Development Environment

  • Integrated Development Environment

  • Cross-development

  • Open architecture

  • Scalability

  • Good operability

  • Portability

  • Configurability

  • Real-time code

  • Maintainability

  • User-friendly interface

2. Classification of Software Development Environments

  • Simulator method

  • Online simulator method

  • Monitor method

  • JTAG emulator

3. Main Functions of Unified Software Development Environment

  • Project management functions.

  • Editor functions.

  • Build management functions.

  • Compilation/assembly functions.

  • Configuration functions.

  • Debugger functions.

  • Target machine management functions.

  • Simulator functions.

4. Typical Software Development Environments

  • Software development environment based on GCC open-source tools.

  • Workbench software development environment.

  • MULTI integrated development environment.

16.3 Embedded System Software Architecture Design Methods

16.3.1 Application of Architecture-Based Software Design and Development Methods

The ABSD method has been detailed in Chapter 7 and will not be introduced here.

16.3.2 Attribute-Driven Software Design Method

1. Quality Attributes of the ADD Development Method

  • Quality attributes

  • Quality scenarios

2. ADD Development Process

  • Review inputs

  • Establish iterative goals by selecting driving factors (architecture).

  • Select one or more system elements for refinement.

  • Select one or more design concepts for refinement.

  • Instantiate architecture elements, assign responsibilities, and define interfaces.

  • Draft views and document design decisions.

  • Analyze current design, review iterative goals, and achieve design objectives.

16.3.3 Real-time System Design Method

1. DARTS Development Method

The RTSAD method is a supplementary extension of traditional structured analysis and design methods, specifically for developing real-time systems. It is a top-down real-time structured analysis method used in the system requirements analysis phase.

2. DARTS Development Process

  • Develop system specifications using real-time structured analysis (RTSA).

  • Divide the system into multiple concurrent tasks.

  • Define interfaces between tasks.

  • Design each task.

  • Design process outcomes.

3. Main Advantages of the DARTS Development Method

  • Emphasizes decomposing the system into concurrent tasks and provides standards for confirming these tasks. It highlights the importance of concurrency in the design of concurrent real-time systems.

  • Provides detailed guidelines for defining interfaces between tasks.

  • Emphasizes the importance of using task architecture diagrams (STD), which is also very important in the design of real-time systems.

  • Provides a transition from RTSA specifications to real-time design. The DARTS method offers decomposition rules and a set of design steps for handling concurrent tasks, allowing software designers to design software composed of concurrent tasks from RTSA specifications.

4. Limitations of the DARTS Development Method

  • Although the DARTS method encapsulates data storage with IHM, it does not fully achieve this like NRL and OOD. In fact, it uses a structured design method to create tasks as program modules.

  • A potential issue is that if the work in the RTSA phase is not done well, creating tasks becomes very difficult.

  • System Architecture Designer - Chapter 16 Embedded System Architecture Design Theory and Practice

Leave a Comment