Download presentation
Presentation is loading. Please wait.
Published byBrennan Girman Modified over 10 years ago
1
Winter-Spring 2001Codesign of Embedded Systems1 Introduction to SystemC Part of HW/SW Codesign of Embedded Systems Course (CE 40-226)
2
Winter-Spring 2001Codesign of Embedded Systems2 Today programme Introduction to SystemC History Highlights Design Methodology A simple SystemC program
3
Winter-Spring 2001Codesign of Embedded Systems3 SystemC v0.90 Sep. 99 SystemC History Synopsys ATG Synopsys “Fridge” Synopsys “Scenic” UC Irvine 1996 Frontier Design A/RT Library 1991 SystemC v1.1 Jun. 00 Abstract Protocols imec 1992 CoWare “N2C” 1997 VSIA SLD Data Types Spec (draft) SystemC v1.0 Apr. 00 Fixed Point Types
4
Winter-Spring 2001Codesign of Embedded Systems4 SystemC Highlights Modules Processes Ports Signals Rich set of port and signal types Rich set of data types Clocks Cycle-based simulation Multiple abstraction levels Communication protocols Debugging support Waveform tracing Features as a codesign language
5
Winter-Spring 2001Codesign of Embedded Systems5 Current System Design Methodology C/C++ System Level Model Analysis Results Refine VHDL/Verilog Manual Conversion Simulation Synthesis Rest of Process
6
Winter-Spring 2001Codesign of Embedded Systems6 Current System Design Methodology (cont’d) Problems Errors in manual conversion from C to HDL Disconnect between system model and HDL model Multiple system tests
7
Winter-Spring 2001Codesign of Embedded Systems7 SystemC Design Methodology SystemC Model Simulation Refinement Synthesis Rest of Process
8
Winter-Spring 2001Codesign of Embedded Systems8 SystemC Design Methodology (cont’d) Advantages Refinement methodology Written in a single language Higher productivity Reusable testbenches
9
Winter-Spring 2001Codesign of Embedded Systems9 SystemC programming model A set of modules interacting through signals. Module functionality is described by processes. Mod 1 Mod 2 Mod 3
10
Winter-Spring 2001Codesign of Embedded Systems10 SystemC programming model (cont’d) System (program) debug/validation Testbench Simulation, Waveform view of signals Normal C++ IDE facilities Watch, Evaluate, Breakpoint,... sc_main() function instantiates all modules initializes clocks initializes output waveform files starts simulation kernel
11
Winter-Spring 2001Codesign of Embedded Systems11 A Simple Example: Defining a Module Complex-number Multiplier (a+bi)*(c+di) = (ac-bd)+(ad+bc)i Complex Multiplier (cmplx_mult) a b c d e f SC_MODULE(cmplx_mult) { sc_in a,b; sc_in c,d; sc_out e,f;... }
12
Winter-Spring 2001Codesign of Embedded Systems12 A Simple Example: Defining a Module (cont’d) SC_MODULE(cmplx_mult) { sc_in a,b; sc_in c,d; sc_out e,f; void calc(); SC_CTOR(cmplx_mult) { SC_METHOD(calc); sensitive<<a<<b<<c<<d; } void cmplx_mult::calc() { e = a*c-b*d; f = a*d+b*c; }
13
Winter-Spring 2001Codesign of Embedded Systems13 Completing the Design M2 Complex Multiplier a b c d e f M1 input_gen M3 display Clk.signal() clk
14
Winter-Spring 2001Codesign of Embedded Systems14 Completing the Design: input_gen module SC_MODULE(input_gen) { sc_in clk; sc_out a,b; sc_out c,d; void generate(); SC_CTOR(input_gen) { SC_THREAD(generate); sensitive_pos(clk); } } void input_gen::generate() { int a_val=0, c_val=0; while (true) { a = a_val++; wait(); c = (c_val+=2); wait(); } }
15
Winter-Spring 2001Codesign of Embedded Systems15 Completing the Design: display module SC_MODULE(display) { sc_in e,f; void show(); SC_CTOR(display) { SC_METHOD(show); sensitive<<e<<f; } } void display::show() { cout<<e<<‘+’<<f<<“i\n”; }
16
Winter-Spring 2001Codesign of Embedded Systems16 Putting it all together: sc_main function #include int sc_main() { input_gen M1(“I_G”); cmplx_mult M2(“C_M”); display M3(“D”); sc_signal a,b,c,d,e,f; sc_clock clk(“clk”,20,0.5); M1.clk(clk.signal()); M1.a(a); M1.b(b); M1.c(c); M1.d(d); M2.a(a); M2.b(b); M2.c(c); M2.d(d); M2.e(e); M2.f(f); M3.e(e); M3.f(f); sc_start(100); return 0; }
17
Winter-Spring 2001Codesign of Embedded Systems17 What we learned today What’s SystemC SystemC advantages SystemC programming model Writing programs in SystemC
18
Winter-Spring 2001Codesign of Embedded Systems18 Complementary notes: Assignments Send your assignments to ce226@ce.sharif.edu Today is due date for Assignment 2 Take Assignmentak 3 Due date: Sat. Farvardin 25th
19
Winter-Spring 2001Codesign of Embedded Systems19 Complementary notes: SystemC Installation Refer to http://ce.sharif.edu/~ce226 Under “References” tab, find SystemC 1.0 user’s guide and installation files, and SystemC_Win utility We start by SystemC 1.0, later will cover 1.1 and talk about 2.0
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.