CENG 342 – Digital Systems
Generate Statement and Using Components Larry Pyeatt
SDSM&T
CENG 342 Digital Systems Generate Statement and Using Components - - PowerPoint PPT Presentation
CENG 342 Digital Systems Generate Statement and Using Components Larry Pyeatt SDSM&T The generate Statement Allows the programmer to instantiate an array of entities/components. Syntax: 1 label: for parameter in range generate
SDSM&T
1 label: for parameter in range generate 2
3 end generate label;
1 entity reg_1_bit is 2
3
4
5
6 end entity reg;
1 entity generic_register is generic(N : natural := 8 ) 2
3
4
5
6 end entity reg; 7 8 architecture gen of generic_register is 9 begin 10
11
12
13
14 end architecture gen;
1 -- declare a silly little entity and give it an architecture 2 entity exor is 3
4
5
6
7
8 end entity; 9 10 architecture arch of exor is 11 begin 12
13 end architecture;
15 -- declare a testbench and give it an architecture 16 entity exor_test is 17 end entity; 18 19 architecture foo of exor_test is 20
21
22
23
24
25
26
27 begin 28
29
30 31
32
33
34
35
36
37
38
39
40
41
42 end architecture;
44 -- create configuration for entity exor_test 45 -- this specifies which entity should be used for component x in 46 -- architecure foo of component exor_test, and of course this 47 -- configuration also has a name: conf 48 configuration conf of exor_test is 49
50
51
52
53
54
55
56
57
58 end configuration conf;