Term Project: Overview

Slides:



Advertisements
Similar presentations
Simulation executable (simv)
Advertisements

CS 1220 – Object Oriented Design 1 Project Info Term Project Overview 1.You need to read in a circuit description Consists of list of gates, what nodes.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are crated using the class definition. Programming techniques.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Logic Simulation 3 Outline –Event-driven simulation algorithms –Event-driven simulation implementation Goal –Understand event-driven simulation –Understand.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
ECE 2372 Modern Digital System Design
CS1Q Computer Systems Lecture 8
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 18: Stacks and Queues (part 3)
Stacks. A stack is a data structure that holds a sequence of elements and stores and retrieves items in a last-in first- out manner (LIFO). This means.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
Timing Model VHDL uses the following simulation cycle to model the stimulus and response nature of digital hardware Start Simulation Update Signals Execute.
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay 2 The D FlipFlop The RS flipflop stores one bit of information.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 25 CPU Simulator.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Simulator Outline of MIPS Simulator project  Write a simulator for the MIPS five-stage pipeline that does the following: Implements a subset of.
©2004 Joel Jones 1 CS 403: Programming Languages Lecture 3 Fall 2004 Department of Computer Science University of Alabama Joel Jones.
Mealy and Moore Machines Lecture 8 Overview Moore Machines Mealy Machines Sequential Circuits.
COE 360 Principles of VLSI Design Delay. 2 Definitions.
Structural Description
Hardware Description Languages: Verilog
COMP541 Combinational Logic - 3
Review Array Array Elements Accessing array elements
Data Structures Using C++ 2E
Sequential Circuit Design
Data Structure Interview Question and Answers
VLSI Testing Lecture 5: Logic Simulation
Discussion 2: More to discuss
Verilog Introduction Fall
Verilog-HDL-1 by Dr. Amin Danial Asham.
Extensions, System Outline and Correlation Modes and
VLSI Testing Lecture 5: Logic Simulation
‘if-else’ & ‘case’ Statements
Timing Model Start Simulation Delay Update Signals Execute Processes
COMP541 Combinational Logic - 3
Objectives In this lesson, you will learn to: Define stacks
Term Project: Overview
Vishwani D. Agrawal Department of ECE, Auburn University
Hardware Description Languages: Verilog
ENEE150 Discussion 13 Section 0101 Adam Wang.
Scripts & Functions Scripts and functions are contained in .m-files
ECE 434 Advanced Digital System L08
How does the CPU work? CPU’s program counter (PC) register has address i of the first instruction Control circuits “fetch” the contents of the location.
Information of the LO Subject: Information Theory Domain: Algorithms
Popping Items Off a Stack Lesson xx
Introduction to Verilog
Overview Last Lecture Conversion of two-level logic to NAND or NOR forms Multilevel logic AOI and OAI gates Today Timing and hazards Multiplexers and demultiplexers.
Pointers and Linked Lists
Copyright Joanne DeGroat, ECE, OSU
Levels in Processor Design
Lecture 3 Simulation and Testbench
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Levels in Processor Design
Abstract Data Types and Stacks
How do you achieve deterministic concurrent simulation.
Levels in Processor Design
ECE 352 Digital System Fundamentals
COMP541 Combinational Logic - 3
Data Structures & Algorithms
Copyright Joanne DeGroat, ECE, OSU
Levels in Processor Design
Registers and Counters
CS334: Logisim program lab6
Variables in C Topics Naming Variables Declaring Variables
Final Exam Review Inheritance Template Functions and Classes
ECE 352 Digital System Fundamentals
COE 202 Introduction to Verilog
LINEAR DATA STRUCTURES
Presentation transcript:

Term Project: Overview You need to read in a circuit description Consists of list of gates with their delay and what wires they connect to. Examples. With that description, you’ll create an internal (or in-memory) data structure which represents the circuit E.g., if Wire #4 is an input to a NAND Gate, then Wire #4 will have a pointer to NAND Gate Read in a set of input tests, called the input vector, to initialize the simulation queue. The input vector is simply the set of initial test conditions to exercise E.g., INPUT A 4 1 means at time 4, set input A to 1 Conduct simulation Cause input values to propagate to outputs Visualize (i.e., print) results in a console window or with wxWidgets GUI

Term Project: Wire States A wire can take on any one of three values 0, 1, X X means that the value is unknown This is different from Z, which occurs if a gate is tri-stated (i.e., some capacitive value between 0 and 1) We assume gates will produce 0, 1 or X depending on the three-valued logic outlined in the HW write-up. At time=0, all wires are set to the unknown the value X If an input changes, it will force the associated wire to that particular value NOTE: an input could be changed to have value X

Term Project: Key Application Classes When parsing the circuit, we need to represent it as a data structure Ideally, the data structure will support the operations we need What operations do we need? When a Wire changes value, we need to notify to all the Gates which have this Wire as an input so that they can (if necessary) recalculate their output value. When a Gate recalculates, if its output (after the gate delay time) will change, then it needs to notify its output Wire by scheduling a value change Event on the simulation Queue. So, Gates and Wires need to know of their interconnections We also need Events and a priority Queue to sequence the simulation

Term Project: General Class Structure The most straightforward data structures would be for the Gate and Wire classes to contain pointers to one another We should be able to create a data structure which reflects the interconnections in the circuit Problem! Both classes refer to one another. Who gets included first? Answer: Use a forward declaration (in bold below). class Wire; class Gate { … private: Wire *in1, *in2; Wire *out; } class Gate; class Wire { … private: vector<Gate *> out; }

Term Project: Parsing the Circuit File So, how do we create and connect these Gates and Wires? We will be parsing an input file that has lines like: NAND 5ns 2 4 6 When we parse the keyword NAND, we know we need to create a new Gate of type NAND From the rest of the Gate description line, we know that the NAND Gate has a 5 nanosecond delay and inputs on Wires 2 and 4 and output on Wire 6 NOTE: when you parse the Gate description, you’ll need to get rid of the “ns” on the delay and convert the preceding number to an integer NOTE: the three integers are Wire numbers (see the next slide for suggestions on how to handle these)

Term Project: Parsing the Circuit File Parsing Wire numbers When we encounter a Wire number in the circuit file, this may/may not be the first time that number has appeared Consider Wire #2 from NAND 5ns 2 4 6 If the Wire #2 has not been seen before, we want to create a new Wire object, and somehow associate it with the #2 One design is to give Wire an attribute wireNum A better design is to keep track of all the Wires by an array (or even better, a vector), and let wireArray[2] store a pointer to the Wire #2 Final Process: If necessary, create Wire objects with associated pointers in wireArray[2], [4] and [6] Associate the new NAND Gate to these Wires. Associate the input Wires to Gate they effect.

Term Project: Parsing the Circuit File (Final Details) Consider Wire #2 from NAND 5ns 2 4 6 (cont) If the Wire #2 has already been seen before, wireArray[2] won’t be NULL (because we will have stored its reference), and we can just connect this existing Wire to the associated Gate and the newly-created Gate to this Wire. So, as we parse a line, we create a Gate and any necessary Wires, and hook them up in the data structure!

Term Project: Simulate Circuit/Parse the Vector File Consider the simulation: we can accomplish it in real time or as event driven Real-Time (Clock Driven) A.K.A human-in-the-loop (HITL) Sees the simulation as advancing with each “tick” of a clock Harder to implement and more costly in terms of execution time. Event-Driven (Priority Queue Driven) Events occur at specific times Current Events generate future (queued) Events Easier to implement and less costly than the real time method Assuming an event-driven simulation, the vector file represents the initial simulation conditions (i.e., the initial Events in the simulation Queue) Specifically, we parse the vector file and for each INPUT PAD VALUE DEFINITION we insert a corresponding Event in the Queue Once the vector file is parsed and the Queue is populated with its initial Events, we then simulate by: Pop the top Event e concerning Wire w1 from the Queue Determine if e causes a Gate g to change output Wire w2’s value. If g’s output w2 will change, then schedule a future Event for w2 Apply the effects of e to w1. To store Events build a Queue based on a priority queue (i.e., from the STL)

Term Project: Review Big picture Parse circuit file to create in-memory data structure of Gates and Wires to simulate Parse the vector file to initialize the simulation Queue with initial Wire state (i.e., value) changes Simulate the circuit using Event-driven control by Removing the top Event e in the Queue Determining if e causes a future Wire state change Create and queue any future Wire state changes as new Events Apply e’s effects Print the results of the simulation