Presentation is loading. Please wait.

Presentation is loading. Please wait.

II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링

Similar presentations


Presentation on theme: "II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링"— Presentation transcript:

1 II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링

2 VHDL What is VHDL? VHSIC program
An industry standard language used to describe hardware from the abstract to the concrete level VHSIC Hardware Description Language VHSIC program Very High Speed Integrated Circuit Funded by the USA Department of Defense(DOD). Late 1970s ~ early 1980s Goal : To produce the next generation of integrated circuits 4장. VHDL 개요

3 VHDL History of VHDL Proposed in 1981.
An offshoot of the VHSIC program The DOD mandated that all digital electronic circuits should be described in VHDL. F-22 advanced tactical fighter aircraft was one of the first major government programs to mandate the use of VHDL descriptions for all electronic subsystems in the project. Adopted as the IEEE standard in December 1987. Institute of Electrical and Electronics Engineers IEEE Standard VHDL Revised to IEEE 4장. VHDL 개요

4 VHDL Why proposed VHDL ? Goals of VHDL
The tools that were available to the designers were mostly based at the gate level. The gate-level tools were inadequate for large designs. Goals of VHDL A language that could describe the complex circuits that the designers were trying to describe A language that was a standard 4장. VHDL 개요

5 VHDL Applications of VHDL Documentation Simulation Synthesis
The process of verifying the functional and/or timing characteristics of hardware models at any level of behavior from the abstract to the concrete level Synthesis The process of translating an abstract-level model of hardware into an optimized technology-specific gate-level implementation Currently RTL(Register Transfer Level) synthesis 4장. VHDL 개요

6 HDL Design methodology
Top-down design methodology A practical option to implement the concept, system on a chip Takes the HDL model of hardware, written at a high level of behavioral abstraction, down through intermediate levels, to a low level. As hardware models are translated to progressively lower levels, they become more complex and contain more structural detail. The designers are not overwhelmed with large amounts of unnecessary detail. Abstraction hierarchy Behavioral design : Algorithms RTL design : MUX, ALU, … Logic design : Gates, flip-flops, … Circuit design : Transistors, … Layout design : Polygons 4장. VHDL 개요

7 Top-down Design Advantages of top-down design methodology
Increased productivity yields shorter development cycles with more product features and reduced time to market. Reduced NRE (Non-Recurring Engineering) costs Design reuse is enabled. Increased flexibility to design changes Faster exploration of alternative architectures Faster exploration of alternative technology libraries Enables use of synthesis to rapidly sweep the design space of area and timing, and to automatically generate testable circuits. Better and easier design auditing and verification 4장. VHDL 개요

8 FPGA 와 ASIC FPGA and ASIC FPGA (Field Programmable Gate Array)
Typical applications of top-down design methodology The function is not fixed by the manufacturer. The function is defined by the designer for a particular application.    FPGA (Field Programmable Gate Array) A device that is completely manufactured, but that remains design independent Each FPGA vendor manufactures devices with a proprietary architecture. The architecture will include a number of logic blocks that are connected to programmable switching matrices. The switching matrices are programmed to route signals between the individual logic blocks. 4장. VHDL 개요

9 FPGA 와 ASIC ASIC (Application Specific Integrated Circuit)
Partially manufactured by an ASIC vendor in generic form. A chip with an array of unconnected transistors The final manufacturing process of connecting the transistors is completed when a chip designer has a specific design. An ASIC vendor can usually do the final process in a couple of weeks, known as the turn-around time.     4장. VHDL 개요

10 ASIC Design Traditional design flow for ASIC (schematic-based)
Schematic capture Netlist extraction Logic simulation Placement and routing Parasitic RC extraction and re-simulation (back annotation) Fabrication, assembly and test 4장. VHDL 개요

11 VHDL 설계 Symbol rsff Schematic set q reset qb u1 set q qb reset u2

12 Entity Entity An entity declaration describes the interface of a design through which it communicates with other design entities. Interface modes in : The value of the interface object may only be read. out : The value of the interface object may only be updated. inout : The value of the interface object may be both read and updated. May be updated by zero or more sources. buffer : The value of the interface object may be both read and updated. Must be updated by at most one source. type bit is (‘0’, ‘1’) ; entity rsff is port (set, reset : in bit ; q, qb : buffer bit ) ; end rsff ; is end entity port in buffer bit type is 4장. VHDL 개요

13 Architecture Architecture architecture netlist of rsff is
component nand2 port (a, b : in bit ; c : out bit ) ; end component ; begin u1 : nand2 port map (set, qb, q) ; u2 : nand2 port map (reset, q, qb) ; end netlist ; architecture of is component end port in out bit map 4장. VHDL 개요

14 Instantiation Component instantiation Positional association
Named association or u1 : nand2 port map (set, qb, q) ; port map u1 : nand2 port map (a=>set, b=>qb, c=>q) ; port map u1 : nand2 port map (b=>qb, c=>q, a=>set) ; port map 4장. VHDL 개요

15 Design style VHDL description style Behavioral description example
Structural description (or netlist) Behavioral description Mixed structural-behavioral description      Behavioral description example architecture behave of rsff is begin q <= not (qb and set) after 2 ns ; qb <= not (q and reset) after 2 ns ; end behave ; architecture of is ns and after end not 4장. VHDL 개요

16 Assignment Assignment statement Sequential statement
The order of execution is determined by the order of the statements in the source file. Assignment statements in a typical programming language such as C or Pascal Concurrent statement The order of execution is solely specified by the events occurring on signals to which the assignment statements are sensitive. Signal assignment statements inside a VHDL architecture Event : change in the value of the corresponding signal Implied sensitivity list : set of the signals in the right side of the signal assignment statement 4장. VHDL 개요

17 Delay Propagation delay Example : architecture behave
Specified by the after clause. Delays the assignment of the new value to the signal by scheduling an event. Example : architecture behave       t set reset !(qb•set) !(q•reset) q qb 1 t1 t1 + 2 t1 + 4 t1 + 6 1 1 4장. VHDL 개요

18 Delay : Sequential behavior
Sequential behavior example architecture sequential of rsff is begin process (set, reset) -- sensitivity list if set = ‘1’ and reset = ‘0’ then q <= ‘0’ after 2 ns ; qb <= ‘1’ after 4 ns ; elsif set = ‘0’ and reset = ‘1’ then q <= ‘1’ after 4 ns ; qb <= ‘0’ after 2 ns ; elsif set = ‘0’ and reset = ‘0’ then q <= ‘1’ after 2 ns ; qb <= ‘1’ after 2 ns ; end if ; end process ; end sequential ; 4장. VHDL 개요

19 Architecture selection
An entity can have multiple architectures. An architecture can be selected by configuration statements. Configuration example : rsffcon1 Use behave as the architecture of entity rsff. rsffcon rsff behave for ; rsffcon1; for configuration of is end 4장. VHDL 개요

20 Configuration Configuration example : rsffcon2
Use netlist as the architecture of entity rsff. For u1 and u2 of type nand2, use entity mynand and architecture version1 from the library called work. rsffcon rsff netlist u1, u2 ; nand2 mynand(version1) ; ; rsffcon2 ; for configuration of is end use entity work 4장. VHDL 개요

21 Test bench Test bench Also called test harness or test fixture.
A software program for the purposes of exercising and verifying the functional correctness of a hardware model during simulation Reflects the system environments. Designers typically spend as much time writing test bench and verifying models as they do writing the hardware models themselves. The expressive power of VHDL fits for it. 4장. VHDL 개요

22 Test bench Objectives of test bench
Instantiate the hardware model under test. Generate stimulus waveforms and apply them to the hardware model in the form of functional test vectors during simulation. Generate expected waveforms and compare them with the output from the hardware model during simulation. Possibly automatically provide a pass or fail indication Model under test Waveform generation Compare results 4장. VHDL 개요

23 Test bench Advantages of writing a test bench in VHDL
There is no need to learn a special simulation tool or special language. Since VHDL is an IEEE standardized language, models and their associated test bench should be transportable across different design tools. VHDL has rich simulation semantics that can be fully exploited in a test bench 4장. VHDL 개요

24 Test bench : Example Clock waveform generation example
entity clock_gen is end clock_gen ; architecture for_test_bench of clock_gen is signal ClockFast, ClockMed, ClockSlow : bit := ‘0’ ; begin ClockFast <= not ClockFast after 10 ns ; ClockMed <= ‘1’ after 20 ns when ClockMed = ‘0’ else ‘0’ after 20 ns ; process wait for 30 ns ; ClockSlow <= ‘1’ ; wait for 30 ns ; ClockSlow <= ‘0’ ; end process; end for_test_bench ; of is end entity for ns architecture signal bit not after when else wait 4장. VHDL 개요

25 Test bench : Example Test bench example entity test_bench is
end test_bench ; architecture adder of test_bench is component add4 port (A, B : in bit_vector (3 downto 0 ) ; Cin : in bit ; S : out bit_vector (3 downto 0 ) ; Cout : out bit ) ; end component ; component stimulus port (A, B : out bit_vector (3 downto 0 ) ; C : out bit ) ; signal s1, s2, s3 : bit_vector (3 downto 0 ) ; signal s4, s5 : bit ; of is end entity architecture component bit port bit_vector downto in out signal 4장. VHDL 개요

26 Test bench : Example begin of is port entity architecture process map
u0 : add4 (A => s1, B => s2, Cin => s4, S => s3, Cout => s5) ; u1 : stimulus (A => s1, B => s2, C => s4) ; adder ; stimulus is (A, B : ( ) ; C : ) ; stimulus ; two_vectors stimulus A <= “0101”; B <= “1010”; C <= ‘0’; ; A <= “0001”; B <= “1100”; C <= ‘1’; ; ; two_vectors ; begin of is port entity architecture process map bit_vector downto out bit end wait for ns component 4장. VHDL 개요

27 II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링

28 VHDL 소개 VHDL 특성 구 분 VHDL C 계층적 표현 객체 및 타입 선언영역 및 가시성 하드웨어 모델링
선언과 본체 분리 계층적 모델링 (캡슐화, 사례화, 설계분류) 헤더와 C 화일 객체 및 타입 타이밍객체 다양한 자료형 자료형의 범위 및 제약 자료형의 속성 다양한 리터럴 연산자의 다중 정의 단순 자료형 단순 리터럴 선언영역 및 가시성 블록 구조언어의 선언 영역 및 가시성 선언 영역의 계층성 선언 영역의 중첩 선택적 선언 영역의 확장 동형 이의어의 선택 블록 구조언어의 선언영역 및 가시성 하드웨어 모델링 행위/타이밍/구조기술 병행문/순차문 (감지리스트, 델타지연, 대기문) 행위 알고리즘 기술 순차문 5장. VHDL 설계구성

29 (Package Declaration) (Configuration Declaration)
계층적 표현 설계 단위 (Design Unit) 독립적으로 분석되어 라이브러리화 될 수 있는 구성 단위 설계 라이브러리 (Design Library) 기존에 설계되어 분석이 완료된 설계 단위로서 다른 설계에서 재사용할 수 있다. 패키지 선언 (Package Declaration) /패키지 몸체 (Package Body) 패키지 선언은 다른 설계 단위에서 재사용될 공유 선언 정보를 선언한 설계 단위이다. 패키지 몸체는 패키지 선언만을 지원하는 정보를 선언한 설계 단위이다. 엔티티 선언 (Entity Declaration) 새로운 회로의 이름, 외부와의 인터페이스 방법 및 특성을 정의한 설계 단위이다. 아키텍쳐 몸체 (Architecture Body) 엔티티 선언의 내부 회로를 표현하기 위한 동작 및 구조 정보를 기술한 보조 설계 단위로서 단독으로 재사용될 수 없다. 구성 선언 (Configuration Declaration) 전체적인 회로의 구성을 위하여 계층적 연결 정보를 기술한 설계 단위이다. 5장. VHDL 설계구성

30 Configuration Declaration
계층적 표현 설계 단위(Design Unit) 주요단위 (Primary Unit) 보조단위 (Secondary Unit) 공유정보 Package Declaration 공유 선언 정보 Package Body 비공유 선언 정보 하드웨어 동작/구조 Entity Declaration 선언 및 인터페이스 정보 Architecture Body 내부 동작 및 구조 정보 구성정보 Configuration Declaration 연결 및 결합 정보 5장. VHDL 설계구성

31 Configuration Declaration
계층적 표현 설계 단위의 구성 및 상호 관계 Design File Design Library Package Declaration Package Body Design Library Architecture Body I Entity Declaration Architecture Body II Design Library Design Library Configuration Declaration Primary Unit Secondary Unit : / 보조 설계 단위 관계 : Use 문을 이용한 확장 5장. VHDL 설계구성

32 계층적 표현 설계 라이브러리(Design Library) 설계 라이브러리의 분류 라이브러리의 재사용(Use 문)
Working Library : 현재 구현중인 설계 라이브러리 Resource Library : 분석이 완료되어 다른 설계 단위에서 재사용되는 라이브러리 라이브러리의 재사용(Use 문) STD.STANDARD 패키지의 재사용은 default 처리가 이루어진다. 라이브러리 종류 STD library : VHDL standard library (STANDARD, TEXTIO) IEEE library : IEEE standard library ( std_logic_1164, std_logic_arith) ASIC vendor library : logic gate를 정의한 entity, architecture body User-defined library : package, entity, architecture body, configuration WORK library : 현재 작업중인 directory 5장. VHDL 설계구성

33 계층적 표현 VHDL 표현 라이브러리 지정 패키지 재사용(Use Clause)
LIBRARY library_name ; 패키지 재사용(Use Clause) USE library_name.package_name.declaration_name ; USE library_name.package_name.ALL ; 엔티티와 아키텍쳐 몸체/구성 선언 재사용(Binding Indication) USE ENTITY library_name.entity_name(architecture_body_name) ; USE CONFIGURATION library_name.configuration_name ; LIBRARY std, ieee, work; USE std.standard.ALL; 생략 가능 USE ieee.std_logic_1164.ALL; 패키지 USE work.my_pkg.ALL; 사용자 정의 라이브러리 USE ENTITY work.d_flipflop(behavioral) ; 엔티티와 아키텍쳐 몸체 USE CONFIGURATION work.dff_config ; 구성 선언 5장. VHDL 설계구성

34 계층적 표현 패키지 선언 및 패키지 몸체(Package Declaration & Package Body)
설계에서 공유될 정보를 정의한다. 공유할 타입/상수/서브프로그램 등을 선언한다. USE 문을 통하여 외부에서도 참조 가능하다. 패키지 몸체(Package Body) 패키지 선언에서의 서브프로그램 몸체와 미정의 상수(Deferred constant)를 정의한다. Package내에 사용될 선언 중에서 공유하지 않을 내용 등을 정의한다. 패키지와 동일한 이름을 사용한다. 자신 외의 다른 설계에서는 절대 참조하지 못한다. 5장. VHDL 설계구성

35 계층적 표현 주요 패키지 라이브러리 STD 라이브러리(VHDL 표준 라이브러리) IEEE 라이브러리 5장. VHDL 설계구성
STANDARD; TEXTIO IEEE 라이브러리 합성지원 라이브러리 : STD_LOGIC_1164 산술연산 라이브러리 : STD_LOGIC_ARITH; STD_LOGIC_UNSIGNED Microwave 라이브러리 : WAVES_1164_DECLARATIONS; WAVES_INTERFACE; WAVES_1164_FRAMES; WAVES_1164_UTILITIE; WAVES_OBJECTS VITAL 라이브러리(ASIC용 라이브러리) : VITAL_timing; VITAL_Primitives 5장. VHDL 설계구성

36 II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링

37 객체 및 타입 어휘 요소 (Lexical Elements) 객체 (Objects) 타입 (Type) 속성 (Attribute)
식별자, 리터럴, 예약어, 구분자로 구분되어 지며, 식별자와 예약어의 경우 대소문자의 구별이 없다. 객체 (Objects) 데이터를 저장하기 위한 기억 장소를 나타내며, 상수/변수(파일)/신호의 종류가 있다. 타입 (Type) 객체들의 데이터 유형을 선언하여 값의 종류와 특성을 정의한다. 속성 (Attribute) 객체의 추가 정보 및 상태를 표현한다. 정의된 속성과 사용자 정의 속성으로 구분된다. 연산자 (Operator) 연산문에서 사용되는 연산 기호로써, 피연산자를 입력으로 결과를 출력하는 함수의 역할을 수행한다. 서브프로그램 (Subprogram) 반복되는 연산 과정 및 수행 절차를 간소화하기 위한 표현 방법으로써, 연산 계산 과정은 함수로 나타내며 수행 절차 과정은 프로시쥬어로 기술한다. 6장. VHDL 객체 및 타입

38 객체 및 타입 어휘 요소(Lexical Elements) 어휘 요소의 종류 대소문자에 대한 구별이 없다.
식별자(Identifier), 리터럴(Literal), 예약어(Reserved Word), 구분자(Delimiter) 대소문자에 대한 구별이 없다. VHDL, Vhdl, vhdl : 모두 동일한 이름으로 간주된다. VHDL’93의 경우 Extended_Identifier는 대소문자 구별이 가능하다. 주석(comment)는 Double Dash(--)로 표시되며, 한 줄을 주석화 한다. 선언/문장 단위는 Semicolon(;)으로 구분된다. 모든 선언들은 지역적(Local) 유효 영역(Scope)을 갖는다. 6장. VHDL 객체 및 타입

39 객체 및 타입 Extended Reserved Identifier Delimiter Identifier Word D_FF
/VHDL/ ENTITY := U123 /vhdl/ OF <= pentium /Vhdl/ END ; Decimal Character Physical Based Literal Literal Literal Literal 123 ‘A’ 30 ns 2#1011#E2 2e-2 ‘#’ 100 pf 16#EF.0A # 12.34_56 ‘a’ Bit String String Literal Literal B “1010_0101” X “ABCDEF” “Warning !!” O “7654_3210” 6장. VHDL 객체 및 타입

40 객체 및 타입 객체(Objects) 데이터를 저장하기 위한 기억 장소 객체의 분류 상수(Constant)
고정된 데이터를 기록하는 객체로 병행문/순차문에서 사용 가능하다. 변수(Variable) 가변적인 데이터를 기록하는 객체로 순차문에서만 사용 가능하며, 여러 프로세스에서 공유할 수 없다. Shared Variable의 경우 여러 프로세스에서 공유할 수 있으나, 값의 변화에 대한 처리 방법은 정하지 않았다. 다수의 프로세스에서 순차적으로 사용하도록 설계해야 한다. 파일(File) 파일 처리를 위한 변수 객체이다. 신호(Signal) 시간에 따른 데이터의 변화를 나타낼 수 있는 객체로 병행문/순차문에서 사용 가능하다. 6장. VHDL 객체 및 타입

41 객체 및 타입 6장. VHDL 객체 및 타입

42 객체 및 타입 객체 VHDL 표현 상수 선언(Constant Declaration)
초기값을 설정해 주어야 한다. 초기값이 없는 상수 선언은 deferred constant로 구분된다. 패키지 선언에서만 가능하며, 초기값은 패키지 몸체에서 정의한다. 변수 선언(Variable Declaration) 초기값이 없는 경우 default value로 설정된다. Default Value 해당 타입의 최소값을 나타낸다. (type_name’LEFT) Shared Variable의 선언 형식은 변수 선언과 동일하다. CONSTANT con : bit := ‘0’; VARIABLE var : bit ; VARIABLE temp, reg : integer := 100; SHARED VARIABLE stemp, sreg : integer := 100; 6장. VHDL 객체 및 타입

43 객체 및 타입 파일 선언(File Declaration) 신호 선언(Signal Declaration)
READ_MODE/WRITE_MODE/APPEND_MODE 형식으로 파일을 처리한다. 신호 선언(Signal Declaration) 초기값이 없는 경우 default value로 설정된다. FILE input : text OPEN read_mode IS “STD_INPUT”; SIGNAL sig : bit_vector(7 DOWNTO 0) := “ ”; 6장. VHDL 객체 및 타입

44 객체 및 타입 포트(Port) 및 신호(Signal) 포트의 특성 포트의 방향성(Mode)
외부와의 연결 통로/핀의 개념을 갖는다. 신호 객체로 분류된다. 포트의 방향성(Mode) 입출력 방향을 정의한다. IN : 외부에서 포트로 입력된다. OUT : 포트에서 외부로 출력된다. INOUT : 외부에서 포트로 입출력된다. BUFFER : 포트에서 외부로 출력되며, 내부에서 포트의 값을 참조할 수 있다. LINKAGE : VHDL 이외의 설계 데이터와 연결할 경우에 사용된다. 6장. VHDL 객체 및 타입

45 객체 및 타입 포트 및 신호 신호 구동 메커니즘 시뮬레이션에서의 신호 구동 메커니즘 구동기(Driver)
시뮬레이션 과정에서 신호 객체를 모델링하기 위하여 도입된 개념 구동기는 지연되는 시간동안 신호의 예상 출력 결과를 유지하기 위한 객체이다. 구동기는 신호의 데이터를 갱신하는 프로세스마다 독립적으로 관리되며, 시뮬레이션 관리자(Kernel)가 개별적인 구동기들을 중재하여 신호의 데이터를 변경한다. 각각의 프로세스 및 신호에서 발생되는 출력 예정 파형(Projected Output Waveform)이다. 시뮬레이션에서의 신호 구동 메커니즘 스케쥴링 시뮬레이션 수행 사이클 6장. VHDL 객체 및 타입

46 객체 및 타입 속성(Attribute) 객체에 대한 추가 정보 및 상태를 표현한다. 속성의 분류
정의된 속성(Pre-defined Attribute) 상수/변수/범위/함수/타입 유형의 정보를 표현한다. 모든 선언들은 정의된 속성을 내부적으로 소유하게 된다. 사용자 정의 속성(User-defined Attribute) 상수 정보를 갖는 속성을 정의할 수 있다. 6장. VHDL 객체 및 타입

47 객체 및 타입 타입에 대하여 정의된 속성 타입 속성의 예
T’BASE T의 base-type을 나타낸다. T’LEFT T의 왼쪽 경계(left bound)를 나타낸다. T’RIGHT T의 오른쪽 경계(right bound)를 나타낸다. T’HIGH T의 가장 큰 값 즉 위쪽 경계(high bound)를 나타낸다. T’LOW T의 가장 작은 값 즉 아래쪽 경계(low bound)를 나타낸다. T’POS(X) T에서 X의 위치를 값으로 나타낸다. T’VAL(X) T에서 X로 주어진 위치에 있는 값을 나타낸다. T’SUCC(X) T에서 X보다 하나 큰 위치에 있는 값을 나타낸다. T’PRED(X) T에서 X보다 하나 작은 위치에 있는 값을 나타낸다. T’LEFTOF(X) T에서 X보다 하나 왼쪽에 있는 값을 나타낸다. T’RIGHTOF(X) T에서 X보다 하나 오른쪽에 있는 값을 나타낸다. TYPE nine IS (‘0’, ‘1’, ‘X’, ‘Z’, ‘-’, ‘H’, ‘L’, ‘T’, ‘F’ ); SUBTYPE t IS nine; t’BASE : nine 타입 t’BASE’LEFT : nine 타입의 ‘0’ 리터럴 nine’POS(‘X’) : integer 3 nine’VAL(9) : nine 타입의 ‘F’ 리터럴 6장. VHDL 객체 및 타입

48 A’REVERSE_RANGE[(N)]
객체 및 타입 속성 배열형 객체에 대하여 정의된 속성 다차원 배열의 경우 합성이 지원되지 않는 툴들이 많다. 배열형의 상수/신호/변수 모두 배열형에 정의된 속성을 사용할 수 있다. 가변적인 Bit Size인 경우 LENGTH 속성을 사용하면 재설계의 부담을 덜 수 있다. A’LEFT[(N)] N은 선택적이며 없을 경우(default)에는 1로 간주 이 속성은 N번째 색인의 왼쪽 배열 경계를 표현한다 A’RIGHT[(N)] 이 속성은 N번째 색인의 오른쪽 배열 경계를 표현한다. A’HIGH[(N)] 이 속성은 N번째 색인의 가장 큰 배열 경계를 표현한다. A’LOW[(N)] 이 속성은 N번째 색인의 가장 작은 배열 경계를 표현한다. A’RANGE[(N)] 이 속성은 N번째 색인의 범위를 표현한다. A’REVERSE_RANGE[(N)] 이 속성은 N번째 색인 범위의 역을 표현한다. A’LENGTH[(N)] 이 속성은 N번째 색인에 있는 값의 수를 표현한다. * [(N)] : (N)은 생략 가능함 6장. VHDL 객체 및 타입

49 객체 및 타입 연산자(Operator) 기본 연산자 종류 추가 VHDL 연산자(VHDL’93) 논리 연산자 Shift 연산자
xnor 연산자가 추가되었다. Shift 연산자 우선 순위는 논리 연산자보다는 높고 관계 연산자보다는 낮다. 6장. VHDL 객체 및 타입

50 객체 및 타입 연산자의 특성 우 결합 법칙 z := a + b + c ; -- (1) a+b (2) (1)의 결과 + c
같은 순위를 가진 연산자들인 경우 왼쪽에서 오른쪽의 순으로 수행된다. 우선순위를 바꾸고자 하는 경우 괄호를 사용된다. z := a + b + c ; -- (1) a+b (2) (1)의 결과 + c z := a + (b + c) ; -- (1) b + c (2) a + (1)의 결과 6장. VHDL 객체 및 타입

51 객체 및 타입 연산자 연산자의 특성 +, - 는 가감산 연산자와 부호로 사용된다.
NOT은 논리 연산자이지만 우선순위가 다른 연산자보다 높다. 논리 연산자의 경우 두 피연산자의 타입이 같아야 하며, 연속적인 사용에 제한이 있으므로 괄호를 사용해야 한다. z := (-a) - b ; -- (1) -a : 부호 (2) - b : 가감산 연산자 z := a XOR NOT b ; -- (1) not b (2) a xor (1)의 결과 z := a AND b AND c ; -- illegal z := ( a AND b ) AND c ; -- legal 6장. VHDL 객체 및 타입

52 II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링

53 하드웨어 모델링 행위적 모델 타이밍 모델 구조적 모델 혼합적 모델 병행문 순차문 시스템의 기능적 해석을 기술한다.
다수 연산들간의 처리를 표현한다 타이밍 모델 자극-응답(stimulus-response) 모델을 기술한다. 다수 프로세스들간의 데이터 흐름을 표현한다 구조적 모델 다수의 모델들로 구성된 상위 구조를 기술한다. (Schematic Capture)  상위 설계 단위는 하위 설계 단위를 참조할 수 있어도, 하위 설계 단위의 내부는 참조할 수 없다. (설계의 은닉성 : Encapsulation) 혼합적 모델 행위적/타이밍/구조적 모델링을 이용하여 모델을 기술한다. 병행문 프로세스의 동작 및 회로의 구조 정보를 기술한다. 순차문 프로세스 내에서 순차적으로 처리되는 흐름을 기술한다. 7장. VHDL 모델링

54 하드웨어 모델링 행위적 모델 입력(Inputs)/동작(Operation)/출력(Outputs)으로 표현된다.
시스템은 다수 연산들의 처리 단위로써 표현된다. Discrete System Input 1 Output 1 Input n Output m 7장. VHDL 모델링

55 하드웨어 모델링 행위적 모델을 표현하기 위한 VHDL 개념 Process Signal Sensitivity Wait
VHDL에서 각 동작 Operation 개념을 나타낸다. 프로세스들은 병행적으로 수행된다. Signal VHDL에서 본 Input/Output 개념을 표현한다. 프로세스들 사이의 데이터 이동 경로(Wire)를 나타낸다. Sensitivity 프로세스의 수행을 활성화 시켜주는 신호들을 나타낸다. 감지 신호들 중에서 Event가 발생하면 프로세스가 활성화된다. Wait 프로세스의 수행 과정을 제어하는 개념을 표현한다. 프로세스들간의 동기화를 위하여 이용된다. 7장. VHDL 모델링

56 하드웨어 모델링 행위적 모델 Discrete System의 표현 설계 단위(Design Unit) 7장. VHDL 모델링
엔티티 선언(Entity Declaration) 회로의 입출력에 대한 인터페이스를 정의한다. 아키텍쳐 몸체(Architecture Body) 회로를 모델화하기 위하여 다수의 연산들로써 Discrete System을 정의한다. 7장. VHDL 모델링

57 하드웨어 모델링 타이밍 모델 VHDL의 타이밍 처리 개념 Drivers Event Delay 7장. VHDL 모델링
신호 값을 변경시킬 데이터들의 집합을 나타낸다. Event 신호 값의 변경이 발생되었음을 나타낸다. Delay 입력 신호 값의 발생에서 실제 출력 신호 값의 변경까지 소요되는 시간 7장. VHDL 모델링

58 하드웨어 모델링 VHDL의 시뮬레이션 과정 1) Sensitivity 신호들 중에서 데이터 변경이 발생(Event)에 의하여 프로세 스가 활성화된다. 2) 활성화된 프로세스들은 신호 데이터 변경을 위한 드라이버(driver)를 생성한다. 3) 지연 시간이 지난 후 드라이버의 데이터를 신호의 데이터에 갱신한다. 데이터가 갱신된 신호들 중에서 값의 변화가 일어난 경우는 Event 발생 신호로 처리한다. 1)~3)의 시뮬레이션 주기(Cycle) 과정을 반복하며, Event 발생이 없거나 종료 시간이 되면 시뮬레이션을 끝낸다. Generate Drivers Update Start Simulation End Simulation Signals Processes Stimulus Response Activate Sensitivity list Entry 7장. VHDL 모델링

59 하드웨어 모델링 구조적 모델 구조적 모델을 위한 VHDL 개념 Port Signal 7장. VHDL 모델링
설계 단위(Design Entity)간의 입출력 연결을 정의한다 Signal 두 설계 단위간의 연결을 위하여 신호를 양측 Port에 연결한다. 7장. VHDL 모델링

60 하드웨어 모델링 7장. VHDL 모델링 Black Box 1 Black Box 2 Resource Library
In1 In2 Out1 O1 <= (not In1) AND In2 O2 <= (not In2) AND In1 Out1 <= In1 OR In2 signal A signal B External Signal 1 Signal 2 Signal 3 Resource Library Working Library port map signal port 7장. VHDL 모델링

61 하드웨어 모델링 혼합적 모델 실제 설계의 경우 행위적/타이밍/구조적 모델링을 통한 설계가 동시에 고려된다. 구조적 모델링 적용
기존 설계된 하위 회로에 대한 재사용을 통한 모델링 행위적/타이밍 모델링 적용 하위 회로를 제어하기 위한 처리 메커니즘의 모델링 7장. VHDL 모델링

62 하드웨어 모델링 7장. VHDL 모델링 Working Library Black Box 1 Resource Library O1
(not In1) AND In2 O2 <= (not In2) AND In1 In1 In2 signal A signal B External Signal 1 Signal 2 Signal 3 Resource Library Working Library port map signal port Out1 <= A OR B 7장. VHDL 모델링

63 하드웨어 모델링 병행문과 순차문 병행문 순차문 프로세스 단위로서 병행적으로 수행되는 최소 단위를 나타낸다.
기술순서에 따른 수행이 아니며, 시간에 관계되어 수행 및 대기를 진행하는 모델이다. 순차문 기술순서에 따라서 순차적으로 수행되는 문장이다. 하나의 프로세스에 대한 내부적인 처리 절차 과정을 기술한다. 7장. VHDL 모델링

64 하드웨어 모델링 7장. VHDL 모델링

65 하드웨어 모델링 병행문 프로세스 동작 메커니즘 외부적으로는 병행적으로 수행되는 최소 단위
내부적으로는 순차적으로 수행되는 최대 단위 동작 메커니즘 서브프로그램처럼 수행이 완료된 후 복귀(Return)하는 개념이 아니라 시뮬레이션이 완료될 때까지 반복 수행하는 개념이다. 신호에 의해서 활성화(Activation) 되어지며, 대기문(Wait)에 의해서 대기상태(Suspend)되어 다음 활성화를 기다리게 된다. 프로세스를 활성화시키는 신호들은 감지 리스트(Sensitivity list)라고 지칭하며, 리스트에 등록된 신호들 중에서 하나라도 Event가 발생하면 활성화가 된다. 감지 리스트가 없는 경우 프로세스 내부에 1개 이상의 대기문을 포함해야 한다. 감지 리스트/대기문이 없는 경우는 시뮬레이션이 불가능한 설계 오류이다. 7장. VHDL 모델링

66 하드웨어 모델링 d_ff: PROCESS ( clk, din, clr) -- sensitivity list
CONSTANT clr_value : BIT := ‘0’; BEGIN IF CLR = ‘1’ THEN IF clk’EVENT AND clk=‘1’ THEN dout <= din; END IF; ELSE dout <= clr_value; END PROCESS; clk din clr dout Activation of Process 7장. VHDL 모델링

67 하드웨어 모델링 순차문 조건 제어문 조건부 제어문(If) IF clk’EVENT AND clk=‘1’ THEN
임의의 상태 조건에 해당된 경우만 실행하게 한다. Dangling Else-If 문의 경우는 순차회로가 구성되어 전체 시스템의 성능을 저하시킬 수 있다. Level/Edge 검출 회로를 표현하는데 사용한다. (Clock 신호) IF clk’EVENT AND clk=‘1’ THEN dout <= din ; END IF; IF sel = “00” THEN dout <= ‘L’; ELSIF sel = “10” OR sel = “01” THEN dout <= ‘H’; ELSE dout <= ‘X’; END IF; 7장. VHDL 모델링

68 하드웨어 모델링 선택적 제어문(Case) CASE sel IS WHEN “00” => dout <= ‘L’;
포괄적인 제어 상태를 분석하여 해당 내용을 실행한다. CASE sel IS WHEN “00” => dout <= ‘L’; WHEN “10” | “01” => dout <= ‘H’; WHEN OTHERS => dout <= ‘X’; 7장. VHDL 모델링

69 하드웨어 모델링 순차문 반복 제어문(Loop) 반복 수행될 내용을 기술한다. 무한 반복 제어문 (Loop)
제한 반복 제어문 (For Loop) Loop 변수는 별도의 선언을 하지 않는다. 반복 횟수가 변수일 경우 시뮬레이션만 가능하며, 합성은 불가능하다. 조건부 반복 제어문 (While Loop) 조건을 만족하는 동안에만 반복 수행한다. 7장. VHDL 모델링

70 하드웨어 모델링 기타 제어문 Exit 문 Next 문 Null 문 조건을 만족하면 Loop 수행을 종료한다.
Multi-Level Exit : 하나 이상의 Loop를 종료할 수 있다. Next 문 조건을 만족하면 한번 건너뛰며(Skip), Loop 수행은 계속 진행된다. Multi-Level Next : 하나 이상의 Loop를 건너뛸 수 있다. Null 문 No-operation 을 나타낸다. l1 : WHILE con = 17 LOOP -- 조건부 반복 제어문 l2 : FOR i IN 0 TO 10 LOOP -- 제한 반복 제어문 l3 : LOOP -- 무한 반복 제어문 tar := tar +1; EXIT l2 WHEN tar = 15; -- tar = 15 이면 l3, l2 loop를 종료한다 END LOOP l3 ; NEXT l2 WHEN i = 5; i = 5일때는 밑에 문장을 건너뛴다. var := var + tar ; END LOOP l2 ; tar := tar + 2; END LOOP l1 ; 7장. VHDL 모델링

71 하드웨어 모델링 병행문 행위 병행문 병행 신호 지정문(Concurrent Signal Assignment Statement)
프로세스 문을 한 문장으로 기술하는 간결한 표현이다. 수행 메커니즘은 프로세스와 동일하다. 감지 리스트나 대기문이 없어도 입력 신호를 감지 신호로 간주하여 처리한다. 병행 신호 지정문(Concurrent Signal Assignment Statement) 단순 신호 지정문 순차 신호 지정문과 동일한 개념이다. s <= d ; PROCESS (d) BEGIN s <= d ; END PROCESS; 7장. VHDL 모델링

72 하드웨어 모델링 조건부 신호 지정문(Conditional Signal Assignment)
조건이 일치하는 Waveform만을 신호에 입력한다. If 문과 결합된 신호 지정문의 간결한 표현이다. 선택적 신호 지정문(Selected Signal Assignment) 포괄적 선택 조건을 기술한다. Case문과 결합된 신호 지정문의 간결한 표현이다. s <= ‘1’ WHEN set = ‘0’ ELSE conditional signal assignment d WHEN (clk’EVENT AND clk=‘1’); sel <= set & clk & d ; WITH sel SELECT -- selected signal assignment s <= ‘1’ WHEN “100”|”101”|”110”|”111”, d WHEN “010”|”011”, s WHEN OTHERS; 7장. VHDL 모델링

73 합성을 위한 VHDL 모델링 합성을 위한 고려 사항들
에지 검출(Edge-Detect) 을 모델화 할 경우, 반드시 값도 표현해야 한다. Rising Edge Falling Edge IF ( clk’EVENT AND clk = ‘1’) THEN : IF ( clk’EVENT AND clk = ‘0’) THEN : 7장. VHDL 모델링

74 II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링

75 Behavioral Modeling Signal assignment statement
The most basic form of behavioral modeling a <= b ; The current value of signal b is assigned to signal a whenever signal b changes value. Sensitivity list : b a <= b ; Signal a gets the value of signal b when 10 nano seconds of time have elapsed after signal b changes value. after ns 8장. VHDL 구문과 예제

76 Behavioral Modeling Two-input AND gate example . . ; and2 (a, b : ;
      ; and2 (a, b : ; c : ) ; and2 ; signal_assignment and2 c <= a b ; signal_assignment ; use work std_logic_1164 all entity is port in std_logic out std_logic end architecture of is begin and after ns end 8장. VHDL 구문과 예제

77 Behavioral Modeling Signal assignment statement with conditions
Conditional signal assignment statement assigns a value to the target signal based on conditions that are evaluated for each statement. Selected signal assignment statement Selects among a number of options to assign the correct value to the target signal. 8장. VHDL 구문과 예제

78 Behavioral Modeling 4 to 1 multiplexer example : mux4 i0 i1 i2 i3 a b
q a b q i0 1 i1 i2 i3 8장. VHDL 구문과 예제

79 Behavioral Modeling . . ; mux4 (i0, i1, i2, i3, a, b : ; q : ) ;
; mux4 (i0, i1, i2, i3, a, b : ; q : ) ; mux4 ; mux4 of mux4 is sel : ; sel q <= i , i , i , i , ‘X’ others ; sel <= a = ‘0’ b = ‘0’ a = ‘1’ b = ‘0’ a = ‘0’ b = ‘1’ a = ‘1’ b = ‘1’ 4 ; use work std_logic_1164 entity is port in out std_logic end architecture begin and with ns all signal integer select after when else 8장. VHDL 구문과 예제

80 Behavioral Modeling Inertial delay
Default in VHDL (No need to specify) The output signal of the device has inertia which must be overcome in order for the signal to change value. The inertia value is equal to the delay through the device. In most cases, the inertial delay model is accurate enough for the designer’s needs. b <= a ; ns after a b t [ns] 8장. VHDL 구문과 예제

81 Behavioral Modeling Transport delay
Must be specified with the keyword transport . Any pulse, no matter how small, is propagated to the output signal delayed by the delay value specified. Useful for modeling delay line devices, wire delays on a PCB and path delays on an ASIC. b <= transport a ; ns after a b t [ns] 8장. VHDL 구문과 예제

82 Behavioral Modeling Simulation delta Simulation delta example
An infinitesimal amount of time used for ordering events in time VHDL adopted delta delay mechanism. Simulation delta example a b clock d c 8장. VHDL 구문과 예제

83 Behavioral Modeling reg (a, clock : ; d : ) ; reg ; delta_test reg
b, c : ; b <= (a) ; c <= (clock b) ; d <= c b ; delta_test ; -- Input stimulus : clock = ‘1’, a = ‘1’  ‘0’ entity is port in out end architecture begin bit signal not and of 8장. VHDL 구문과 예제

84 Behavioral Modeling Nondelta delay mechanism Delta delay mechanism
and first nand first Evaluate not. b <= ‘1’ Evaluate and. d <= ‘1’ c <= ‘1’ Evaluate nand. Glitch on d No glitch on d 1   a <= ‘0’ Evaluate not. 2   b <= ‘1’ Evaluate and. Evaluate nand. 3   d <= ‘1’ c <= ‘0’ 4   d <= ‘0’ 8장. VHDL 구문과 예제

85 Behavioral Modeling Drivers
A concurrent signal assignment inside of an architecture produces one driver for each signal assignment. Multiple drivers test test a <= b ; a <= c ; test ; Produced by multiple signal assignments. Useful for modeling a data bus, a bidirectional bus, etc. A resolution function is required to resolve all of the contributors into a single value. A resolution function is a designer-written function that will be called whenever a driver of a signal changes value. architecture begin of is end ns after 8장. VHDL 구문과 예제

86 Behavioral Modeling 4 to 1 multiplexer example
architecture wrong of mux4 is begin q <= i0 when a = ‘0’ and b = ‘0’ else ‘X’ ; q <= i1 when a = ‘1’ and b = ‘0’ else ‘X’ ; q <= i2 when a = ‘0’ and b = ‘1’ else ‘X’ ; q <= i3 when a = ‘1’ and b = ‘1’ else ‘X’ ; end wrong ; architecture right of mux4 is q <= i0 when a = ‘0’ and b = ‘0’ else i1 when a = ‘1’ and b = ‘0’ else i2 when a = ‘0’ and b = ‘1’ else i3 when a = ‘1’ and b = ‘1’ else ‘X’ ; end right ; architecture and when else of is end 8장. VHDL 구문과 예제

87 Behavioral Modeling Operators Arithmetic operators
Exponential :  Multiplication :  Division : / Addition : + Subtraction :  Modulus : mod Remainder : rem Absolute value : abs Unary sign operators Identity : + Negation :  8장. VHDL 구문과 예제

88 Behavioral Modeling Operators (cont’d) Relational operators
Less than : < Less than or equal to : <= Greater than : > Greater than or equal to : >= Equality : = Inequality : /= Shift operators Logical shift left : sll Logical shift right : srl Arithmetic shift left : sla Arithmetic shift right : sra Rotate left : rol Rotate right : ror 8장. VHDL 구문과 예제

89 Behavioral Modeling Operators (cont’d) Logical comparison operators
not and or Logical bit-wise operators nand nor xor xnor Concatenation operator & 8장. VHDL 구문과 예제

90 Behavioral Modeling Generics
A general mechanism used to pass information to an instance of an entity Which information ? Propagation delay, load capacitance, resistance Data-path widths, signal widths Generics example use work.std_logic_1164.all ; entity and2 is generic (delay : time := 1 ns) ; port (a, b : in ; c : out ) ; end and2 ; architecture constant_delay of and2 is begin c <= a and b after delay ; end constant_delay ; use work std_logic_1164 entity is port in out std_logic end architecture all ns after and of generic 8장. VHDL 구문과 예제

91 Behavioral Modeling Generics example use work.std_logic_1164.all ;
entity and2 is generic (rise, fall : time ; load : integer) ; port (a, b : in std_logic ; c : out std_logic) ; end and2 ; architecture load_dependent of and2 is signal internal : std_logic ; begin internal <= a and b ; c <= internal after (rise + load  2 ns) when internal = ‘1’ else internal after (fall + load  3 ns) ; end load_dependent ; use work std_logic_1164 entity is port in out std_logic end architecture all time after and of generic integer when ns else signal 8장. VHDL 구문과 예제

92 Behavioral Modeling Behavioral Modeling entity test is
port (ina, inb, inc, ind : in std_logic ; out1, out2 : out std_logic) ; end test ; architecture test_arch of test is component and2 generic (rise, fall : time ; load : integer ) ; port (a, b : in std_logic ; c : out std_logic) ; end component ; begin u1 : and2 generic map (10 ns, 12 ns, 3) ; port map (ina, inb, out1) ; u2 : and2 generic map (9 ns, 11 ns, 5) ; port map (inc, ind, out2) ; end test_arch ; entity is port in out std_logic end architecture time of generic integer ns map component 8장. VHDL 구문과 예제

93 Behavioral Modeling Default values for generics
architecture test_arch of test is component and2 generic (rise, fall : time := 10 ns ; load : integer := 0) ; port (a, b : in std_logic ; c : out std_logic) ; end component ; begin u1 : and rise : 10 ns, fall : 12 ns, load : 3 generic map (10 ns, 12 ns, 3) ; port map (ina, inb, out1) ; u2 : and2 -- rise : 10 ns, fall : 10 ns, load : 0 port map (inc, ind, out2) ; end test_arch ; port end architecture time of is generic integer ns map component in out std_logic 8장. VHDL 구문과 예제

94 Behavioral Modeling Block statement
A partitioning mechanism within VHDL that allows the designer to logically group areas of the model Example architecture cpu_blk of cpu is begin alu : block           end block alu ; registers : block end block registers ; end cpu_blk ; end architecture of is block 8장. VHDL 구문과 예제

95 Behavioral Modeling Scope rules blk1 : block block signal sig : bit ;
begin blk2 : block sig <= ‘0’ ; -- sig of blk2 blk1.sig <= ‘1’ ; -- sig of blk1 end block blk2 ; sig <= ‘0’ ; -- sig of blk1 end block blk1 ; end signal bit block 8장. VHDL 구문과 예제

96 Behavioral Modeling Guarded blocks
Contains a guard expression which can enable and disable drivers inside the block. Example use work.std_logic_1164 .all ; entity latch is port (d, clk : in std_logic ; q, qb : out std_logic) ; end latch ; architecture latch_guard of latch is begin g1 : block (clk = ‘1’) -- guard expression q <= guarded d after 5 ns ; qb <= guarded not (d) after 7 ns ; end block g1 ; end latch_guard ; use work std_logic_1164 entity is in out std_logic end architecture all after of block ns not guarded port 8장. VHDL 구문과 예제

97 Sequential Processing
process statement Contains only sequential statements. The process statement is itself a concurrent statement. Sensitivity list Explicit sensitivity list wait statement Whenever a signal in a sensitivity list has a change in value, the statements inside of the process will be executed sequentially. The process waits for another change in a signal in its sensitivity list. 8장. VHDL 구문과 예제

98 Sequential Processing
use work.std_logic_1164.all ; entity nand2 is port (a,b : in std_logic ; c : out std_logic) ; end nand2 ; architecture sequential of nand2 is begin process (a, b) -- explicit sensitivity list variable temp : std_logic ; temp := not (a and b) ; if (temp = ‘1’) then c <= temp after 6 ns ; elsif (temp = ‘0’) then c <= temp after 5 ns ; else end if ; end process ; end sequential ; use work std_logic_1164 entity is in out std_logic end architecture all after of process ns then variable port not and elsif if 8장. VHDL 구문과 예제

99 Sequential Processing
Signal assignment vs. variable assignment Signal assignment : after a delta delay Variable assignment : immediately (no delta delay) 4 to 1 multiplexer example a b q i0 1 i1 i2 i3 use work.std_logic_1164.all ; entity mux4 is port (i0, i1, i2, i3, a, b : in std_logic ; q : out std_logic ) ; end mux4 ; use work std_logic_1164 entity is in out std_logic all end port 8장. VHDL 구문과 예제

100 Sequential Processing
architecture wrong o mux4 is signal muxval : integer ; begin process (i0, i1, i2, i3, a, b) muxval <= 0 ; if (a = ‘1’) then muxval <= muxval + 1 ; end if ; if (b = ‘1’) then muxval <= muxval + 2 ; case muxval is when 0 => q <= i0 after 10 ns ; when 1 => q <= i1 after 10 ns ; when 2 => q <= i2 after 10 ns ; when 3 => q <= i3 after 10 ns ; when others => null ; end case ; end process ; end wrong ; end architecture after of is process ns then signal others when if case null 8장. VHDL 구문과 예제

101 Sequential Processing
architecture right of mux4 is begin process (i0, i1, i2, i3, a, b) variable muxval : integer ; muxval := 0 ; if (a = ‘1’) then muxval := muxval + 1 ; end if ; if (b = ‘1’) then muxval := muxval + 2 ; case muxval is when 0 => q <= i0 after 10 ns ; when 1 => q <= i1 after 10 ns ; when 2 => q <= i2 after 10 ns ; when 3 => q <= i3 after 10 ns ; when others => null ; end case ; end process ; end right ; end architecture after of is process ns then others when if case null variable integer 8장. VHDL 구문과 예제

102 Sequential Processing
if statement if (x < 10) then a := b ; end if ; if (day = sunday) then weekend := true ; elsif (day = saturday) then else weekday := true ; end then elsif if true 8장. VHDL 구문과 예제

103 Sequential Processing
case statement type bit_vec_type is array (0 to 1) of bit ; variable bit_vec_val : bit_vec_type ; variable int_val : integer ;           case bit_vec_val is when “00” => int_val := 0 ; when “01” => int_val := 1 ; when “10” => int_val := 2 ; when “11” => int_val := 3 ; end case ; is bit type end when case of variable integer array to 8장. VHDL 구문과 예제

104 Sequential Processing
while loop statement variable result, count : integer ;           result := 0 ; count := 1 ; while (count <= 10) loop result := result + count ; count := count + 1 ; end loop ; loop end variable integer while 8장. VHDL 구문과 예제

105 Sequential Processing
for loop statement type int_vec_type is array (1 to 10) of integer ; varaible i_squared : int_vec_type ; varaible i_decremented : int_vec_type ;           for i in 1 to 10 loop -- don’t have to declare i. i_squared (i) := i  i ; end loop ; for i in 10 downto 1 loop i_decremented (i) := i - 1 ; loop end type variable integer of array to is for in downto 8장. VHDL 구문과 예제

106 Sequential Processing
for loop statement type day_of_week is (sun, mon, tue, wed, thu, fri, sat) ;           for i in day_of_week loop if i = sat then son <= mow_lawn ; elsif i = sun then church <= family ; else dad <= go_to_work ; end if ; end loop ; end loop type is for in elsif if then 8장. VHDL 구문과 예제

107 Sequential Processing
next statement Stops execution of this iteration and goes on to the next iteration. process (a, b) constant max : integer := 255 ; type d_type is array (0 to max) of boolean ; variable done : d_type ; begin for i in 0 to max loop if (done (i) = true ) then next ; else done (i) := true ; end if ; q (i) <= a (i) and b (i) ; end loop ; end process ; end loop type is of and next true to then boolean if process integer array variable for in constant 8장. VHDL 구문과 예제

108 Sequential Processing
exit statement Jumps out of a loop statement currently in execution. process (a) constant max : integer := 255 ; variable int_a : integer ; begin int_a := a ; for i in 0 to max loop if (int_a <= 0) then exit ; else int_a := int_a – 1 ; q (i) <= / real (int_a  i) ; end if ; end loop ; y <= q ;   end process ; end loop real then if process integer exit variable for in to constant 8장. VHDL 구문과 예제

109 Sequential Processing
Loop label process (a) begin first_loop : for i in 0 to 100 loop second_loop : for j in 1 to 10 loop           exit second_loop ; exit first_loop ; end loop ; end loop ;   end process ; end loop process for in to exit 8장. VHDL 구문과 예제


Download ppt "II. VHDL 설계부 4장. VHDL 개요 5장. VHDL 설계 구성 6장. VHDL 객체 및 타입 7장. VHDL 모델링"

Similar presentations


Ads by Google