2110682 Embedded and Real-Time Systems

Department of Computer Engineering
Faculty of Engineering, Chulalongkorn University


Course duration    : 2nd semester 2017
Lecturer                : Prabhas Chongstitvatana, Prof.
                            (office Eng build 4, Floor 18, room 13, tel 022186982, email: prabhas at chula dot ac dot th)
Lecture                : Sat 9.00-12.00 at ENG4 Floor 17

The content of the course is a mixed between hardware and software.  Embedded systems are computer systems with special requirement on constraints such as low power, high integration, real-time. This course explores Embedded systems design. On the hardware side, it includes embedded processors and low level programming, logic design, integrated circuits.  On the software side, it includes Operating systems scheduling and real-time constraints.  Here are the list of topics:
 
Introduction to embedded and real-time systems
Microprocessor
Assembly level programming
Memory, Peripherals and Microprocessor interface
Operating systems and task scheduling
Real-time systems and their requirements
Internet of Things

How we learn

We learn by doing both hardware and software.  The activities include embedded system model construction, some programming, and hands-on session. The assignments will be given out periodically throughout the term. A small project will be given around midterm. Students must present the results of their projects.  At the second half of the semester students are assigned to do research on the given topics.  The reports will be presented in the class. The final exam is "open book" and has an element of system design plus some "pseudo" programming.

Announcement

4 Feb 2017    I update mos2.txt  that now it works properly with iot-rz-10.zip
25 Feb 2017   I update mos-rz2.txt  (process synchronisation). It works with iot-rz-15.zip
22 Apr 2017   Final project is out!   Final exam (written, open book) is on 6 May, 9-11am.
. . .

Timetable

January
Introduction
Microprocessors
Microprocessor: assembly language S2 version 1: 32-bit processor  
Rz language and its compiler
Low power programming (with IoT board)
    example interrupt mode program:  (in assembly) demo-int.txt ,  (in Rz)  demo-rz.txt
logic design  Basic Logic  
architecture:   Evolution of computer architecture
February
Operating systems and task scheduling  basic OS concepts
Multitask-OS (MOS)
lecture from Matt Welsh, Harvard,   semaphores.pdf 
semaphore:  flash demo from William Stallings, U. of Queensland
implementing semaphores
Cooperative Processes
Cooperative Multitask OS (CMOS)
Project discussion
March
memory, peripherals and interface  memory and interrupt i/o     peripherals
cache and virtual memory   memory system design
Project presentation
real-time systems RTOS      real-time scheduling
Embedded Systems Communication
CAN    
April
Multicore processor
May
final exam

Homework

1)   S21 assembly language
a.  Practice assembly language programming by writing several simple programs. 
b.  Use your C compiler to make as21.exe and sim21.exe from my source.  Try to run a few S21 programs.
c.  Read the assembly program for checking membership of a linked list (in the lecture).  Try to run it.
2)  Write Rz program for IoT board to read and display input ports.
3)  Study MOS in assembly language  mos2.txt .  I update the code to the present state of tools.  Try to run the application (included in the mos2 file).  I will "script" these codes in Rz (for mos2.txt) in the next class.
4)  Using MOS with semaphore, write some simple concurrent programs that share resource or synchronise.

Assignment

Mid term projects

Choose one topic from this list, at most two people for one topic:
1)   Make CMOS (cooperative MOS).  You can write in Rz or in Assembly.  The main concept follows from the code coop.txt and the lecture.
2)  Make a stop watch.  One process is the interface to start/stop/display the time.  Another process use timer to keep real time.  You need to count the clock and translate it into HH:MM:SS form.  Think how to use concurrency to do the work.
3)  Make producer/consumer with buffer.  From the semaphore lecture, implement that example.  You can write in Rz or assembly.

Implement the working program.  Write one or two pages describing your technique and/or your experiment.  Give opinion of your experience.  If you found some bugs, don't worry, just write about them and how you want to change them.

Due date is 18 March 2017.  Prepare to present your work to the class.

Final project

Final project consists of presentation and reports.  The report is a 4-5 pages describing your project, the aim, the method and the result.  The following list are the topics that have been confirmed:

1)  Sim30 as a service through the web.
2) Multicore matrix multiplication, compare 2, 4, 8 cores number of executed instructions.
3) Multicore sorting, compare 2, 4, 8 cores number of executed instructions.
4) Mulitask simulator on the web, having one input and two output screens.
5) Dual core fraction addition, compare 1 and 2 cores number of executed instructions.

There are two more projects that are not yet confirm.  Please contact me.

Due date, on the final exam day, 11am - 12pm, presentation 8 minutes each.  Reports (paper) can be submit not later than 13 May (one week after exam).

Recommended Textbooks

1. Ball S, Embedded Microprocessor Systems: Real World Design 2nd edition, Newnes 2000
2. Vahid F, Givargis T, Embedded System Design: A Unified Hardware/Software Introduction, Wiley 2002
3. Kopetz H, Real-Time Systems: Design Principles for Distributed Embedded Applications, Kluwer 1997

Additional Materials

Transistor level simulation of an antique CPU.  6502 is used in the iconic Apple II machine.
    http://visual6502.org/JSSim/index.html  

Course Assessment

Assignments            10%
Mid project             30%
Final project           30%
Final exam              30%

Tools

s21 tools :    assembler and simulator  s21-0.zip  (update)
rz3.6.1 compiler with s21 assembler and simulator  rz361-2.zip
IoT board:  Rz compiler, S21 assembler, simulator   iot-rz-4.zip
Rz compiler for IoT board with MOS    iot-rz-10.zip
update tools   iot-rz-15.zip    iot-rz-16.zip
MOS in Rz  mos-rz2.txt   (update 25 Feb 2017)
S30 multicore: assembler, simulator  s30-4.zip

Acknowledgement

Slides and presentations are kindly permitted by Setha Pan-gnam, Chalermek Intanagonwiwat

last update 23 Apr 2017