Part 6: VHDL simulation. Introduction to Modeling and Verification of Digital Systems. Elaboration and simulation. Elaboration and simulation

Similar documents
Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

Concurrent Signal Assignment Statements (CSAs)

Specifying circuit properties in PSL. (Some of this material is due to Cindy Eisner and Dana Fisman, with thanks) See also the Jasper PSL Quick Ref.

C-Based Hardware Design

Hardware Description Languages. Modeling Complex Systems

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

VHDL simulation and synthesis

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

Specifications Part 3

Hardware Description Language VHDL (1) Introduction

Sequential VHDL. Katarzyna Radecka. DSD COEN 313

5. VHDL - Introduction - 5. VHDL - Design flow - 5. VHDL - Entities and Architectures (1) - 5. VHDL - Entities and Architectures (2) -

OUTLINE SYSTEM-ON-CHIP DESIGN. GETTING STARTED WITH VHDL September 3, 2018 GAJSKI S Y-CHART (1983) TOP-DOWN DESIGN (1)

SECTION 1 FAMILIARIZATION WITH VHDL

ON THE EFFECTIVENESS OF ASSERTION-BASED VERIFICATION

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

IP Core Design. Lecture 11 Introduction to PSL

Part IV. Behavioural Description Using VHDL

What Is VHDL? VHSIC (Very High Speed Integrated Circuit) Hardware Description Language IEEE 1076 standard (1987, 1993)

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

Embedded Systems CS - ES

Modeling Complex Behavior

Property-based design with HORUS / SYNTHORUS

Review of Digital Design with VHDL

Discrete Event Models

Contents. Appendix D VHDL Summary Page 1 of 23

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

Digital Systems Design

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

EEL 4783: Hardware/Software Co-design with FPGAs

TKT-1212 Digitaalijärjestelmien toteutus. Lecture 7: VHDL Testbenches Ari Kulmala, Erno Salminen 2008

Discrete Event Models

Specifying time in VHDL

Getting Started with Xilinx WebPack 13.1

CSI33 Data Structures

ECE U530 Digital Hardware Synthesis. Course Accounts and Tools

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

Tutorial 4 HDL. Outline VHDL PROCESS. Modeling Combinational Logic. Structural Description Instantiation and Interconnection Hierarchy

Introduction to VHDL. Main language concepts

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

VHDL Structural Modeling II

Module 2.1 Gate-Level/Structural Modeling. UNIT 2: Modeling in Verilog

VHDL: A Crash Course

1. Using the for-generahon scheme, concurrent statements can be replicated a predetermined number of times.

Declarations of Components and Entities are similar Components are virtual design entities entity OR_3 is

Sugar 2.0 An Introduction

Basic Language Concepts

VHDL Simulation. Testbench Design

P2VSIM: A SIMULATION AND VISUALIZATION TOOL FOR THE P2V COMPILER. A Thesis OSCAR MICHAEL ALMEIDA

Step 1 in transitioning to behavioral modeling. But here 1-to-1 with our gate level model.

Test Benches - Module 8

N-input EX-NOR gate. N-output inverter. N-input NOR gate

Spiral 1 / Unit 4 Verilog HDL. Digital Circuit Design Steps. Digital Circuit Design OVERVIEW. Mark Redekopp. Description. Verification.

COE 405 Design Methodology Based on VHDL

Mridula Allani Fall Fall

Lecture 5: Aldec Active-HDL Simulator

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

6.111 Lecture # 5. Entity section describes input and output. VHDL: Very High speed integrated circuit Description Language:

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

IEEE LANGUAGE REFERENCE MANUAL Std P1076a /D3

CSC2108: Automated Verification Assignment 1 - Solutions

VHDL Basics. Mehdi Modarressi. Department of Electrical and Computer Engineering, University of Tehran. ECE381(CAD), Lecture 4:

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification

ECE 3401 Lecture 10. More on VHDL

VHDL: RTL Synthesis Basics. 1 of 59

Lab 1 Modular Design and Testbench Simulation ENGIN 341 Advanced Digital Design University of Massachusetts Boston

Outline of this Introduction to VHDL

Test Bench. Top Level Model Test Bench MUT

Subject: Scheduling Region Questions and Problems of new SystemVerilog commands

Introduction to VHDL Lecture D

1 Design Process HOME CONTENTS INDEX. For further assistance, or call your local support center

Lecture 12 VHDL Synthesis

Overview. Design flow. Principles of logic synthesis. Logic Synthesis with the common tools. Conclusions

Assertion Checker Synthesis for FPGA Emulation

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

VHDL Examples Mohamed Zaky

Chapter 6 Combinational-Circuit Building Blocks

EECE-4740/5740 Advanced VHDL and FPGA Design. Lecture 3 Concurrent and sequential statements

Synthesis of Digital Systems CS 411N / CSL 719. Part 3: Hardware Description Languages - VHDL

Programming with HDLs

PART I BASIC DIGITAL CIRCUITS

VHDL Testbench Design. Textbook chapters 2.19, , 9.5

JUNE, JULY 2013 Fundamentals of HDL (10EC45) PART A

Efficient Modeling and Verification of Analog/Mixed-Signal Circuits

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

Lecture 4. VHDL Fundamentals. Required reading. Example: NAND Gate. Design Entity. Example VHDL Code. Design Entity

Hardware description languages

Quartus Counter Example. Last updated 9/6/18

Introduction to VHDL. Yvonne Avilés Colaboration: Irvin Ortiz Flores Rapid System Prototyping Laboratory (RASP) University of Puerto Rico at Mayaguez

RTL Implementation. Introduction to Structured VLSI Design. Concurrent Statements and Processes. Combinational and Sequential Logic.

The process. Sensitivity lists

HDL. Hardware Description Languages extensively used for:

CS429: Computer Organization and Architecture

Lecture 4. VHDL Fundamentals. George Mason University

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

CS221: VHDL Models & Synthesis

Lecture 2 Hardware Description Language (HDL): VHSIC HDL (VHDL)

VHDL Sample Slides Rev Sample Slides from the 2-day and 4-day VHDL Training Courses

EE261: Intro to Digital Design

Transcription:

M Informatique / MOIG Introduction to Modeling and Verification of Digital ystems Part 6: VHDL simulation Laurence PIERRE http://users-tima.imag.fr/amfors/lpierre/marc 27/28 37 Elaboration and simulation Elaboration and simulation! Compilation consists in the analysis of the source description and the generation of an intermediate code, stored in a design library. Elaboration is the process of building a complete and consistant simulation model from the various compiled units.! Compilation, elaboration, simulation:! The elaboration of a design hierarchy creates a model as a collection of processes.! Finally, simulation of this model proceeds. It consists in the repetitive execution of the simulation cycle. 38 http://www.pldworld.com/_hdl//www.ireste.fr/fdl/vcl/lesd/vstruct.htm 39

imulation loop imulation loop! The simulation process starts with the initialization phase, in which:! After initialization, the simulation loop is as follows (very simplified view) :! The current simulation time T c is ns! while T c < TIME'HIGH do! ignals are initialized, resolved and assigned values - each explicit (and implicit) signal is updated! Processes are executed until their suspension on an explicit or implicit wait statement! Note. A resolved type includes in its definition a resolution function. A resolution function defines how the values of multiple sources of a given signal are to be resolved into a single value for that signal. 4 - for each process P, if P is currently sensitive to a signal and if an event has occurred on in this simulation cycle, then P resumes - T c is computed as the earliest of TIME'HIGH and the next time at which a signal has to be updated end while! Reminder: When a signal value is updated (i.e., a transaction is scheduled), if the new value is different from the previous one, then an event is said to have occurred on the signal 4! Along the simulation, the projected output waveform of a signal is stored in a driver (each process that performs assignment(s) to a given signal implicitly contains a driver for that signal)! A driver is an ordered series of value/time pairs, called transactions! Example signal step: integer := ;... step <= after 5 ns, 2 after ns, after 5 ns, after 2 ns;! The value is the new value for the signal, associated with the time when this value will (might) be assigned! The time is determined by the current simulation time added to the value of the time expression in the corresponding assignment 2 5 ns ns 5 ns 2 ns 42 43

! In a signal assignment statement, the waveform can be preceded by the keyword transport or inertial (default mode). We mainly study the inertial mode assignment here.! The inertial mode signal assignment allows an accurate description of gate behaviour, by delaying signals and filtering glitches (small pulses). It enables to model a component that reacts only if an input value remains stable long enough. The transport mode is mainly used for transmission lines modeling.! The effect of the inertial mode signal assignment on the signal driver is:! all transactions previously scheduled to occur after the new transaction are removed! the new transaction is appended! for all existing transactions scheduled to occur before the new transaction:! all transactions up to the last one with a different value from the new transaction are deleted! the remaining transactions with the same value as the new transaction are kept 44 45! Example: let us come back to the example of slide 62 A B 2! Example: let us come back to the example of slide 62 A B 2! Remember that a natural dataflow description is architecture RTL of Example is signal s,s2: Bit; end RTL; 46! but we choose the following one (silly, but more illustrative here) architecture silly of Example is signal X,Y: Bit; process(a,b,x,y) X <= not A after 2 ns; Y <= X nand B after 5 ns; <= X and Y after 4 ns; end process; end silly; 48

! Example: suppose that, at ns, we have reached the following configuration (X='', Y='', ='') A B and that, at 2 ns, A becomes '' X Y! Example: at 2 ns A becomes ''! The process is activated and the drivers are updated as follows! T c =22 ns, X is updated (X <- ''), and the drivers are updated as follows process(a,b,x,y) X <= not A after 2 ns; Y <= X nand B after 5 ns; <= X and Y after 4 ns; end process; A B! T c =24 ns, a transaction occurs on X, but it is not an event (the process does not resume)! 49 5! Example:! T c =26 ns, is updated ( <- ''), the current status of the drivers is process(a,b,x,y) X <= not A after 2 ns; Y <= X nand B after 5 ns; <= X and Y after 4 ns; end process;! Example:! T c =3 ns, is updated ( <- ''), the current status of the drivers is process(a,b,x,y) X <= not A after 2 ns; Y <= X nand B after 5 ns; <= X and Y after 4 ns; end process;! 32!! T c =27 ns, Y is updated (Y <- ''), A B! T c =32 ns, a transaction occurs on Y, but it is not an event (the process does not resume) and the drivers are updated as follows! The final status is! T c =29 ns, a transaction occurs on X, but it is not an event (the process does not resume) A B 5 52

Delta delay Delta delay! But: if the assignments have no after clause? In that case, the notion of delta delay is used! Delta delays can be thought of as infinitesimal delays. A delta delay simply models a progress to the next simulation cycle (without modification of the physical time)! everal delta delays can succeed each other, up to stabilization of the values of the signals! Example: full-adder and its testbench entity full_adder is port(x,y,cin : in Bit; um,cout : out Bit); end full_adder; architecture Dataflow_view of full_adder is signal : Bit; <= X xor Y; um <= xor Cin; Cout <= (X and Y) or ( and Cin); end Dataflow_view; 53 54 Delta delay Delta delay entity test is end test;! Example: full-adder and its testbench architecture truct of test is component full_adder entity full_adder is port(x,y,cin: in Bit; um,cout: out Bit); end component; port(x,y,cin : in signal Bit; A,B,C,,C2 : Bit; um,cout : out for F: Bit); full_adder use end full_adder; entity work.full_adder(dataflow_view); F: full_adder port map(a,b,c,,c2); architecture Dataflow_view A <= '' of after full_adder ns; is signal : Bit; B <= '' after ns; C <= '' after ns; end truct; <= X xor Y; um <= xor Cin; Cout <= (X and Y) or ( and Cin); end Dataflow_view;! Example: full-adder and its testbench! T c = ns! T c = ns <= X xor Y; um <= xor Cin; Cout <= (X and Y) or ( and Cin); 55 56

Delta delay! Example: full-adder and its testbench! T c = ns + Δ Part 7: VHDL and temporal assertions! T c = ns + 2Δ <= X xor Y; um <= xor Cin; Cout <= (X and Y) or ( and Cin); 57 58 Boolean assertions Boolean assertions! The assert statement enables to monitor Boolean assertions assert condition report message severity level;! When this statement is executed, the condition is evaluated. If it is false, the message is printed and an action is associated with the severity level (it depends on the simulator)! The severity level can be note, warning, error (default), or failure. In general, error makes the simulation stop! But this construct does not allow to check properties that need to be evaluated along several simulation steps! The assert statement enables to monitor Boolean assertions assert condition report message severity level;! When this statement is executed, the condition is evaluated. If it is false, the message is printed and an action is associated with the severity level (it depends on the simulator)! The severity level can be note, warning, error (default), or failure. In general, error makes the simulation stop! But this construct does not allow to check properties that need to be evaluated along several simulation steps Temporal assertions 59 6

Temporal assertions Temporal assertions! Example : elevator controller! Everytime the elevator is called at a floor number k, it will eventually reach that floor! Example 2: parking gate controller! Everytime the system is in state "output gate closed" and a valid ticket is inserted, then the gate should open within clock cycles! The PL language (Property pecification Language, IEEE standard 85) enables to formalize temporal assertions and to associate them with HDL descriptions, in particular VHDL descriptions! These PL assertions express temporal properties that involve the signals of the description (primary inputs/ outputs or internal signals)! PL is mainly inspired by the temporal logics LTL (Linear-time Temporal Logic) and CTL (Computation Tree Logic) 6 62 Temporal assertions PL (IEEE std 85) CTL! A glance at LTL (Linear-time Temporal Logic) and CTL (Computation Tree Logic) LTL https://mialmanach.mit.bme.hu/erdekessegek/temporalis_logika 63! The FL (Foundation Language) class of PL formulas proposes temporal operators that are similar to the ones of LTL. PL also enables the specification of properties in terms of sequences of events, thanks to EREs (equential Extended Regular Expressions)! Note that PL properties can be verified! By formal analysis (model checking), see for instance MV (Cadence), or RuleBase (IBM)! By dynamic verification (during simulation), studied here. In that case, the properties must conform to the PL simple subset (conforms to the notion of monotonic advancement of time) 64

PL semantics PL semantics! The semantics of PL properties is defined with respect to execution traces i.e., words over the alphabet 2 P, where P is a set of atomic propositions! Examples of atomic propositions: "the elevator is called at a floor number k", "a valid ticket is inserted",! These execution traces are built by sampling the simulation on specific events! If all the PL assertions require a sampling on the clock rising edges, it is sufficient to declare, before the assertions: default clock is (clk'event and clk='');! The satisfaction of a formula ϕ on a trace v, denoted as v = ϕ, is defined as follows, for Boolean expressions and for the basic temporal operators next! and until!! v = b v = or b holds on v! v = ϕ ψ v = ϕ and v = ψ! v = next! ϕ v > and v.. = ϕ! v = ϕ until! ψ k < v s.t. v k.. = ψ and j < k, v j.. = ϕ next! ϕ ϕ until! ψ 65 66 PL semantics Back to the examples! ome derived operators! Eventually: eventually! ϕ = true until! ϕ! Always: always ϕ = eventually! ( ϕ) = (true until! ϕ)! Before: ϕ before! ψ = ψ until! (ϕ ψ)! Next_event: next_event!(b)(ϕ) = b until! (b ϕ)! Next_a: next_a! [i..j] ϕ = next! [i] ϕ next! [j] ϕ! Next_e: next_e! [i..j] ϕ = next! [i] ϕ next! [j] ϕ! And some ERE operators! { s ; s2 } is the concatenation of two EREs s and s2! s[*] means, or several times s, and s[+] means or several times s! s -> ϕ is the (overlapping) suffix implication! Example : elevator controller! Everytime the elevator is called at a floor number k, it will eventually reach that floor always(req k -> eventually!(at k ))! Example 2: parking gate controller! Everytime the system is in state "output gate closed" and a valid ticket is inserted, then the gate should open within clock cycles always(state = gate_closed and valid_ticket -> next_e![..]open) 67 68

Example with a VHDL description Example with a VHDL description! Let us consider the VHDL description of an elevator controller, in a 3 levels building! 3 buttons inside the elevator (e, e2, e3) and 3 buttons outside (req, req2, req3)! ignal r k means a request at level k! ignal go k means go to level k ATa AT --- B2 -- -- AT2a - - - AT2 Arrow labelling : go go2 go3 up --- - B23 -- -- AT3a AT3 -- -- -- -- --- Elevator leaving level 3 Elevator moving between levels 2 and 3 Elevator stopped at level 3 69! VHDL description entity Elevator is port(e,e2,e3,req,req2,req3,ck:in Bit); end Elevator; architecture Behav_RTL of Elevator is type TATE is (ATa,AT,B2,AT2,AT2a,B23,AT3,AT3a); signal TATE: TATE; signal GO, GO2, GO3, R, R2, R3, UP : Bit ; process wait until Ck'event and Ck = ''; case TATE is when ATa => if (GO='') then TATE <= AT; elsif ((GO2 or GO3) = '') then TATE <= B2; end if; when AT => TATE <= ATa; when B2 => if (GO = '') and (UP='') then TATE <= AT; elsif (GO2 = '') and (UP='') then TATE <= AT2; elsif (GO3 = '') and (UP='') then TATE <= B23; end if;... end case; 7 Example with a VHDL description Example with a ERE! VHDL description if (TATE /= AT) and ((Req or E) = '') then R <= ''; elsif (TATE = AT) then R <= ''; end if; if (TATE /= AT2) and ((Req2 or E2) = '') then R2 <= ''; elsif (TATE = AT2) then R2 <= ''; end if; if (TATE /= AT3) and ((Req3 or E3) = '') then R3 <= ''; elsif (TATE = AT3) then R3 <= ''; end if; case TATE is when AT => GO <= ''; when ATa => UP <= ''; if (R='') then GO <= ''; end if; if (R2='') then GO2 <= ''; end if; if (R3='') then GO3 <= ''; end if ; when AT2 => GO2 <= '';... end case; end process; end Behav_RTL; always(r -> eventually!(state = at)) always(r2 -> eventually!(state = at2)) always(r3 -> eventually!(state = at3))! HDLC (High-Level Data Link Control) network interface! When the abort sequence is recognized (seven consecutive ones), the AbortFound signal must be set before the arrival of a new frame (tartofframe) default clock is (RxDataEnOut'event and RxDataEnOut=''); property HDLC_ : always({ not RxData ; RxData[*7] } -> AbortFound before! tartofframe); HDLC_..! 7 72

What should I remember 73