331 W05.1Fall 2003 14:332:331 Computer Architecture and Assembly Language Fall 2003 Week 5 [Adapted from Dave Patterson’s UCB CS152 slides and Mary Jane.

Slides:



Advertisements
Similar presentations
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Advertisements

331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
14:332:331 Computer Architecture and Assembly Language Spring 06 Week 4: Addressing Mode, Assembler, Linker [Adapted from Dave Patterson’s UCB CS152 slides.
02/02/20091 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Week 6.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 6 VHDL Programming [Adapted from Dave Patterson’s UCB CS152.
Sistemas Digitais I LESI - 2º ano Lesson 5 - VHDL U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes Dept.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ECE 232 L4 perform.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 4 Performance,
1/31/20081 Logic devices can be classified into two broad categories Fixed Programmable Programmable Logic Device Introduction Lecture Notes – Lab 2.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
331 W05.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 5: VHDL Programming [Adapted from Dave Patterson’s UCB CS152.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
331 Practice Exam.1Fall 2003 Naming Conventions for Registers 0$zero constant 0 (Hdware) 1$atreserved for assembler 2$v0expression evaluation & 3$v1function.
Week 6.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 6 [Adapted from Dave Patterson’s UCB CS152 slides and Mary.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
1 H ardware D escription L anguages Basic Language Concepts.
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
ECE 2372 Modern Digital System Design
CS35101 Computer Architecture Spring 2006 Week 5 Paul Durand ( Course url:
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
1 H ardware D escription L anguages Modeling Digital Systems.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
ENG241 Digital Design Week #4 Combinational Logic Design.
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.
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
CS Computer Architecture Spring 2006 Week 6/7 Paul Durand ( Course url:
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
Fall 08, Oct 29ELEC Lecture 7 (updated) 1 Lecture 7: VHDL - Introduction ELEC 2200: Digital Logic Circuits Nitin Yogi
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
EKT 221 : Chapter 4 Computer Design Basics
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
5-1 Logic System Design I VHDL Design Principles ECGR2181 Reading: Chapter 5.0, 5.1, 5.3 port ( I: in STD_LOGIC_VECTOR (1 to 9); EVEN, ODD: out STD_LOGIC.
EE121 John Wakerly Lecture #17
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Digital Design Using VHDL and PLDs ECOM 4311 Digital System Design Chapter 1.
Apr. 3, 2000Systems Architecture I1 Introduction to VHDL (CS 570) Jeremy R. Johnson Wed. Nov. 8, 2000.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Basic Language Concepts
Systems Architecture Lab: Introduction to VHDL
CSE 331 Computer Organization and Design Fall 2007 Week 6
ENG2410 Digital Design “Combinational Logic Design”
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
CS/COE0447 Computer Organization & Assembly Language
ECE 434 Advanced Digital System L08
VHDL VHSIC Hardware Description Language VHSIC
VHDL Discussion Subprograms
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL Discussion Subprograms
Levels in Processor Design
COE 202 Introduction to Verilog
EEL4712 Digital Design (VHDL Tutorial).
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

331 W05.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Week 5 [Adapted from Dave Patterson’s UCB CS152 slides and Mary Jane Irwin’s PSU CSE331 slides]

331 W05.2Fall 2003 Head’s Up  This week’s material l Introduction to VHDL -Reading assignment – Y, Chapters 1 through 3  Next week’s material l VHDL modeling -Reading assignment – Y, Chapter 4 and 5 l MIPS arithmetic operations -Reading assignment – PH 4.1 through 4.3

331 W05.3Fall 2003 To make the architect’s crucial task even conceivable, it is necessary to separate the architecture, the definition of the product as perceivable by the user, from its implementation. Architecture versus implementation defines a clean boundary between parts of the design task, and there is plenty of work on each side of it. The Mythical Man-Month, Brooks, pg. 256

331 W05.4Fall 2003 Review: MIPS ISA CategoryInstrOp CodeExampleMeaning Arithmetic (R & I format) add0 and 32add $s1, $s2, $s3$s1 = $s2 + $s3 subtract0 and 34sub $s1, $s2, $s3$s1 = $s2 - $s3 add immediate8addi $s1, $s2, 6$s1 = $s2 + 6 or immediate13ori $s1, $s2, 6$s1 = $s2 v 6 Data Transfer (I format) load word35lw $s1, 24($s2)$s1 = Memory($s2+24) store word43sw $s1, 24($s2)Memory($s2+24) = $s1 load byte32lb $s1, 25($s2)$s1 = Memory($s2+25) store byte40sb $s1, 25($s2)Memory($s2+25) = $s1 load upper imm15lui $s1, 6$s1 = 6 * 2 16 Cond. Branch (I & R format) br on equal4beq $s1, $s2, Lif ($s1==$s2) go to L br on not equal5bne $s1, $s2, Lif ($s1 !=$s2) go to L set on less than0 and 42slt $s1, $s2, $s3if ($s2<$s3) $s1=1 else $s1=0 set on less than immediate 10slti $s1, $s2, 6if ($s2<6) $s1=1 else $s1=0 Uncond. Jump (J & R format) jump2j 2500go to jump register0 and 8jr $t1go to $t1 jump and link3jal 2500go to 10000; $ra=PC+4

331 W05.5Fall 2003 Review: MIPS Organization, so far Processor Memory 32 bits 2 30 words read/write addr read data write data word address (binary) 0…0000 0…0100 0…1000 0…1100 1…1100 Register File src1 addr src2 addr dst addr write data 32 bits src1 data src2 data 32 registers ($zero - $ra) PC ALU byte address (big Endian) Fetch PC = PC+4 DecodeExec Add 32 4 Add 32 br offset

331 W05.6Fall 2003 Processor Organization  Processor control needs to have the l Ability to input instructions from memory l Logic to control instruction sequencing and to issue signals that control the way information flows between the datapath components and the operations performed by them  Processor datapath needs to have the l Ability to load data from and store data to memory l Interconnected components - functional units (e.g., ALU) and storage units (e.g., Register File) - for executing the ISA  Need a way to describe the organization l High level (block diagram) description l Schematic (gate level) description l Textural (simulation/synthesis level) description

331 W05.7Fall 2003 Levels of Description of a Digital System Architectural Functional/Behavioral Register Transfer Logic Circuit models programmer's view at a high level; written in your favorite programming language more detailed model, like the block diagram view model is in terms of datapath FUs, registers, busses; register xfer operations are clock phase accurate model is in terms of logic gates; delay information can be specified for gates; digital waveforms model is in terms of circuits (electrical behavior); accurate analog waveforms Less Abstract More Accurate Slower Simulation Special languages + simulation systems for describing the inherent parallel activity in hardware (VHDL and verilog) Schematic capture + logic simulation package like LogicWorks

331 W05.8Fall 2003 Why Simulate First?  Physical breadboarding (as in CSE 275) l discrete components/lower scale integration precedes actual construction of the prototype l verification of the initial design  No longer possible as designs reach higher levels of integration!  Simulation before construction - aka functional verification l high level constructs means faster to design and test l can play “what if” more easily l limited performance (can’t usually simulate all possible input transitions) and accuracy (can’t usually model wiring delays accurately), however

331 W05.9Fall 2003 VHDL (VHSIC Hardware Description Language)  Goals: l Support design, documentation, simulation & verification, and synthesis of hardware l Allow integrated design at multiple levels - behavioral and structural (gate level)  Concepts: l Design entity-architecture descriptions l Time-based execution (discrete event simulation) model Design Entity-Architecture == Hardware Component Entity == External Characteristics Architecture (Body ) == Internal Behavior or Structure

331 W05.10Fall 2003 Entity Interface  Externally visible characteristics l Ports: channels of communication -(inputs, outputs, clocks, control) l Generic parameters: define class of components -(timing characteristics, size, fan-out) entity name_of_component is port(a,b: in std_logic; y: out std_logic); end name_of_component;

331 W05.11Fall 2003 Architecture Body  Internal behavior or structure of circuit l Declaration of module’s internal signals l Description of behavior of circuit -concurrent behavioral description - collection of Concurrent Signal Assignment (CSA) statements executed concurrently -process behavioral description - CSAs and variable assignment statements within a process description -structural description - system described in terms of the interconnections of its components architecture behavioral of name_of_component is signal s1,s2: std_logic; begin - description of behavior of ports and signals; end behavioral;

331 W05.12Fall 2003 VHDL Example: nor-nor gate entity nor_nor_logic is port (a,b,c: in std_logic; y: out std_logic); end nor_nor_logic; architecture concurrent_behavior of nor_nor_logic is signal t0: std_logic; begin t0 <= a nor b; y <= t0 nor c; end concurrent_behavior; a b t0 y c

331 W05.13Fall 2003 Things to Notice  <= indicates a Concurrent Signal Assignment (CSA) l like “real” logic, nor_nor “process” is in an infinite loop  t0 and y are signals, not variables l they change when ever the inputs (a, b, or c) change l std_logic conforms to the IEEE 1164 standard library IEEE; use IEEE.std_logic_1164.all; entity nor_nor_logic is...

331 W05.14Fall 2003 Modeling Delays  Can model temporal, as well as functional behavior, with delays in CSAs l t0 changes 1 ns after a or b changes entity nor_nor_logic is port (a,b,c: in std_logic; y: out std_logic); end nor_nor_logic; architecture concurrent_behavior of nor_nor_logic is signal t0: std_logic; begin t0 <= (a nor b) after 1 ns; y <= (t0 nor c) after 1 ns; end concurrent_behavior;

331 W05.15Fall 2003 Waveforms and Timing abc t0 y ns a b t0 y c

331 W05.16Fall 2003 Review: VHDL  Goals: l Support design, documentation, simulation & verification, and synthesis of hardware l Allow integrated design at multiple levels - behavioral and structural (gate level)  Concepts: l Design entity-architecture descriptions l Time-based execution (discrete event simulation) model Design Entity-Architecture == Hardware Component Entity == External Characteristics Architecture (Body ) == Internal Behavior or Structure

331 W05.17Fall 2003 Review: An Entity-Architecture Example entity nor_nor_logic is port(a,b,c: in std_logic; y: out std_logic); end nor_nor_logic; architecture concurrent_behavior of nor_nor_logic is signal t0: std_logic; begin t0 <= (a nor b) after 1 ns; y <= (t0 nor c) after 1 ns; end concurrent_behavior; a b t0 y c

331 W05.18Fall 2003 Entity-Architecture Features  Entity defines externally visible characteristics l Ports: channels of communication -signal names for inputs, outputs, clocks, control l Generic parameters: define class of components -timing characteristics, size (fan-in), fan-out  Architecture defines the internal behavior or structure of circuit l Declaration of internal signals l Description of behavior -concurrent behavioral description: collection of Concurrent Signal Assignment (CSA) statements (indicated by <=) executed concurrently; can also model temporal behavior with the delay annotation -process behavioral description: CSAs and variable assignment statements within a process description -structural description: system described in terms of the interconnections of its components

331 W05.19Fall 2003 New Object: Signals  Digital systems are about signals, not variables signal <= value expressions after time expression l signals are analogous to wires and change when ever their inputs change - time-value pairs resulting in a waveform l std_logic conforms to the 9-value IEEE 1164 standard for signals When a signal has multiple drivers (e.g., a bus), the value of the resulting signal is determined by a resolution function for std_logic and std_logic_vector the resolution function (lookup table) is provided by std_logic_1164 package

331 W05.20Fall 2003 Model of Execution  CSA’s are executed concurrently - textural order of the statements is irrelevant to the correct operation  Two stage model of circuit execution l first stage -all CSA’s with events occurring at the current time on signals on their right hand side (RHS) are evaluated -all future events that are generated from this evaluation are scheduled on the events list l second stage -time is advanced to the time of the next event  VHDL programmer specifies l events - with CSA’s l delays - with CSA’s with delay annotation l concurrency - by having a distinct CSA for each signal

331 W05.21Fall 2003 Constant Objects  Constant parameters provide default values l may be overridden on each instance l attach value to symbol as attribute entity nor_nor_logic is port(a,b,c: in std_logic; y: out std_logic); end nor_nor_logic; architecture concurrent_behavior of nor_nor_logic is signal t0: std_logic; constant gate_delay: Time := 1 ns; begin t0 <= (a nor b) after gate_delay; y <= (t0 nor c) after gate_delay; end concurrent_behavior;

331 W05.22Fall 2003 Bit-Vector Data Types  Std_logic_vector (31 downto 0) is equivalent to a 32-bit bus l Can convert it to a 32 bit integer entity nand32 is port(a,b: in std_logic_vector (31 downto 0); y: out std_logic_vector (31 downto 0)); end nand32; architecture concurrent_behavior of nand32 is begin y <= a nand b; end concurrent_behavior;  Analyzer (compiler) expands the architecture into 32 2-input nand gates with the inputs connected appropriately

331 W05.23Fall 2003 Conditional Signal Assignment Statement  Conditional CSA l order is important - the first conditional expression that evaluates to true determines the output signal entity mux4 is port(In0,In1,In2,In3: in std_logic_vector (7 downto 0); S0,S1: in std_logic; Z: out std_logic_vector (7 downto 0)); end mux4; architecture behavior of mux4 is begin Z <= In0 after 5 ns when S0 = ‘0’ and S1 = ‘0’ else In1 after 5 ns when S0 = ‘0’ and S1 = ‘1’ else In2 after 5 ns when S0 = ‘1’ and S1 = ‘0’ else In3 after 5 ns when S0 = ‘1’ and S1 = ‘1’ else “ ” after 5 ns end behavior; 00 S0 In0 Z S1 In1 In2 In

331 W05.24Fall 2003 Selected Signal Assignment Statement  Selected CSA l all choices are evaluated, but only one must be true entity reg_file is port(addr1,addr2: in std_logic_vector (1 downto 0); dout1, dout2: out std_logic_vector (31 downto 0)); end reg_file; architecture behavior of reg_file is signal reg0: std_logic_vector (31 downto 0) := to_stdlogicvector (x” ”); signal reg1,reg2: std_logic_vector (31 downto 0) := to_stdlogicvector (x”ffffffff”); begin with addr1 select dout1 <= reg0 after 5 ns when “00”, <= reg1 after 5 ns when “01”, <= reg2 after 5 ns when others; with addr2 select dout2 <= reg0 after 5 ns when “00”, <= reg1 after 5 ns when “01”, <= reg2 after 5 ns when others; end behavior;

331 W05.25Fall 2003 Summary  Introduction to VHDL l A language to describe hardware -entity = symbol, architecture ~ schematic, signals = wires l Inherently concurrent (parallel) l Has time as concept l Behavioral descriptions of a component -can be specified using CSAs -can be specified using one or more processes and sequential statements l Structural descriptions of a system are specified in terms of its interconnections -behavioral models of each component must be provided