Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | |
2 | |||
3 | gen = NULL; |
||
4 | /* if the current chip is a template then compile |
||
5 | a reference to a generic name as the expression |
||
6 | will be copied, so pointer references are not |
||
7 | valid */ |
||
8 | |||
9 | if (current_chip) |
||
10 | { |
||
11 | /* make sure the generic exists locally */ |
||
12 | gen = get_generic_ref (¤t_chip->generics, name); |
||
13 | } |
||
14 | if (!gen) |
||
15 | { /* scope is local to known design? */ |
||
16 | gen = get_generic_ref (&global_generics, name); |
||
17 | } |
||
18 | if (!gen) |
||
19 | { /* scope is external not local */ |
||
20 | gen = get_generic_ref (&partition_generics, name); |
||
21 | } |
||
22 | if (!gen) |
||
23 | { /* undefined, so compile a reference */ |
||
24 | $$ = compile_reference (name); |
||
25 | } |
||
26 | else |
||
27 | { |
||
28 | $$ = compile_variable (gen, name); |
||
29 | } |
||
30 | } |