-
Notifications
You must be signed in to change notification settings - Fork 2
/
fejkon_apply_config.tcl
55 lines (41 loc) · 1.27 KB
/
fejkon_apply_config.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Note: Requires that full designs are available first
# Generate modified fejkon.qsys first to ensure that no errors regarding
# undefined connections are emitted for deactivated parts
source config.tcl
package require -exact qsys 16.0
load_system {fejkon.qsys}
set fc_ports 1
set eth_ports 0
if {$CONFIG_PORT1_FC == "y"} {
set fc_ports [expr $fc_ports + 1]
}
# TODO: Add terminator/dummy IP cores instead of xcvrX when port disabled?
if {$CONFIG_PORT2_FC == "y"} {
set fc_ports [expr $fc_ports + 1]
}
if {$CONFIG_PORT3_FC == "y"} {
set fc_ports [expr $fc_ports + 1]
}
if {$CONFIG_LOOPBACK_01 == "y"} {
set_instance_parameter_value datapath {LOOPBACK_01} {true}
} else {
set_instance_parameter_value datapath {LOOPBACK_01} {false}
}
if {$CONFIG_PORT2_ETHERNET == "y"} {
set eth_ports [expr $eth_ports + 1]
}
if {$CONFIG_PORT3_ETHERNET == "y"} {
set eth_ports [expr $eth_ports + 1]
}
if {$CONFIG_PORT1_DISABLED == "y"} {
set_instance_property sfp1 ENABLED false
}
if {$CONFIG_PORT2_DISABLED == "y"} {
set_instance_property sfp2 ENABLED false
}
if {$CONFIG_PORT3_DISABLED == "y"} {
set_instance_property sfp3 ENABLED false
}
set_instance_parameter_value ident {FcPorts} $fc_ports
set_instance_parameter_value ident {EthPorts} $eth_ports
save_system {fejkon.qsys}