CIS 4930/6930 System-on-Chip Design Transaction-Level Modeling with SystemC Dr. Hao Zheng Comp. Sci & Eng. U of South Florida.

Slides:



Advertisements
Similar presentations
SoC Challenges & Transaction Level Modeling (TLM) Dr. Eng. Amr T. Abdel-Hamid ELECT 1002 Spring 2008 System-On-a-Chip Design.
Advertisements

Computer Architecture
Copyright  2003 Dan Gajski and Lukai Cai 1 Transaction Level Modeling: An Overview Daniel Gajski Lukai Cai Center for Embedded Computer Systems University.
Practical techniques & Examples
High Level Languages: A Comparison By Joel Best. 2 Sources The Challenges of Synthesizing Hardware from C-Like Languages  by Stephen A. Edwards High-Level.
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
Chapter 1 : SystemC Overview. What is SystemC Systemc is a modeling platform  A set C++ class library to add hardware modeling constructs  Simulation.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Processor support devices Part 1:Interrupts and shared memory dr.ir. A.C. Verschueren.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
Puneet Arora ESCUG, 09 Abstraction Levels in SoC Modelling.
Transaction Level Modeling with SystemC Adviser :陳少傑 教授 Member :王啟欣 P Member :陳嘉雄 R Member :林振民 P
SystemC System-Level Modeling Mehdi Mosaffa Abdurrahman Manian.
Input/Output Management and Disk Scheduling
12a.1 Introduction to Parallel Computing UNC-Wilmington, C. Ferner, 2008 Nov 4, 2008.
Chapter 6 : Channel Refinement. SystemC Communication Refinement Vital part of overall system refinement: Add more details  To gain more precise analysis.
CS 104 Introduction to Computer Science and Graphics Problems
Transaction Level Modeling Definitions and Approximations Trevor Meyerowitz EE290A Presentation May 12, 2005.
Dipartimento di Informatica - Università di Verona Networked Embedded Systems The HW/SW/Network Cosimulation-based Design Flow Introduction Transaction.
EECS 470 Cache and Memory Systems Lecture 14 Coverage: Chapter 5.
Chapter 5. SystemC 1.0 Main Purpose  Model RTL Instruments  Support diverse data type  Execute concurrently by using METHODs.
CS-334: Computer Architecture
Yoshinori Takeuchi Osaka University 1MPSoC Osaka University  Expansion of multi-functional portable multimedia devices requires high performance.
SystemC: Introduction. SystemC  A C++ based class library and design environment for system-level design.  Suitable for functional description that.
ECE 2372 Modern Digital System Design
Extreme Makeover for EDA Industry
The University of Adelaide, School of Computer Science
System Verilog Testbench Language David W. Smith Synopsys Scientist
Automatic Communication Refinement for System Level Design Samar Abdi, Dongwan Shin and Daniel Gajski Center for Embedded Computer Systems, UC Irvine
SystemC and Levels of System Abstraction: Part I.
1 Freeha Azmat Saba Zia Dec 02, Agenda Installation Introduction From Verilog to SystemC Counter as an Example Complete SystemC Modeling 2.
Fast Simulation Techniques for Design Space Exploration Daniel Knorreck, Ludovic Apvrille, Renaud Pacalet
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
CS 346 – Chapter 4 Threads –How they differ from processes –Definition, purpose Threads of the same process share: code, data, open files –Types –Support.
Parameter Passing Mechanisms Reference Parameters Read § §
Design & Co-design of Embedded Systems Next Step: Transaction-Level Modeling Maziar Goudarzi.
Parameter Passing Mechanisms Reference Parameters § §
EEE440 Computer Architecture
Winter-Spring 2001Codesign of Embedded Systems1 Methodology for HW/SW Co-verification in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE.
Winter-Spring 2001Codesign of Embedded Systems1 Introduction to System-Level Modeling in SystemC 2.0 Part of HW/SW Codesign of Embedded Systems Course.
6. A PPLICATION MAPPING 6.3 HW/SW partitioning 6.4 Mapping to heterogeneous multi-processors 1 6. Application mapping (part 2)
Presentation by Tom Hummel OverSoC: A Framework for the Exploration of RTOS for RSoC Platforms.
CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #5 – System-Level.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
Computer Architecture Lecture 32 Fasih ur Rehman.
Lab 2 Parallel processing using NIOS II processors
1 Copyright  2001 Pao-Ann Hsiung SW HW Module Outline l Introduction l Unified HW/SW Representations l HW/SW Partitioning Techniques l Integrated HW/SW.
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
Pipelined and Parallel Computing Partition for 1 Hongtao Du AICIP Research Dec 1, 2005 Part 2.
System-on-Chip Design Hao Zheng Comp Sci & Eng U of South Florida 1.
© 2004, D. J. Foreman 1 Device Mgmt. © 2004, D. J. Foreman 2 Device Management Organization  Multiple layers ■ Application ■ Operating System ■ Driver.
System-on-Chip Design Data Flow hardware Implementation Hao Zheng Comp Sci & Eng U of South Florida 1.
CDA 4253 FPGA System Design RTL Design Methodology 1 Hao Zheng Comp Sci & Eng USF.
CDA 4253 FPGA System Design Final Project Hao Zheng Comp Sci & Eng U of South Florida 1.
System-on-Chip Design Homework Solutions
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
System-on-Chip Design Analysis of Control Data Flow
1 of 14 Ivan Ukhov Embedded Systems Laboratory Department of Computer and Information Science Linköping University TDDI08: Embedded Systems Design Introduction.
CIS 4930/6930 System-on-Chip Design Introduction to SystemC Hao Zheng Computer Science & Engineering U of South Florida.
Tutorial 1 COEN691B.
System-on-Chip Design
System-on-Chip Design Principles of Hardware/Software Communication
System-on-Chip Design Homework Solutions
System-on-Chip Design On-Chip Buses
Introduction to High-level Synthesis
Design Flow System Level
Introduction to System-Level Modeling in SystemC 2.0
The University of Adelaide, School of Computer Science
Presentation transcript:

CIS 4930/6930 System-on-Chip Design Transaction-Level Modeling with SystemC Dr. Hao Zheng Comp. Sci & Eng. U of South Florida

Motivation Why use transaction-level modeling and ESL languages? -Manage growing system complexity -Move to higher levels of abstraction -Enable HW/SW co-design -Speed-up simulation - Support system-level design and verification Increase designers’ productivity Reduce development costs and risk Accelerate time-to-market & time-to-money 2

Levels of Abstraction 3

Functional Model: Untimed or Timed 4 Computation – behavior Communication – abstract channels A network of communicating sequential processes connected by abstract channels.

Bus Functional/Arbitration Model 5 Computation – behavioral, approximately timed Communication – protocol bus channels

6 Cycle Accurate Computation Model Communication is approximately timed.

7 Implementation Model

Dataflow Modeling Actors – processes communications – FIFO channels -Channels are bounded. Comm. channel operations – blocking read & write 8 Constant Adder Fork Printer

9 Basic Channel: sc_fifo voidread(T&); Tread(); boolnb_read(T&); voidwrite(const T&); boolnb_write(const T&); intnum_free(); intnum_available(); sc_fifo(int size=16); sc_fifo(char* name, int size=16); sc_fifo_in : support only read operations. sc_fifo_out : support only write operations.

Dataflow Modeling: Adder 10 template SC_MODULE(DF_Adder) { sc_fifo_in din1, din2; sc_fifo_out dout; void process() { while (1) dout.write(din1.read() + din2.read()); } SC_CTOR(DF_Adder) { SC_THREAD(process); } };

Dataflow Modeling: Constant Generator 11 template SC_MODULE(DF_Const) { sc_fifo_out dout; void process() { while (1) dout.write(constant_); } SC_HAS_PROCESS(DF_Const); DF_Const(sc_module_name N, const T& C) : sc_module(N), constant_(C) { SC_THREAD(process); } T constant_; };

Dataflow Modeling: Fork 12 template SC_MODULE(DF_Fork) { sc_fifo_in din; sc_fifo_out dout1, dout2; void process() { while (1) { T value = din.read(); dout1.write(value); dout2.write(value); }} SC_CTOR(DF_Fork){ SC_THREAD(process); } };

Dataflow Modeling: Printer 13 template SC_MODULE(DF_Printer) { sc_fifo_in din; void process() { for (int i=0; i < n_iter; i++) { T value = din.read(); cout << name() << “ “ <<value<<endl; } done_ = true; return; // terminate } DF_Printer(...)... { SC_THREAD(process); } };

Dataflow Modeling: Top Module 14 sc_main(int argc, char* argv[]) { DF_Const constant(“constant”, 1); DF_Adder adder(“adder”); DF_Fork fork(“fork”); DF_Printer printer(“printer”, 10); sc_fifo const_out(“const_out”, 5); sc_fifo adder_out(“adder_out”, 1); sc_fifo feedback(“feedback”, 1); sc_fifo to_printer(“2printer”, 1); feedback.write(42); // channel init.... }

Dataflow Modeling: Top Module 15 sc_main(int argc, char* argv[]) {... constant.output(const_out); adder.din1(feedback); adder.din2(const_out); fork.din(adder_out); fork.dout1(feedback); fork.dout2(to_printer); printer.din(to_printer); sc_start(); //No sim. time limit return 0; } Port binding

Timed Models 16 template SC_MODULE(DF_Const) { sc_fifo_out dout; void process() { while (1) { wait(200, SC_NS); dout.write(constant_); }... }; Computational delay

Timed Models 17 template SC_MODULE(DF_Adder) {... void process() { while (1) T data = din1.read() + din2.read(); wait(200, SC_NS); dout.write(data); }... };

Stopping Dataflow Simulation Execute the model for a fixed number of iterations – then stop simulation. -Example: DF_printer If termination depends on that multiple modules finish, then they output flags to a terminator module to decide whether to stop simulation. For timed models, use sc_start() with a time limit. 18

Reading SystemC-1 book, Chapter 5. 19

Channels Implemented as Buses 20

Channels Implemented as Buses A bus is modeled as a SystemC channel. A SystemC channel is a module inherited from sc_channel and a number of supported interfaces. Interfaces define operations allowed by an associated SystemC channel. Interface methods are implemented within the SystemC channel definition. 21

A Simple Bus Design 22 class bus_if: virtual public sc_interface { public: virtual void burst_read ( char* data, unsigned addr, unsigned len) = 0; virtual void burst_write ( char* data, unsigned addr, unsigned len) = 0; }

A Simple Bus Design 23 class simple_bus : public bus_if, public sc_channel { public: simple_bus(sc_module_name nm, unsigned mem_size, sc_time cycle_time) : sc_channel(nm), _cycle_time(cycle_time) {...} ~simple_bus() {...} virtual void burst_read(...) {} virtual void burst_write(...) {} protected: char* _mem; sc_time _cycle_time; sc_mutex _bus_mutex; }

sc_mutex 24 sc_mutex name; name.lock(); // lock the mutex int name.trylock();// non-blocking lock // return 0 for success // return -1 otherwise name.unlock();// free a locked mutex.

A Simple Bus Design 25 virtual void burst_read(char* data, unsigned addr unsigned len) { _bus_mutex.lock(); // Block the caller for the data xfer wait (len * _cycle_time); // xfer data memcpy(data, _mem + addr, len); _bus_mutex.unlock(); }

A Simple Bus Design 26 virtual void burst_write(char* data, unsigned addr unsigned len) { _bus_mutex.lock(); // Block the caller for the data xfer wait (len * _cycle_time); // xfer data memcpy(_mem + addr, data, len); _bus_mutex.unlock(); } Arbitration is not supported. Any idea how to do it?

Reading SystemC-1 book, section

A design Problem: Matrix Multiplication 28

A design Problem: Matrix Multiplication First step, algorithmic modeling – a C program. Second step: transaction level modeling Third step: communication refinement Fourth step: custom HW implementation Fifth step: replace CPU with a cycle-accurate instruction set simulator -Will skip this step 29

A design Problem: Matrix Multiplication 30 CPU Custom HW Mem

A design Problem: Matrix Multiplication Words – unsigned 32-bit integers. Performance constraints -Memory access overhead: 100 cycles/access -Memory read/write delay: 10 cycles/word -CPU Add: 15 cycles -CPU shift: 1 cycle -CPU multiply: 500 cycles -Bus xfer: 1 cycle/word -Custom HW: depend on the implementation 31

A design Problem: Matrix Multiplication Custom HW implementation -multiplication – various optimizations for performance -multi/accumulation -multiple copies of the above for parallelism Need to find its average performance for estimation. -need to run it for a large set of random inputs. 32