proc SCHEMATIC_time_to_digital_period_avg {} {
make input -name in_rising -origin {360 -130}
make input -name in_falling -origin {360 -50}
make input -name clk -origin {360 30}
make output -name out -origin {580 -130}
}

proc ICON_time_to_digital_period_avg args {
  icon_setup $args {{origin {0 0}} {orient R0} {name x} {avg_length 1.0}}
icon_term -type input -origin {-90 -10} -name in_rising
icon_term -type input -origin {-90 20} -name in_falling
icon_term -type input -origin {-90 50} -name clk
icon_term -type output -origin {100 -10} -name out
icon_property -origin {-80 -10} -label in_rising
icon_property -origin {-80 20} -label in_falling
icon_property -origin {-80 50} -label clk
icon_property -origin {90 -10} -anchor e -label out
icon_property -origin {-80 -60} -label {$name}
icon_property -origin {-80 -40} -label time_to_digital_period_avg
  icon_line -90 -50 100 -50 100 70 -90 70 -90 -50
icon_property -origin {-80 80} -label {avg_length=$avg_length}
  icon_property -origin {-90 120} -type user -name name -default x
  icon_property -origin {-90 140} -type user -name avg_length -default 1.0
}

