The continuation of a grand tour of the language.

Slides:



Advertisements
Similar presentations
1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
Advertisements

L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
History TTL-logic PAL (Programmable Array Logic)
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
Sequential Statements Module F3.2. Sequential Statements Statements executed sequentially within a process If Statements Case Statements Loop Statements.
Topics Entity DeclarationsEntity Declarations Port ClausePort Clause Component DeclarationComponent Declaration Configuration DeclarationConfiguration.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Package with 4-valued logic Signal Attributes Assertion Data Flow description.
9/15/09 - L25 Registers & Load Enable Copyright Joanne DeGroat, ECE, OSU1 Registers & Load Enable.
Introduction to VHDL (part 2)
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
L16 – Testbenches for state machines. VHDL Language Elements  More examples HDL coding of class examples Testbench for example  Testing of examples.
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
L16 – VHDL for State Machines with binary encoding.
2-Jun-16EE5141 Chapter 3 ä The concept of the signal ä Process concurrency ä Delta time ä Concurrent and sequential statements ä Process activation by.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Generate Statement A generate statement provides a mechanism for iterative or conditional elaboration of a portion of description. The iterative elaboration.
L13 – VHDL Language Elements. VHDL Language Elements  Elements needed for FPGA design Types  Basic Types  Resolved Types – special attributes of resolved.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
9/4/ L6 Language Overview I Copyright 2006, Joanne DeGroat, ECE, OSU 1 Language Overview I The start of a grand tour of the language.
Behavioural modelling Lecture 3. Outline 3.1. Processes. Sequential statements. WAIT statement Simulation mechanism Sequential signal assignment.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Relational Operators Result is boolean: greater than (>) less than (=) less than or equal to (
Midterm Exam ReviewCopyright Joanne DeGroat, ECE, OSU1 Midterm Exam Notes.
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
1/20/ L8 Language Overview III Copyright Joanne DeGroat, ECE, OSU1 Language Overview III The finish of a grand tour of the language.
Dataflow modelling Lecture 4. Dataflow modelling Specifies the functioning of a circuit without explicitly refer to its structure Functioning is described.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Introduction To VHDL 홍 원 의.
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Some VHDL Details 10/8/08 ECE Lecture 8.
ECE 4110–5110 Digital System Design
Sequential Design.
Behavioral modeling of a dual ported register set.
The finish of a grand tour of the language.
Copyright Joanne DeGroat, ECE, OSU
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Sequential Statements
Copyright Joanne DeGroat, ECE, OSU
Project Step 2 – A single bit slice of the ALU
The start of a grand tour of the language.
The continuation of a grand tour of the language.
VHDL Discussion Subprograms
Copyright Joanne DeGroat, ECE, OSU
VHDL Discussion Subprograms
How do you achieve deterministic concurrent simulation.
Timing & Concurrency II
Copyright Joanne DeGroat, ECE, OSU
An overview of the Verilog HDL.
Behavioral modeling of a dual ported register set.
RASSP Education & Facilitation
Structural Modeling and the Generate Statement
Project Step 2 – A single bit slice of the ALU
Copyright Joanne DeGroat, ECE, OSU
Timing & Concurrency II
Behavioural modelling
Timing & Concurrency II
Sequntial-Circuit Building Blocks
The finish of a grand tour of the language.
System Controller Approach
Copyright Joanne DeGroat, ECE, OSU
Project Step 2 – A single bit slice of the ALU
Structural Modeling and the Generate Statement
Digital Design with VHDL
Presentation transcript:

The continuation of a grand tour of the language. Language Overview II The continuation of a grand tour of the language. 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Elements Covered in II Reminder from I: Language overview lectures do not cover all aspects of the language. But they do cover a large portion of it. Concurrent Statements Sequential Statements In Part I covered: TYPES, Declarations, operators, and structural architectures, i.e., component instantiation – a concurrent statement 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU CONCURENT STATEMENTS Concurrent statements are those that can appear between the BEGIN and END of an architecture. With these statements you model the component or system to be modeled These statements execute independent of the order in which they appear in the model. 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

CONCURRENT STATEMENTS Component Instantiation Statement Prior to use the component must be declared and configured in the declarative region of the architecture. LABEL : component_name [generic_map_aspect] [port_map_aspect] (do not use the generic map aspect in this class) 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Component Instantiation Consider that the following is already analyzed and in your library ENTITY wigit IS PORT(p1, p2 : IN BIT); END wigit; ARCHITECTURE Y OF wigit IS …..; ARCHITECTURE Z OF wigit IS …..; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Component Instantiation Then the declaration for use is ARCHITECTURE use_it OF xyz IS COMPONENT wigit PORT(p1, p2 : IN BIT); END COMPONENT: -- and the configuration is FOR C0 : wigit USE ENTITY work.wigit(y); FOR OTHERS : wigit USE ENTITY work.wigit(Z); 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

And use in the architecture SIGNAL A,B,C,D ; BIT; BEGIN CO : wigit PORT MAP (A, B); C1 : wigit PORT MAP (p1 =>C, p2=>D); Component Instantiation is a Concurrent Statement 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements BLOCK STATEMENT::= (the BNF) Block_label: block [guard expression] block_header block_declarative_part (do not use block statement begin in this class) block_statement_part end block [block_label]; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU The block statement - 2 block_header::= [generic_clause [generic_map_aspect;]] [port_clause [port_map_aspect;]] block_declarative_part::= {block_declarative_item} block_statement_part::= {concurrent_statement} 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Block example example_blk: BLOCK (clk= ‘1’ and clk’event) BEGIN Z <= guarded Q1; X <= guarded Q0 AND B; Y <= Q3; END BLOCK example_blk; Note that Z and X are guarded signal assignment statements Scheduling of a new value for Z and X occurs only when the guard is TRUE and a signal on the right hand side has an event while the guard is true 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements PROCESS STATEMENT [process_label:] process [ (sensitivity_list) ] process_declarative_part begin process_statement_part -- {sequential statement} end process [process_label]; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Process Statement process_declarative_part::= subprogram_body type_declaration subtype_declaration constant_declaration variable_declaration file_declaration alias_declaration attribute_declaration attribute_specification use_clause The contents of a process will be covered further in Sequential Statements (i.e. what goes between BEGIN-END) 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements Concurrent Procudure Call – covered later in course Concurrent Assertion Statement Concurrent Signal Assignment Statement Y <= [transport] A AND B OR C [AFTER 35 NS]; --where A, B, and C are type BIT K <= Q + L; --where K, Q, and L are of type integer 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements Examples of the concurrent signal assignment statement Y <= (NOT a AND NOT b AND x(0)) OR (NOT a AND b AND x(1)) OR (a AND NOT b AND x(2)) OR (a AND b AND x(3)); Is the same as Y <= NOT a AND NOT b AND x(0) OR NOT a AND b AND x(1) OR a AND NOT b AND x(2) OR a AND b AND x(3); 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements Compound Waveforms ; --ends the waveform , --separates waveform elements that are generated at the same time Z <= ‘0’ AFTER 4 NS, ‘1’ AFTER 10 NS, ‘0’ AFTER 14 NS, ‘1’ AFTER 20 NS; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements Compound Waveforms ; --ends the waveform , --separates waveform elements that are generated at the same time Z <= ‘0’ AFTER 4 NS, ‘1’ AFTER 10 NS, ‘0’ AFTER 14 NS, ‘1’ AFTER 20 NS; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements Conditional Signal Assignment Statement target <= waveform_1 WHEN condition_1 ELSE waveform_2 WHEN condition_2 ELSE waveform_3 WHEN condition_3 ELSE · · · waveform_n-1 WHEN condition_n-1 ELSE waveform_n; Waveforms 1 through n are only a single waveform. Compound waveforms not allowed. WHEN conditions are Boolean expressions 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Concurrent Statements Selected Signal Assignment Statement with expression select target <= waveform 1 WHEN choice_list 1, waveform 2 WHEN choice_list 2, waveform 3 WHEN choice_list 3, · · · waveform N WHEN choice_list N; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU example with A&B select R <= G0 WHEN “00”, G1 WHEN “01”, G2 WHEN “10”, G3 WHEN “11”; Versus conditional signal assignment description of the same semantics R <= G0 WHEN A&B = “00” else G1 WHEN A&B = “01” else G2 WHEN A&B = “10” else G3; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements Sequential Statements are like the statements of any procedural programming language. They are executed sequentially according to the control flow of the code. Time introduced using special language statements. 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements Those statements allowable between the BEGIN and END of a PROCESS WAIT Statement wait [sensitivity_clause] [condition_clause] [timeout_clause] sensitivity_clause::= on sensitivity_list WAIT ON A,B; sensitivity_list::= signal_name {,signal_name} condition_clause::= until condition WAIT UNTIL A=‘1’; condition::= boolean_expression timeout_clause::= FOR time_expression WAIT FOR 20 NS; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements Assert Statement Signal Assignment Statement (Sequential) <= exactly like a concurrent one only context makes it sequential Variable Assignment Statement := Procedure Call Statement 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements The next few statements are similar to their counterpart in procedural languages such as C IF STATEMENT if condition then sequence_of_statements {elsif condition then sequence_of_statements} [else sequence_of_statements] end if; IF a=‘1’ THEN y<=q; ELSIF b=‘1’ THEN y<=z AFTER 4 NS; ELSE y <= ‘0’; END IF; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements CASE STATEMENT case expression is when choices => sequence_of_statements; end case; CASE state IS WHEN “00” => state <= “01”; WHEN “01” => state <= “10”; WHEN others => state <= “11”; END CASE; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements LOOPS [loop_label:] [iteration_scheme] loop sequence_of_statements; end loop [loop_label]; iteration_scheme::= while condition | for loop_parameter_specification loop_parameter_specification::= identifier in discrete_range 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU Loop Examples while A /= ‘1’ loop sequence_of_statements; --at least one -- sets A end loop; my_loop : for I in 1 to 100 loop sequence_of_statements; end loop my_loop; for OP in OPAND to OPMOVE loop … 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements NEXT STATEMENT NEXT [loop_label] [when condition]; If the condition is true causes termination of the current iteration of the loop and the start of the next iteration. EXIT STATEMENT EXIT [loop_label] [when condition]; Causes exit from the loop when the condition is true. 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Copyright 2006 - Joanne DeGroat, ECE, OSU example for I in PARAMETER’RANGE loop stmt 1; stmt 2; next when C = ‘0’; exit when Q = ‘1’; end loop; J := A + B; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Sequential Statements RETURN STATEMENT RETURN [expression]; Used to complete the execution of a function or procedure A function must have a return statement to return a value A procedure can have a return statement but its return statement must not have a value expression NULL STATEMENT NULL; Does nothing but act as a placeholder. 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU

Example of Process and Sequential Code ARCHITECTURE x of Y IS -- Entity had sig clk,reset,din: IN and qout:OUT -- td_reset and td_in are constants. BEGIN PROCESS (clk) --from Navabi p.45 IF (clk=‘0’ AND clk’event) THEN IF (reset =‘1’) THEN qout <=‘0’ AFTER td_reset; ELSE qout <= din AFTER td_in; END IF; END PROCESS; END x; 1/8/2007 - L7 Language Overview II Copyright 2006 - Joanne DeGroat, ECE, OSU