CPE 626 The SystemC Language Aleksandar Milenkovic Web:http://www.ece.uah.edu/~milenkahttp://www.ece.uah.edu/~milenka.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Simulation executable (simv)
Interrupts, Low Power Modes and Timer A (Chapters 6 & 8)
C Examples 1.
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value Z:high-impedance.
Lecture # 21 Chapter 6 Uptill 6.4. Type System A type system is a collection of rules for assigning type expressions to the various parts of the program.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
1 Lecture 7  Fundamental data types in C  Data type conversion:  Automatic  Casting  Character processing  getchar()  putchar()  Macros on ctype.h.
Chapter 3 : Combination and Sequential Circuits Modeling.
Primitive Variable types Basic types –char (single character or ASCII integer value) –int (integer) –short (not longer than int) –long (longer than int)
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 15: SystemC (3/3) Prof. Sherief Reda Division of.
Copyright © 2001 Stephen A. Edwards All rights reserved SystemC Prof. Stephen A. Edwards.
Railway Foundation Electronic, Electrical and Processor Engineering.
Chapter 2 : Data types. Extension Data Type Overview NameDescription sc_bitsingle bit with two values, ‘0’ and ‘1’ sc_bv Arbitrary width bit vector sc_logicSignle.
Copyright © 2001 Stephen A. Edwards All rights reserved SystemC Prof. Stephen A. Edwards.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 14: SystemC (2/3) Prof. Sherief Reda Division of.
Railway Foundation Electronic, Electrical and Processor Engineering.
Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 13: SystemC (1/3) Prof. Sherief Reda Division of.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Digital Fundamentals Floyd Chapter 1 Tenth Edition
SystemC: Introduction. SystemC  A C++ based class library and design environment for system-level design.  Suitable for functional description that.
Programming Languages
1 Advanced Computer Architecture 5MD00 / 5Z032 SystemC Henk Corporaal 2007.
From Scenic to SystemC Mehrdad Abutalebi. Outline Introducing Scenic Scenic Implementation Modeling Reactivity A Simple example From Scenic to SystemC.
Lecture 9. - Synchronous Devices require a timing signal. Clock generated Interval Timer Microprocessor Interval Timer Clk PCLK = MHz PCLK (for.
ECE 2372 Modern Digital System Design
SystemC Tutorial Author: Silvio Veloso
L16 – Testbenches for state machines. VHDL Language Elements  More examples HDL coding of class examples Testbench for example  Testing of examples.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals with PLD Programming.
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
Verilog Language Concepts
Assertion Based Testing. Testing and verification Does the design function according to the specifications? Example.
1 Freeha Azmat Saba Zia Dec 02, Agenda Installation Introduction From Verilog to SystemC Counter as an Example Complete SystemC Modeling 2.
Design & Co-design of Embedded Systems Combinational Logic in SystemC Maziar Goudarzi.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
Winter-Spring 2001Codesign of Embedded Systems1 Reactivity, Ports, and Signals in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
1 Very Large Scale Integration II - VLSI II SystemC Gürer Özbek ITU VLSI Laboratories Istanbul Technical University.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
Winter-Spring 2001Codesign of Embedded Systems1 Debug and Trace Facilities in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
Design & Co-design of Embedded Systems Data Types in SystemC Maziar Goudarzi.
CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #10 – Introduction.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Assignment write a short notes on 1.Manufacturing Testing. 2.Functional Testing. 3.Files and Text I/O. 4.Differentiate the cpld and fpga architecture.
CPE 626 The SystemC Language – VHDL, Verilog Designer’s Guide Aleksandar Milenkovic Web:
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
CPE 626 The SystemC Language Aleksandar Milenkovic Web:
Winter-Spring 2001Codesign of Embedded Systems1 Modules in SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 7 Behavioral modeling of a dual ported register set.
Signals & Data-typesVer 1.1, Copyright 1997, TS, Inc. VHDL S i g n a l s & D a t a T y p e s Page 1.
Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic.
PULSE WIDITH MODULATION EE 587 Presented by Viswanadha Kakarlapudi.
CS426Fall 2010/Lecture 141 Computer Security CS 426 Lecture 14 Software Vulnerabilities: Format String and Integer Overflow Vulnerabilities.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
CIS 4930/6930 System-on-Chip Design Transaction-Level Modeling with SystemC Dr. Hao Zheng Comp. Sci & Eng. U of South Florida.
1 of 14 Ivan Ukhov Embedded Systems Laboratory Department of Computer and Information Science Linköping University TDDI08: Embedded Systems Design Introduction.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Behavioral modeling of a dual ported register set.
SystemC for SoC Designs
Design Flow System Level
An Introduction to Java – Part I, language basics
Integer Square Root Lecture L8.0.
Design & Co-design of Embedded Systems
Programming Language C Language.
Behavioral modeling of a dual ported register set.
Names of variables, functions, classes
Presentation transcript:

CPE 626 The SystemC Language Aleksandar Milenkovic Web:

 A. Milenkovic 2 Outline  Writing testbenches  SystemC types  Arrays  Resolved Logic Vector  Clocks

 A. Milenkovic 3 Test Benches  Creating test benches  one process to generate stimulus, the other one to test results  stimulus are generated in the main program, another process test the results  generated and testing are both done in the main program  Typical approach

 A. Milenkovic 4 Example: Counter // Filename : count.h #include "systemc.h" SC_MODULE(count) { sc_in load; sc_in din; sc_in clock;// input ports sc_out dout;// output port int count_val; // internal data st. void count_up(); SC_CTOR(count) { SC_METHOD(count_up); // Method proc. // Sensitive to Rising edge clock sensitive_pos << clock; } }; // Filename : count.cpp #include "count.h" void count::count_up() { if (load) { count_val = din; } else { // Read/Write of local storage count_val = count_val + 1; } // Write to Output port dout = count_val; }

 A. Milenkovic 5 Example: Testbench for Counter #include "systemc.h" SC_MODULE(count_stim) { sc_out load; sc_out din; // input port sc_in clock; // input port sc_in dout; void stimgen(); SC_CTOR(count_stim) { SC_THREAD(stimgen); sensitive_pos (clock); } }; // count_stim.cc #include "count_stim.h" void count_stim::stimgen() { while (true) { load = true; // load 0 din = 0; wait(); // count up, value = 1 load = false; wait(); // count up, value = 2 wait(); // count up, value = 3 wait(); // count up, value = 4 wait(); // count up, value = 5 wait(); // count up, value = 6 wait(); // count up, value = 7 }

 A. Milenkovic 6 Example: Main #include "count.h" #include "count_stim.h" #include "display.h" int sc_main(int argc, char* argv[]) { sc_signal LOAD; sc_signal DIN, DOUT; // clock sc_clock CLOCK("clock", 20); intsim_time = 0; if (argc==2) sim_time = atoi(argv[1]); if (sim_time==0) sim_time = 1000; count u_count ("count"); u_count.load(LOAD); u_count.din(DIN); u_count.dout(DOUT); u_count.clock(CLOCK); count_stim u_count_stim("count_stim"); u_count_stim.load(LOAD); u_count_stim.din(DIN); u_count_stim.dout(DOUT); u_count_stim.clock(CLOCK); display u_display("display"); u_display.dout(DOUT); sc_initialize(); sc_start(sim_time); return(0); }

 A. Milenkovic 7 SystemC Types  SystemC programs may use any C++ type along with any of the built-in ones for modeling systems  long, int, char, short, float, double  SystemC Built-in Types  sc_bit (0, 1), sc_logic (0, 1, X, Z) oTwo- and four-valued single bit

 A. Milenkovic 8 SystemC Types  SystemC Built-in Types  sc_int, sc_unint o1 to 64-bit signed and unsigned integers  sc_bigint, sc_biguint oarbitrary (fixed) width signed and unsigned integers  sc_bv, sc_lv oarbitrary width two- and four-valued vectors  sc_fixed, sc_ufixed osigned and unsigned fixed point numbers  User defined constructs

 A. Milenkovic 9 Ports, Reading&Writing ports  Read&Writing ports  Use read() or write() methods, or  Use assignment operator sc_in // input port of type porttype sc_out // output port of type porttype sc_inout // inout port of type porttype porttype may be any of the types discussed

 A. Milenkovic 10 Arrays sc_in a[32]; // creates ports a[0] to a[31] // of type sc_logic sc_signal i[16]; // creates signals i[0] to // i[15] of type sc_logic

 A. Milenkovic 11 Resolved Logic Vector  More than one driver is driving a signal sc_in_rv x; //input resolved logic vector n bits wide sc_out_rv y;// output resolved logic vector n bits wide sc_inout_rv z; // inout resolved logic vector n bits wide Resolved logic vector port:

 A. Milenkovic 12 Resolved Vector Signals  Used to connect resolved logic vector ports sc_signal_rv sig3; // resolved logic vector signal // n bits wide Resolved logic vector signal:

 A. Milenkovic 13 Clocks  Create clock object named clock1  clock period is 20 time units  duty cycle is 50%  first edge will occur at 2 time units  first value will be true sc_clock clock1("clock1", 20, 0.5, 2, true);