proc SCHEMATIC_dco_phase_counter {} {
make input -name ref_retimed -origin {170 200}
make input -name clk_in -origin {170 120}
make output -name delta_phase -origin {780 120}
make counter_with_reset -name xi1 -origin {300 130}
make int_to_double_convert -name xi2 -origin {490 110}
make reg_double -name xi0 -origin {700 130}
make name_net -name count -origin {610 120}
  make_wire 220 120 170 120
  make_wire 620 150 640 150
  make_wire 200 150 220 150
  make_wire 200 200 170 200
  make_wire 200 200 620 200
  make_wire 200 150 200 200
  make_wire 380 120 410 120
  make_wire 760 120 780 120
  make_wire 620 150 620 200
  make_wire 610 120 570 120
  make_wire 610 120 640 120
  make_text -origin {280 270} -text {Note:  modules ordered (using sim_order:)  such that xi0 executed first
          in order to prevent count from being reset before
          it impacts delta_phase}
}

proc ICON_dco_phase_counter args {

  icon_setup $args {{origin {0 0}} {orient R0} {name x}}
icon_term -type input -origin {-100 30} -name ref_retimed
icon_term -type input -origin {-100 0} -name clk_in
icon_term -type output -origin {100 0} -name delta_phase
icon_property -origin {-90 30} -label ref_retimed
icon_property -origin {-90 0} -label clk_in
icon_property -origin {90 0} -anchor e -label delta_phase
icon_property -origin {-90 -50} -label {$name}
icon_property -origin {-90 -30} -label dco_phase_counter
  icon_line -100 -40 100 -40 100 50 -100 50 -100 -40
  icon_property -origin {-90 110} -type user -name name -default x
  icon_line -100 20 -90 30 -100 40 -100 40

}

