<?xml version="1.0" encoding="UTF-8"?>
<net name="ClkDiv" type="iopt-flow">
  <event id="ClkIn" x="85" y="135" mode="input" microstep="0" nano-step="0"/>
  <signal id="Div" x="60" y="150" mode="input" type="range" min="1" max="32767" frac="0" value="1" dynamic="none" io_pin="0" microstep="0" nano-step="0"/>
  <event id="ClkOut" x="465" y="150" mode="output" microstep="0" nano-step="1"/>
  <operation id="o4" x="205" y="150" rot="0" shape="arrow" size="32">
    <name off_x="-10" off_y="5" text="o4"/>
    <input off_x="-32" off_y="-16" name="Clk" id="o4.Clk" type="event" min="0" max="1" dynamic="name" frac="0"/>
    <input off_x="-32" off_y="0" name="Div" id="o4.Div" type="range" min="1" max="32767" dynamic="all" frac="0"/>
    <input off_x="-32" off_y="16" name="Cntr" id="o4.Cntr" type="range" min="0" max="32767" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o4.out" type="range" min="0" max="32767" dynamic="none" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="signal" idRef="Cntr" delay="1"/>
        <operator type="add"/>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Cntr" delay="1"/>
          <operator type="less"/>
          <operand type="signal" idRef="Div"/>
          <operator type="and"/>
          <operand type="signal" idRef="Clk"/>
        </operand>
        <text>Cntr[-1] + 1 WHEN (Cntr[-1] &lt; Div AND Clk)</text>
      </expression>
      <expression>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Clk"/>
        </operand>
        <text>1 WHEN (Clk)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="Cntr" delay="1"/>
        <text>Cntr[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a5" type="read" source="ClkIn" target="o4.Clk"/>
  <arc id="a6" type="read" source="Div" target="o4.Div"/>
  <arc id="a7" type="read" source="o4.out" target="o4.Cntr" view="symbolic"/>
  <operation id="o8" x="310" y="150" rot="0" shape="arrow" size="16">
    <name off_x="-5" off_y="-15" text="gen_clk"/>
    <input off_x="-16" off_y="0" name="cntr" id="o8.cntr" type="range" min="0" max="32767" frac="0"/>
    <output off_x="16" off_y="0" name="out" id="o8.out" type="event" min="0" max="1" frac="0" microstep="0" nano-step="2">
      <expression>
        <operand type="signal" idRef="cntr"/>
        <operator type="equal"/>
        <operand type="literal" value="1"/>
        <operator type="and"/>
        <operand type="signal" idRef="cntr" delay="1"/>
        <operator type="diff"/>
        <operand type="literal" value="1"/>
        <text>cntr = 1 AND cntr[-1] &lt;&gt; 1</text>
      </expression>
    </output>
  </operation>
  <arc id="a9" type="read" source="o4.out" target="o8.cntr"/>
  <operation id="o1" x="390" y="150" rot="0" shape="arrow" size="16">
    <name off_x="-5" off_y="-15" text="ff"/>
    <input off_x="-16" off_y="0" name="s" id="o1.s" type="event" min="0" max="1" frac="0"/>
    <output off_x="16" off_y="0" name="out" id="o1.out" type="event" min="0" max="1" frac="0">
      <expression>
        <operand type="signal" idRef="s" delay="1"/>
        <text>s[-1]</text>
      </expression>
    </output>
  </operation>
  <arc id="a2" type="read" source="o8.out" target="o1.s"/>
  <arc id="a3" type="read" source="o1.out" target="ClkOut"/>
</net>
