1 / 33

디지털 시스템 설계 (2)

디지털 시스템 설계 (2). VHDL 의 Data Type. 숫자형 (Scaler Type) 열거형 (Enumeration Type) 정수형 (Integer Type) 실수형 (Floating Point Type) 물리형 (Physical type) 혼합형 (Composite Type) 배열형 (Array Type) 제한형 (Constraint Type) 무제한형 (Unconstraint Type) 뭉침형 (Record Type) 연결형 (Access Type) -- 사용 않함

nairi
Download Presentation

디지털 시스템 설계 (2)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 디지털 시스템 설계(2)

  2. VHDL의 Data Type • 숫자형(Scaler Type) • 열거형(Enumeration Type) • 정수형(Integer Type) • 실수형(Floating Point Type) • 물리형(Physical type) • 혼합형(Composite Type) • 배열형(Array Type) • 제한형(Constraint Type) • 무제한형(Unconstraint Type) • 뭉침형(Record Type) • 연결형(Access Type) -- 사용 않함 • File Type -- 사용않함

  3. VHDL의 Data Type(Scalar Type) • 정수형(Integer Type) • - 231 -1 ~ 231 -1까지의 모든 정수 정의 가능 • 실수형(Floating Point Type) • -1E38 ~ 1E38

  4. VHDL의 Data Type(Scalar Type) • 물리형(Physical Type) • 시간, 거리, 전류 등의 물리적인 단위 • 기본적인 단위를 가지고 그것을 중심으로 다른 단위를 나타냄

  5. VHDL의 Data Type(Scalar Type) • Floating Point Type • 열거형(Enumeration Type) • 문자열을 하나의 데이터로 묶어 선언한 것으로, BOOLEAN, BIT 등이 여기에 속함

  6. VHDL의 Data Type(Composite Type) • Array Type • bit_vector, std_ulogic_vector가 이 종류라 할 수 있으며 같은 종류의 데이터를 하나로 엮은 형 • 다차원 배열도 가능 • 무제한형(Unconstraint Type) • 이미 선언된 Type을 또 하나의 변형된 새로운 Type으로 다시 만든 것 • 제한형(Constraint Type) • 이미 선언된 Type을 정해진 범위에서 열거 • 일종의 Bus Type으로 만든 것

  7. VHDL의 Data Type(Composite Type) • type array_name is array(range_name range <> ) of type_name; • range_name • Integer, Natural, Positive • type array_name is array(integer range <> ) of type_name; type std_ulogic_vector is array(NATURAL ranve <>) of std_ulogic; -- 무제한형 type byte is array(7 downto 0) of bit; -- 제한형

  8. VHDL의 Data Type(Composite Type) • 다차원 배열 • Multi Dimensional Array type memory1 is array(0 to 4, 3 downto 0) of bit constant ROM1 : memory1 := ((‘0’,’0’,’0’,’0’), (‘0’,’0’,’0’,’1’), (‘0’,’0’,’1’,’0’), (‘0’,’0’,’1’,’1’), (‘0’,’1’,’0’,’0’)); • Array of Array type word is array (3 downto 0) of BIT; type memory2 is array(0 to 4) of word type memory1 is array(0 to 4, 3 downto 0) of bit constant ROM2 : memory2 := ((“0000”), (“0001”), (“0010”), (“0011”), (“0100”));

  9. VHDL의 Data Type(Composite Type) • 뭉침형(Record Type) • 배열이 같은 종류의 숫자형을 묶어서 사용과 반면 다른 종류의 숫자형이나 배열형(field)을 묶어 사용 • 단, 각 field에 배열형을 사용 할 때는 제한형 만이 가능 Type command is (add, sub, mul, …) Type instruction is record OPCODE : COMMAND; SRC : BIT_VECTOR(7 downto 0); PC : INTEGER; end record; Case OP_CND is when ADD  INST.opcode := OP_CMD; INST.src := X”F1”; INST.pc := 2; when SUB  INST.opcode := OP_CMD; INST.src := B”1111_0011”; INST.pc := 2;

  10. VHDL의 Data Type(Composite Type) • File type • 외부와의 입출력이나 특정 File의 변수를 선언 • VHDL Package의 TEXTIO 부분에 선언 • 회로에 대한 검증단계에서 많이 사용됨 • type TEXT is file of STRING

  11. VHDL의 Operator

  12. VHDL의 Operator • Logical Operator • 피연산자의 type은 BIT 또는 boolean

  13. VHDL의 Operator • Relational Operator • “=“, “/=“는 file type을 제외한 모든 type의 피연산자에 적용가능 • 숫자형 또는 1차원 배열형(Bus) 만이 가능 • 길이가 다른 두 수를 비교시 왼쪽부터 순차적으로 비교 • “101011”과 “1011”비교시 ??? • “110”과 “11000”비교시???

  14. VHDL의 Operator • Shift • 1차원 배열형에서만 사용가능 • SLL --- shift left logical • SRL --- shift right logical • SLA --- shift left arithmetic • SRA --- shift right Arithmetic • SOL --- rotate left logical • SOR --- rotate right logical A_Sig := “11110101” sll 2; B_Sig := “01011111” sll 2; C_Sig := “11110001” sll 2;

  15. VHDL의 Operator • Add • +, - • 같은 numeric type(integer, floating point, physical type)이어야함 • &(Concatenation) • 피연산자는1차원 array 또는array element이어야함

  16. VHDL의 Operator • Sign • numeric type에서 사용 • ‘-’는 단순 음수가 아닌, MSB를 sign 비트로 사용 • A1  -B 는 B의 2의 보수를 입력

  17. VHDL의 Operator • Multiplying poerator • *, /는 integer type, floating point type의 피연산자에 대하여 정의 되며 두 피연산자의 type은 같아야 함 • 다음과 같은 physical type에서도 연산가능 • rem, mod의 피연산자는 integer type

  18. VHDL의 Operator • Etc operator • abs 피연산자는 nemeric type 이어야 함 • ** 는 모든 integer type 과 floating poing type 에 대하여 정의 됨 • ** 의 오른쪽 연산자는 Integer 만 가능 • 2.4 ** 3

  19. Data Flow Description • Concurrent Signal Assignment Statement • 주어진 값, 입력 signal, 또는 이에 대한연산의 결과 등을delay에 대한 정보와 함께 출력signal에 전달 • 각concurrent signal assignment statement는 하나의 독립된 concurrent process 로서 동작하며 sensitive signal에 변화가 있을 때마다 반복 수행됨 • Conditional signal assignment, selected signal assignment

  20. Data Flow Description • Conditional Signal Assignment

  21. Data Flow Description • Selected Signal Assignment

  22. Concurrent(Block) • Block • 회로상의 내부 회로를 표현 • 회로설계시에 계층구조를 갖는데, Top회로는 Design Block들을 서로 연결하는 성격을 띄게 되고, 각 Design Block은 그 안에 또 다른 Design Block 이나 회로를 갖는다 VHDL 에서 Top VHDL 파일에서 Design Block으로 표시 할 수 있는 가장 쉬운방법 • Netlist 형식이 아닌 일반 Compiler 언어와 같은 표현으로 전체회로의 동작을 표현 할 수 있다

  23. Syntex block_name : block (동작 제한식) [generic (generic_list);] [port (port_list);] begin Concurrent 문 end block[Block_name] Ex) B1: block(EMB = ‘0’) signal S : bit; begin S <= A and B; B2: block signal S:bit; begin S <= C or D; out1 <= S; end block B2; out2 <= S; end block B1; Concurrent(Block)

  24. Behavioral Description • Sequential statement • Behavioral description은 실질적으로 사용되는 문장이 Sequential 문 • Process 문 또는 Subprogram 문 에서만 사용가능 sequential statement로 구성 • 내부의 sequential statement들을 순서대로 wait statement를 만날 때까지 반복 수행함 • Sensitivity list가 있는 경우에는 그 list에 포함되어 있는signal의 값이 변해야만 sequential statement들이 반복 수행됨 • Sensitivity list도 없고wait statement도 없는 process statement는 무한히 반복 수행되어 시뮬레이션이 끝날 수 없게 되므로 주의해야 함 • 명령어 • wait, assertion, signal assignment, variable assignment, procedure call, if, case, loop, next, exit, return, null

  25. Behavioral Description

  26. Behavioral Description • Wait • Process 문이나, procedure의 수행을 일시 정지시킴

  27. Behavioral Description • Signal • entity 선언에서 port 로 선언된 것들 또는 그 밖에서 Signal로 선언된 것에 신호를 전달 할 때 사용 • out <= in; • Variable • process 또는 subprogram 내에서 variable로 선언된 임시변수에 값을 전달 • temp := in;

  28. Behavioral Description • Signal & veriable entity Test is port(in_data:in bit; out_sig:out bit); end; architecture Behave of Test is begin process(in_data) variable out_var :bit; begin out_var := in_data; out_sig <= in_data; end process; end

  29. Behavioral Description • IF

  30. Behavioral Description • Case

  31. Behavioral Description • Loop • Loop, for, while • loop문을 사용할 때 exit, wait등을 사용하여 loop의 진행을 종료 하지 않도록 사용할 것 • Logic Synthesis 가 되지 않음

  32. Behavioral Description • Next, Exit • Loop문 안에서 조건문을 이용하여 조건에 만족했을 때 loop를 빠저나오는것이 exit, next 다음을 실행하지 않고, loop의 처음으로 돌아가는것을 의미 • loop label이 있는 exit, next는 해당 loop에 적용 • loop label이 없는 exit, next는 각문장이 포함되어있는 loop중 가장 내부의 loop

  33. Behavioral Description • Null • 다음 실행문으로 수행순서를 넘겨주는것 외에는 아무 일도 하지 않음

More Related