1 of 14 Ivan Ukhov Embedded Systems Laboratory Department of Computer and Information Science Linköping University TDDI08: Embedded Systems Design Introduction.

Slides:



Advertisements
Similar presentations
Parameter passing mechanism: pass-by-reference. The Pass-by-reference mechanism - the agreement Recall: Parameter passing mechanism = agreement between.
Advertisements

Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.c files.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 11/05/07CS150 Introduction to Computer Science 1 Functions Chapter 6, page 303.
Problem Solving and Program Design Programming. COMP104 Lecture 3 / Slide 2 Problem Solving Process l Define and analyze the problem. l Develop a solution.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
Announcements The first graded lab will be posted Sunday 2/15 and due Friday 2/27 at midnight It is brand new, so please don’t hand in last semester’s.
1 10/20/08CS150 Introduction to Computer Science 1 do/while and Nested Loops Section 5.5 & 5.11.
Monday, 9/23/02, Slide #1 CS 106 Intro to CS 1 Monday, 9/23/02  QUESTIONS??  Today:  Discuss Lab 3  Do Exercises  Introduction to functions  Reading:
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
Rossella Lau Lecture 1, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 1: Introduction What this course is about:
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 15: SystemC (3/3) Prof. Sherief Reda Division of.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Functions Outline 3.12Recursion 3.13Example Using Recursion: The Fibonacci Series 3.14Recursion.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 14: SystemC (2/3) Prof. Sherief Reda Division of.
CSE 332: C++ program structure and development environment C++ Program Structure (and tools) Today we’ll talk generally about C++ development (plus a few.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
SystemC: Introduction. SystemC  A C++ based class library and design environment for system-level design.  Suitable for functional description that.
From Scenic to SystemC Mehrdad Abutalebi. Outline Introducing Scenic Scenic Implementation Modeling Reactivity A Simple example From Scenic to SystemC.
CHAPTER 5: CONTROL STRUCTURES II INSTRUCTOR: MOHAMMAD MOJADDAM.
chap13 Chapter 13 Programming in the Large.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
1 Freeha Azmat Saba Zia Dec 02, Agenda Installation Introduction From Verilog to SystemC Counter as an Example Complete SystemC Modeling 2.
1 C++ Programming Basics Chapter 2 Lecture CSIS 10A.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
TDDD55- Compilers and Interpreters Lesson 1 Zeinab Ganjei Department of Computer and Information Science Linköping University.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 6 September 17, 2009.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
1 Very Large Scale Integration II - VLSI II SystemC Gürer Özbek ITU VLSI Laboratories Istanbul Technical University.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics.
Winter-Spring 2001Codesign of Embedded Systems1 Debug and Trace Facilities in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
COMPILER CONSTRUCTION Lesson 1 – TDDD16 TDDB44 Compiler Construction 2010 Kristian Stavåker (Erik Hansson.
Introduction to Loops Iteration Repetition Counting Loops Also known as.
C++ / G4MICE Course Session 1 - Introduction Edit text files in a UNIX environment. Use the g++ compiler to compile a single C++ file. Understand the C++
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 3 – Inventory Application: Introducing Variables,
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
Makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.c files all linked.
Dayu Zhang 9/10/2014 Lab03. Outline Brief Review of the 4 Steps in Hello.cpp Example Understand endl and \n Understand Comment Programming Exercise -
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 2 September 3, 2009.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
1 of 14 TDTS07: System Design and Methodology Introduction to Lab 1 and 2 Ivan Ukhov Embedded Systems Laboratory Department of Computer and Information.
STARTING OUT WITH STARTING OUT WITH Class 2 2 Review of course requirements: Homework due Thursday at beginning of class-- no lates accepted Programs.
 2003 Prentice Hall, Inc. All rights reserved Basics of a Typical C++ Environment C++ systems –Program-development environment –Language –C++
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
CIS 4930/6930 System-on-Chip Design Transaction-Level Modeling with SystemC Dr. Hao Zheng Comp. Sci & Eng. U of South Florida.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 23, 2005 Lecture Number: 11.
CIS 4930/6930 System-on-Chip Design Introduction to SystemC Hao Zheng Computer Science & Engineering U of South Florida.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Tutorial 1 COEN691B.
Computer Terms Review from what language did C++ originate?
Discussion 2: More to discuss
Verilog Introduction Fall
Makefiles.
Tsao, Lin-wei Li, Han-lin Hu, Sun-Bo
Design Flow System Level
ECE 434 Advanced Digital System L08
SystemC Scheduler Dynamic sensitivity.
CS150 Introduction to Computer Science 1
Week 4 Lecture-2 Chapter 6 (Methods).
COMS 261 Computer Science I
COE 202 Introduction to Verilog
Presentation transcript:

1 of 14 Ivan Ukhov Embedded Systems Laboratory Department of Computer and Information Science Linköping University TDDI08: Embedded Systems Design Introduction to Lab 1

2 of 14 2 Contacts  Petru Eles (lectures)  Office: Building B 329:220   Ivan Ukhov (lessons)  Office: Building B 329:228   Adrian Horga (labs)  Office: Building B 329:198 

3 of 14 3 Outline  Today  Organization  Lab 1  Next time  Lab 2

4 of 14 4 Organization  Lab groups  Webreg groups A and B  Web page   Check for detailed information and links to tutorials  Organization  2 lessons (including this one)  7 two-hour lab sessions  Lab assignments 1.Modeling and simulation with SystemC 2.Design-space exploration in MPARM

5 of 14 5 Organization – Lessons  Lesson 1  SystemC  Lesson 2  MPARM

6 of 14 6 Organization  Choose a lab partner and sign up in Webreg   Deadline for registration: January 31  Register as soon as possible  Deadline for labs: March 27  This is the last day for handing in ( ing) lab reports  After the deadline, your assistant will correct the remaining lab reports at his earliest convenience  Rules: Please read them (see the labs’ page)

7 of 14 7 Structure 1.Modeling and simulation with SystemC 2.Design-space exploration with MPARM  Each lab has a tutorial. Please read it and be prepared before you attend the lab session. We want to work efficiently during the supervised lab sessions.

8 of 14 8 Examination  Written report for each lab (pdf)  Present your solution to the lab exercises  Explain your design and implementation choice in detail  Present and discuss your results and simulations  Prepare an archive with the report (pdf) and the code (where any) and it to your group’s assistant (CC both lab partners)  Grades:  Passed  Intermediate: revise your solution and report according to your assistant’s comments

9 of 14 9 Lab 1: SystemC modeling and simulation

10 of Simulation  Based on executable models of the system  Generate input stimuli  Permits a quick and shallow evaluation of the design quality  Good for finding bugs  Not suitable for finding subtle errors

11 of SystemC  Compare to VHDL and Verilog  Contains structures for modeling HW components and their interaction  Comes with a simulation kernel  It’s a unified HW-SW design language  What do we need to model systems?  time  modules  concurrent processes  events  channels  ports

12 of SystemC – Time  Data type sc_time (a C++ class)  Use like an ordinary basic C++ data type ( int, double )  sc_time t1(9,SC_MS);  sc_time t2 = sc_time(5,SC_SEC);  if (t1<t2) cout << t1*3 << endl << t2+t2;  Many of the standard operators are defined for sc_time  The underlying representation is based on 64-bits unsigned integer values  The representable time is limited (discrete time)  Depends on the time resolution  Default: 1 picosecond  Can be set by the user through the function sc_set_time_resolution

13 of SystemC – Modules Modules:  Basic building blocks in SystemC  Contains ports, concurrent processes, internal data structures, channels, etc.  Created with the macro SC_MODULE  Concurrent processes ( SC_THREAD or SC_METHOD )  Use wait statements to advance time (or event notification)  Sensitive to events ( sc_event ) or value changes in channels  Input and output ports to communicate with the environment

14 of Example: Adder Adder a b sum

15 of SystemC module example #include using std::cout; using std::endl; SC_MODULE(Adder) { sc_in a_p; sc_in b_p; sc_out sum_p; sc_event print_ev; void add_method() { sum_p = a_p + b_p; print_ev.notify(SC_ZERO_TIME); } void print_method() { cout << sc_time_stamp() << ”:Sum=” <<sum_p << endl; } SC_CTOR(Adder) { sum_p.initialize(0); SC_METHOD(add_method); sensitive << a_p << b_p; SC_METHOD(print_method); dont_initialize(); sensitive << print_ev; } }; // END Adder

16 of Generate inputs Adder a b sum Generator

17 of SystemC – Input generator SC_MODULE(Generator) { sc_out a_p; sc_out b_p; void gen_thread() { for (;;) { wait(1,SC_SEC); a_p = a_p + 1; b_p->write(b_p->read() + 1); } } SC_CTOR(Generator) { a_p.initialize(0); b_p.initialize(0); SC_THREAD(gen_thread); } }; // END Generator

18 of SystemC – Test bench // Definition of an input generator (next slide) int sc_main(int argc, char *argv[]) { sc_set_default_time_unit(1,SC_SEC); sc_signal a_sig, b_sig, sum_sig; // create channels Adder adder_module(”Adder_1”); // create an instance adder_module(a_sig, b_sig, sum_sig); // connect ports to channels Generator gen(”Generator_1”); gen(a_sig, b_sig); sc_start(30,SC_SEC); return 0; }

19 of Simulation run $./adder.x SystemC 2.1.v1 --- Dec :12:32 Copyright (c) by all Contributors ALL RIGHTS RESERVED 0 s: Sum=0 1 s: Sum=2 2 s: Sum=4 3 s: Sum=6 4 s: Sum=8 5 s: Sum=10 6 s: Sum=12 7 s: Sum=14 8 s: Sum=16 9 s: Sum=18 10 s: Sum=20 11 s: Sum=22.

20 of Simulator kernel  1. Initialize: each process executed once; it’s possible to disable this phase for methods  2. Evaluate: select a ready to run process and execute/resume it; immediate notification may happen – e.notify()  3. repeat 2 until no more processes to run  4. Update: values assigned to channels in the previous evaluate cycle  5. stept 2-4 = delta-cycle; if 2 or 3 resulted in delta event notifications (e.notify(0) or wait(0)) go to 2 without advancing simulation time  6. Advance to next simulation time with pending events  Determine processes ready to run and go to 2

21 of Simulator kernel – Delta cycle example //inside a process sc_signal sig_int; //assume current value //of sig_int is 0 sig_int.write(1); int value = sig_int.read(); cout << value << endl; wait(SC_ZERO_TIME); value = sig_int.read(); cout << value << endl; 0101

22 of Try the example  You can find the example at:  /home/TDTS07/tutorials/systemc/adder  Copy it to your home directory  Two files:  adder.cc (implements the two modules + the test bench)  Makefile (helps you compile and build the program)  Type make at the command line assuming you are in the correct directory  Creates an executable adder.x  After building the example, type./adder.x to run it  Study the source code together with the tutorial

23 of Lab assignment  Study the lab material linked from the web pages  At the end of the document you find the lab assignment  Design and implement a traffic-light controller  For details: SystemC Language Reference Manual 

24 of Thank you! Questions?