Aliases Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.

Slides:



Advertisements
Similar presentations
Structural Specification of Hardware Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Advertisements

INTRO TO VHDL Appendix A: page page VHDL is an IEEE and ANSI standard. VHDL stands for Very High Speed IC hardware description language.
LECTURE 4: The VHDL N-bit Adder
Sequential Statements
Lecture 6 Chap 8: Sequential VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Decoders and Encoders Lecture L4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Topics of Lecture Structural Model Procedures Functions Overloading.
1 Lecture 11 Chap 13: Test Benches Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Introduction to VHDL (part 2)
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
Resolved Signals Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Java Building Elements Lecture 2 Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
Design Organization and Parameterization Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
Hardware Design Environment Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 5 Step 2 in behavioral modeling. Use of procedures.
ECE 368 CAD-Based Logic Design Shantanu Dutt Lecture 11 File I/O and Textio in VHDL (courtesy of Karam Chatha, ASU)
Lecture 3 Chap 4 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Capt Michael Tanner Room 2F46A
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
RTL Hardware Design by P. Chu Chapter Basic VHDL program 2. Lexical elements and program format 3. Objects 4. Data type and operators RTL Hardware.
Lecture 2 VHDL: Introduction Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Subprograms Procedures, functions. Subprograms subprogram_body
EE3A1 Computer Hardware and Digital Design Lecture 5 Testbenches and Memories in VHDL.
Basic Concepts in VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Packages and Use Clauses Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
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.
Lecture 5 Chap 6 Package std_logic_arith Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Generate Statements Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Design Methodology Based on VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
INTRO TO VLSI DESIGN (CPE 448) (VHDL Tutorial ) Prof: Asuif Mahmood.
Topics AliasesSubprograms Generics & Configurations.
SUBPROGRAMAS PROCEDIMENTOS procedure average_samples is variable total : real := 0.0; begin assert samples'length > 0 severity failure; for index in samples'range.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Lecture 9 Chap 11: Subprograms Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
VHDL Background Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
1 MIPS VHDL Overview Reference: VHDL Tutorial on CDROM, or Accolade Reference Guide Notes: / / pdf / MIPS_vhdl_notes.pdf.
16/11/2006DSD,USIT,GGSIPU1 Packages The primary purpose of a package is to encapsulate elements that can be shared (globally) among two or more design.
8-Jan-16EE5141 Chapter 6 Subprograms & Packages Subprogram declaration Subprogram body Package declaration Package body Resolution function Subprogram.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Subprograms Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Multiplier: Functions Discussion D7.2 Example 19.
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Combinational logic circuit
Chapter 2. Introduction To VHDL
CPE 528: Session #7 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
HDL Programming Fundamentals
VHDL (VHSIC Hardware Description Language)
CPE/EE 422/522 Advanced Logic Design L11
VHDL Discussion Subprograms
CPE 528: Lecture #3 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
Step 2 in behavioral modeling. Use of procedures.
UNIT 6: Mixed-Type Description
A simple function.
Step 2 in behavioral modeling. Use of procedures.
4-Input Gates VHDL for Loops
Presentation transcript:

Aliases Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University

Aliases Since the main purpose of a VHDL model is to describe a hardware design, it should be made as easy as possible to read and understand Aliases in VHDL provide a means of making model clearer Aliases  alternate names

Aliases for Data Objects Data object such as constants, variables, signals can declare an alias for the object with an alias declaration EBNF: see page 258 Example: Figure 9.1

Fig 9.1 library ieee; use ieee.std_logic_1164.all; use work.alu_types.all, work.io_types.all; architecture structural of controller_system is alias alu_data_width is work.alu_types.data_width; alias io_data_width is work.io_types.data_width; signal alu_in1, alu_in2, alu_result : std_logic_vector(0 to alu_data_width - 1); signal io_data : std_logic_vector(0 to io_data_width - 1); begin end architecture structural;

Aliases for Data Objects Example type register_array is array (0 to 15) of bit_vector(31 downto 0); type register_set is record general_purpose_registers : register_array; program_counter : bit_vector(31 downto 0); program_status : bit_vector(31 downto 0); end record; variable CPU_registers : register_set;

Aliases for Data Objects Example (cont) alias PSW is CPU_registers.program_status; alias PC is CPU_registers.program_counter; alias GPR is CPU_registers.general_purpose_registers; alias SP is CPU_registers.general_purpose_registers(15); alias interrupt_level is PSW(30 downto 26); alias SP is GPR(15); alias interrupt_level : bit_vector(4 downto 0) is PSW(30 downto 26); -- EBNF in page 259

Fig 9.2 function "+" ( bv1, bv2 : bit_vector ) return bit_vector is alias norm1 : bit_vector(1 to bv1'length) is bv1; alias norm2 : bit_vector(1 to bv2'length) is bv2; variable result : bit_vector(1 to bv1'length); variable carry : bit := '0';-- Note that input begin-- may be any slices if bv1'length /= bv2'length then report "arguments of different length" severity failure; else for index in norm1'reverse_range loop result(index) := norm1(index) xor norm2(index) xor carry; carry := ( norm1(index) and norm2(index) ) or ( carry and ( norm1(index) or norm2(index) ) ); end loop; end if; return result; end function "+";

Aliases for Non-Data Items Aliases can also be applied to types, subprograms, packages, entities, Label is the only kinds of items that can not be “ aliased ” EBNF for non data item: see page 261 Examples:

Aliases for Non-Data Items Type alias alias binary_string is bit_vector; variable s1, s2 : binary_string(0 to 7); Literal alias type system_status is (idle, active, overloaded); alias status_type is work.system_types.system_status;

Aliases for Non-Data Items Procedure alias -- the following two procs is defined in arithmetic_ops procedure increment ( bv : inout bit_vector; by : in integer := 1 ); procedure increment ( int : inout integer; by : in integer := 1 ); -- some vhdl program can alias them alias bv_increment is work.arithmetic_ops.increment [ bit_vector, integer ]; alias int_increment is work.arithmetic_ops.increment [ integer, integer ];

Aliases for Non-Data Items Function alias alias "*" is "and" [ bit, bit return bit ]; alias "+" is "or" [ bit, bit return bit ]; alias "-" is "not" [ bit return bit ]; -- then we use the following syntax s <= a * b + (-a) * c; -- operator overloading Note that binary operators must aliased to a function with two parameter

Fig package define alias package DMA_controller_types_and_utilities is alias word is work.cpu_types.word; alias status_value is work.cpu_types.status_value; alias "+" is work.bit_vector_unsigned_arithmetic."+" [ bit_vector, bit_vector return bit_vector ]; end package DMA_controller_types_and_utilities; -- use the above package then we can write Address_reg0:= address_reg0+X ” 0000_0004 ” ;

Alias Declaration An indexed part of a object or a slice of the object can be given alternative names by using an alias declaration. The declaration can be used for signals, variables, or constants. Example: – alias c_flag : BIT is flag_register(3) – alias v_flag : BIT is flag_register(2) – alias n_flag : BIT is flag_register(1) – alias z_flag : BIT is flag_register(0)

Alias Declaration address (11 bits) = page (3 bits) + offset (8 bits) Example: – ALIAS page :BIT_VECTOR (2 DOWNTO 0) IS instr.adr (10 DOWNTO 8); – ALIAS offset : BIT_VECTOR (7 DOWNTO 0) IS instr.adr (7 DOWNTO 0); Assignment: – page <= "001"; – offset <= X"F1"; opcodemodeoffset 3 bits 2 bits 8 bits page 3 bits