2015-05-20 13:11:18 +00:00
|
|
|
|
|
|
|
# keep interface-mess out of the way - keeping it pretty is a waste of time
|
|
|
|
|
2015-07-21 14:55:13 +00:00
|
|
|
proc ad_alt_intf {type name dir width {arg_1 ""} {arg_2 ""}} {
|
2015-05-20 13:11:18 +00:00
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {([string equal -nocase ${type} "clock"]) && ([string equal -nocase ${dir} "input"])} {
|
2015-05-20 13:11:18 +00:00
|
|
|
add_interface if_${name} clock sink
|
|
|
|
add_interface_port if_${name} ${name} clk ${dir} ${width}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {([string equal -nocase ${type} "clock"]) && ([string equal -nocase ${dir} "output"])} {
|
2015-05-20 13:11:18 +00:00
|
|
|
add_interface if_${name} clock source
|
|
|
|
add_interface_port if_${name} ${name} clk ${dir} ${width}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {([string equal -nocase ${type} "reset"]) && ([string equal -nocase ${dir} "input"])} {
|
2015-07-09 18:27:53 +00:00
|
|
|
add_interface if_${name} reset sink
|
|
|
|
add_interface_port if_${name} ${name} reset ${dir} ${width}
|
2015-07-21 14:55:13 +00:00
|
|
|
set_interface_property if_${name} associatedclock ${arg_1}
|
2015-07-09 18:27:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {([string equal -nocase ${type} "reset"]) && ([string equal -nocase ${dir} "output"])} {
|
2015-07-09 18:27:53 +00:00
|
|
|
add_interface if_${name} reset source
|
|
|
|
add_interface_port if_${name} ${name} reset ${dir} ${width}
|
2015-07-21 14:55:13 +00:00
|
|
|
set_interface_property if_${name} associatedclock ${arg_1}
|
|
|
|
set_interface_property if_${name} associatedResetSinks ${arg_2}
|
2015-07-09 18:27:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {([string equal -nocase ${type} "reset-n"]) && ([string equal -nocase ${dir} "input"])} {
|
2015-07-09 18:27:53 +00:00
|
|
|
add_interface if_${name} reset sink
|
|
|
|
add_interface_port if_${name} ${name} reset_n ${dir} ${width}
|
2015-07-21 14:55:13 +00:00
|
|
|
set_interface_property if_${name} associatedclock ${arg_1}
|
2015-07-09 18:27:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {([string equal -nocase ${type} "reset-n"]) && ([string equal -nocase ${dir} "output"])} {
|
2015-07-09 18:27:53 +00:00
|
|
|
add_interface if_${name} reset source
|
|
|
|
add_interface_port if_${name} ${name} reset_n ${dir} ${width}
|
2015-07-21 14:55:13 +00:00
|
|
|
set_interface_property if_${name} associatedclock ${arg_1}
|
|
|
|
set_interface_property if_${name} associatedResetSinks ${arg_2}
|
2015-07-09 18:27:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {([string equal -nocase ${type} "intr"]) && ([string equal -nocase ${dir} "output"])} {
|
2015-07-09 18:27:53 +00:00
|
|
|
add_interface if_${name} interrupt source
|
|
|
|
add_interface_port if_${name} ${name} irq ${dir} ${width}
|
2015-07-21 14:55:13 +00:00
|
|
|
set_interface_property if_${name} associatedclock ${arg_1}
|
2015-07-09 18:27:53 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2015-07-21 14:55:13 +00:00
|
|
|
set remap $arg_1
|
|
|
|
if {$arg_1 eq ""} {
|
2015-05-20 15:51:50 +00:00
|
|
|
set remap $name
|
|
|
|
}
|
|
|
|
|
2016-10-18 08:25:06 +00:00
|
|
|
if {[string equal -nocase ${type} "signal"]} {
|
2015-05-20 13:11:18 +00:00
|
|
|
add_interface if_${name} conduit end
|
2015-05-20 15:51:50 +00:00
|
|
|
add_interface_port if_${name} ${name} ${remap} ${dir} ${width}
|
2015-05-20 13:11:18 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-12 18:49:11 +00:00
|
|
|
proc ad_conduit {if_name if_port port dir width} {
|
|
|
|
|
|
|
|
add_interface $if_name conduit end
|
|
|
|
add_interface_port $if_name $port $if_port $dir $width
|
|
|
|
}
|
|
|
|
|