eda lab. dept. of computer engineering c. n. u. 1 synthesis issues in synthesizable vhdl...

101
1 EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

Upload: sydney-james

Post on 26-Mar-2015

230 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

1

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

SYNTHESIS

Issues in synthesizable VHDL descriptions

(from VHDL Answers to FAQ by Ben Cohen)

Page 2: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

2

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Supported/Unsupported Constructs

Page 3: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

3

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Supported/Unsupported Constructs

Page 4: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

4

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 5: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

5

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 6: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

6

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synthesis Sensitivity Rules for Processes

• If the synthesized process has a static sensitivity list, then every read signal must be a member of this list.– Otherwise the synthesis tool will create a hardware configuration

that concurs with this requirement

Page 7: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

7

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synthesized Hardware for Arrays, Signals and Variables

• Arrays : defines vectors– Represent either the output of CL, or a register or a latch.

• Rules for Signals and Variables in clocked processes or equivalent clocked process

( wait unitil Clk=‘1’; or if(Clk’event and Clk=‘1’ then …, or Sig <= not In1 When Clk’event and Clk=‘1’)1. Signals represent registers

2. Reading a variable before assigning a value to that variable implies “reading old values of that variable”, or a register implementation for that variable.

Page 8: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

8

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Signals and Variables

• Rules in non-clocked processes :– A latch is inferred for signals or variables when one of the

following conditions occurs (otherwise, the objects represents a bus output of combinational logic)

1. The signal or variable is in an equivalent process where not all the alternatives of a conditional expression are considered

2. The VHDL attribute ‘event is not present in the conditional expression.

3. The variable is read in any path prior to being assigned a value.

Page 9: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

9

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Signals and Variables

• One dimensional array declarations and Synthesis implications

Page 10: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

10

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 11: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

11

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Signals and Variables

• One-dimensional array declarations with variables

Page 12: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

12

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 13: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

13

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synchronous reset and Asynchronous reset

• Synchronous Reset

Page 14: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

14

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synchronous reset and Asynchronous reset

• Asynchronous Reset

Page 15: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

15

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Avoid the partial asynchronous reset!

• Avoid the partial asynchronous reset of implied registers in a clocked process– If asynchronous reset is required, either reset ALL the implied

registers, or use multiple clocked processes.

Page 16: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

16

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 17: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

17

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Avoid the partial asynchronous reset!

Page 18: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

18

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Latch inference in functions?

• Since variables declared in a function do not retain their values between calls to this function, latches will not be inferred by synthesis.– Even if the latching criteria are satisfied.

• To avoid any confusion, the function should be writeen in a non-latching coding style. To agreewith the basic VHDL synthesis coding style.

Page 19: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

19

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Variable initialization and Lifetime

• Variables are initialized when, and only when, its declaration is elaborated.

• Concurrent procedure is equivalent to a process. Its sensitivity list is extracted from all the actual signals whose mode is in or inout.

• In synthesis, DO NOT initialize variables in the declaration statements of the variables. – Instead, declare the variable UNINITIALIZED, and in the body of

the process or subprogram, write an initialization statement(e.g. My_variable := 0; )

• In synthesis, DO NOT declare constants that are initialized to values of formal parameters or ports.

Page 20: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

20

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Variable initialization – not synthesizable

• Non-synthesizable VHDL code

Page 21: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

21

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Variable initialization – not synthesizable

• Synthesizable VHDL code

Page 22: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

22

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Wait statement

• A process with a sensitivity list cannot contain any explit ‘wait’ statement, any called procedure from such a process cannot contain a ‘wait’ statement.

• ‘wait’ statement can be used anywhere in a process except in a ‘for … loop’ statement or in a subprogram.– In most synthesizers, there can only be a sinlge ‘wait’ statement in

a process. Allowing a ‘wait’ statement in a subprogram would imply multiple ‘wait’ statements, if that subprogram is called multiple times from within a process.

• If a subprogram is called as a concurrent procedure, then there is an implied wait statement at the end of that procedure. Adding a ‘wait’ would then include two ‘wait’ statements.

• Multiple ‘wait’ statements are allowed in behavioral synthesis.

Page 23: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

23

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Defining Shift Registers in Synthesis

• Given the following code, synopsys tool yields an elaborate Error “Tried to use a synchronized value.” Where is the error ?

Page 24: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

24

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 25: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

25

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Defining Shift Registers in Synthesis

• Several Code Errors of the Code <Figure 7.7>– Data should NOT be in the sensitivity list.

– Variable Reg implies a register (the variable reads on old value)

– Temp is out of (clk’event …) and cannot be assigned with ‘synchronized variables’.

Page 26: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

26

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 27: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

27

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Defining Shift Registers in Synthesis

• Corrected Shift Register Model 1 (Reg – becomes a signal)

Page 28: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

28

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 29: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

29

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Defining Shift Registers in Synthesis

• Improved Shift Register Model (concatenation operator is used)

Page 30: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

30

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 31: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

31

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Register File

• n words deep by m bit wide register file– Multi-dim arrays:

• not allowed in synthesis for signals or variable objects

• allowed as constants or table lookups.

– User-defined Register File• Use two one-dim. Array types

• Figure 7.8

– Use high-level parameterized components like RAM, Counters, adders, multipliers, FIFOs, LESRs, pipeline registers multipliers, if they are available

Page 32: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

32

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 33: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

33

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Page 34: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

34

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

MUX

• Using concurrent signal assignment

Page 35: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

35

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

MUX

Page 36: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

36

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

DeMUX

• Using concurrent signal assignment

Page 37: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

37

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

DeMUX

Page 38: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

38

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

DeMUX

• Using a process

Page 39: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

39

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

DeMUX

• Using a process, no loop

Page 40: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

40

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Barrel Shifter

• Barrel Shifter

Page 41: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

41

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Barrel Shifter

• Non-Synthesizable Barrel Shifter

Page 42: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

42

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Barrel Shifter

• Synthesis problems1. The Slice “D_in((D_in’left – Amount) downto 0) & …” is non-co

mpatable (Amount is a dynamic value)

2. The vector “D_in(D_in’left downto (D_in’left – Amount + 1))” is a null array when amount is zero.

Page 43: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

43

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Barrel Shifter

• Synthesizable model: the loop counter is compared against the input Amount.

Page 44: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

44

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Barrel Shifter

• Synthesizable model: case statement & process

Page 45: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

45

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Use of “don’t care” in case statement

• In VHDL, “don’t care” means a ‘-’ state, not ‘u’ or ‘1’ or anything else – Maybe useful during simulation to ensure that a signal is not

resolved with any other signal.

Page 46: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

46

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Use of “don’t care” in case statement

• std_logic 9 values

• In synthesis, the “don’t care” – should be used in assignments only, not in expressions to be used for comparisons.

Page 47: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

47

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Use of “don’t care” in case statement

• Case statement with No “Don’t Care” – covers all conditions

Page 48: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

48

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Use of “don’t care” in case statement

• Nested case statement

Page 49: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

49

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Use of “don’t care” in case statement

• Using Type unsigned and To_Integer( )

Page 50: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

50

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

IF statement

• IF statement(instead of Don’t care)– Shorter code, Higher priority signal – near the top of the if constru

ct.• Synopsys will place those signals closer to the output than signals use

d in the expression occurring later on.

Page 51: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

51

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Loop statement

• Loop statement(to check leading one position)– Function Leading_one: purely combinational logic if S’range is sta

tic.

Page 52: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

52

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Loop statement

– General approach(loop works with any range, and is not limited to a fixed range.)

Page 53: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

53

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Loop statement

– Using for … loop in a process

Page 54: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

54

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

IEEE Std_Match( ) (to use Don’t Care)

• Overloaded function STD_MATCH( ) in Numeric_Std package– Interprets the ‘-’ into a true “don’t care”.

– An application of this function.

– Figure 7.12.4(55 페이지 )

– Problem• Not many vendors have yet adopted this template.

Page 55: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

55

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

IEEE Std_Match( ) (to use Don’t Care)

Page 56: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

56

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Common Logic Design Techniques to speed up a design

1. Pipeline – use register P: pipeline register to reduce the propagation delays

between register stages.

Page 57: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

57

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Common Logic Design Techniques to speed up a design

2. Shadow Register– The output of a register: subjected to a heavy load

• Can cause excessive delays.

• To alleviate this problem, a shadow register(register B) can be used to hold a copy of the original register, and to split the original driving load.

Page 58: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

58

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Common Logic Design Techniques to speed up a design

3. Use of Buffers– To enhance the drive to the selected logic clouds.

Page 59: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

59

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Common Logic Design Techniques to speed up a design

4. Register Outputs– To guarantee minimum output delays(check to the output), the

outputs are often registered prior to being transferred to the I/O output buffers.

Page 60: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

60

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synthesis Tools & Component Libraries

• If the synthesizer fails to achieve the time requirements, then the code and/or the architecture must be modified appropriately.

• Libraries: significantly impact the performance and the design time.– If tailored library components are available(ALU, FIFO, Register

file, etc), the VHDL code takes a more structural approach with component instantiations.

Page 61: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

61

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synthesizing Tri-states

• Incorrect Implementation of Tri-states *. Only the last signal assignments in a process are effective.

Page 62: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

62

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synthesizing Tri-states

• Corrected Model(with if)

Page 63: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

63

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synthesizing Tri-states

• Corrected Model(with case)

Page 64: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

64

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Latches in Tri-State controls

• Only one tri-state driver is synthesized per signal per process.

• In synopsys, when a signal(or variable) is registered(or latched) in the same process. Where it is tri-stated, then the enable signal of the tri-state is also registered(latched).

Page 65: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

65

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Latches in Tri-State controls

Page 66: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

66

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Latches in Tri-State controls

Page 67: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

67

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Latches in Tri-State controls

• To avoid the registering of tri-state enable, define the tri-state output as a separate concurrent statement.

Page 68: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

68

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Latches in Tri-State controls

Page 69: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

69

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Subelement Association

• How can the concatenation of two or more signals of an architecture be passed to a parameter of a subprogram?

• Example code with problems– Figure 7.15-1(70 페이지 )

– The result of “&” operator is an expression(value), and not a signal.

– Subelement association: non-portable.

Page 70: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

70

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Subelement Association

Page 71: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

71

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Subelement Association

• “In-whole Subelement Association”(using a temporary signal that computes “&”)

Page 72: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

72

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Subelement Association

• Subelement Association: agree with VHDL’93, but some synthesizers do not handle

Page 73: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

73

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Subelement Association for Ports

• The rules for port associations are the same as the ones described above.

• The port association “In-whole” is the most portable and synthesizable.

Page 74: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

74

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Subelement Association for Ports

• InvertRol entity with unconstrained ports– Not synthesizable, instantiated component is synthesizable.

Page 75: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

75

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Finite State Machine

• Moore Machine, Mealy Machine

• Coding styles– One process only handles both state transitions and outputs.

– Two processes include a synchronous process for updating the state register, and a combinational process for conditionally deriving the next machine state and updating the outputs.

– Three (or more) processes (and concurrent signal assignments) encompass a synchronous process for updating the state register, a combinational for conditionally deriving the next state machine, and a combinational process (or concurrent signal assignments) for conditionally deriving the outputs.

Page 76: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

76

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

One-Hot Encoding(state encoding)

• One-hot encoding: each bit represents a state.– Constant S0 : Std_Logic_Vector (3 downto 0) := “0001”;

Constant S1 : Std_Logic_Vector (3 downto 0) := “0010”;

Constant S2 : Std_Logic_Vector (3 downto 0) := “0100”;

Constant S3 : Std_Logic_Vector (3 downto 0) := “1000”;

• A “case” is used for the state transitions.– The entire state vector is decoded (not one-hot encoding)

Page 77: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

77

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

One-Hot Encoding(state encoding)

• Manual Emulation of one-hot encoding

Page 78: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

78

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Instantiating Synopsys Designware Components

• Synopsys DesignWare– A library of components that are optimized for area and/or speed.

• An Instantiation of a RAM

Page 79: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

79

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Resource Sharing

• The design approach to share expensive hardware resources among several uses of the resource.

• Three Methods to achieve resource sharing1. Automatic: compile optimizes the design to meet the constraints.

2. Automatic with manual controls: manual control statement – used to assign operations to resources explicitly.

3. Manual

Page 80: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

80

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Resource Sharing

• Some synopsys guidelines1. Operations can be shared only if they are in the same process.

2. All if statements are independent.– Result in the two adders

Page 81: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

81

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Resource Sharing

– Automatic Resource Sharing

Page 82: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

82

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Resource Sharing

– Manual Sharing

Page 83: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

83

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Applying Digital Design Experiences

• AreaOp1: 2 DeMUXes implied

Page 84: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

84

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Applying Digital Design Experiences

• AreaOp2: MUX(index), DeMUX(K, Q)

Page 85: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

85

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Applying Digital Design Experiences

• Comparative Area After Synthesis(Synopsys, Synplify)

TOOL Area(relative) Critical Path(ns)

Synopsys – AreaOp1 83 5.71

Synopsys – AreaOp2 46 7.46

Synplify – AreaOp1 6 out of 96 cells(6.2%) 13.9

Synplify – AreaOp2 5 out of 96 cells(5.2%) 21.2

Page 86: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

86

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Address Range Identification via Inferred Comparator

• Inequality operator will infer the comparators.– A search for address range pattern: more efficient

• Model of a Comparator

Page 87: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

87

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Address Range Identification via Inferred Comparator

• Address Range Identification without Inference of comparators

Page 88: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

88

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Port Mapping to Ground or VCC

• Incorrect GND / VCC Port Mapping– U1_XYZ: XYZ -- component instantiation

port map(A => ‘0’, -- input to ground

B => ‘1’ -- input to VCC

C => C, -- input to C

D => open -- output to open

Q => Q); -- output to Q

Page 89: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

89

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Port Mapping to Ground or VCC

• Correct Element Association to Ground, VCC and Open.

Page 90: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

90

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Bit Reversal

• Generic bit reversal

• With process and for … loop

Page 91: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

91

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Bit Reversal

Page 92: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

92

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Bit Reversal

• With Function and for … loop

Page 93: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

93

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Synthesizable Timer in VHDL

• Four methods1. Use of the if to test for the rollover condition.

2. Use of the case to test for the rollover condition.

3. Use of the mod operator.

4. Use of the overloaded “+” with type Unsigned and Integer.

• Integer Method– Figure 7.25 – 1(94 페이지 )

• Unsigned Method– Figure 7.25 – 2(96 페이지 )

Page 94: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

94

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Integer Method

Page 95: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

95

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Integer Method

Page 96: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

96

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Unsigned Method

Page 97: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

97

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Unsigned Method

Page 98: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

98

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Specifying a Multiplier

• The most efficient multiplier – from a library(such as Design Ware)

• Use of the multiplier Operator

Page 99: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

99

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Behavioral Synthesis

• Behavioral compiler allows– VHDL after clause – delay time must be a multiple of the clock

period.

– Arrays of arrays may be mapped to a RAM.

– Combinational operations may automatically be extended over multiple cycles. Resource sharing operations are performed automatically.

– Finite State Machine may be automatically inferred.

– Process with multiple “wait” statements.

Page 100: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

100

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Behavioral Synthesis

• Behavioral Compiler Sample code

Page 101: EDA Lab. Dept. of Computer Engineering C. N. U. 1 SYNTHESIS Issues in synthesizable VHDL descriptions (from VHDL Answers to FAQ by Ben Cohen)

101

EDA Lab. Dept. of Computer Engineering EDA Lab. Dept. of Computer Engineering C. N. U.C. N. U.

Behavioral Synthesis

• BC automatically do architectural trade-offs.

• Methodolog1. Designer specifies clock cycles(latency).

2. BC specifies resources, registers, MUXes, FSMs, data flow/control.

3. BC gets area and delays estimates for resources using DesignWare Library.