<?xml version="1.0" encoding="UTF-8"?>
<net name="up_delay" type="iopt-flow">
  <operation id="o1" x="460" y="280" rot="0" shape="rect" size="44">
    <name off_x="-40" off_y="-35" text="up_delay"/>
    <input off_x="-45" off_y="-20" name="in" id="o1.in" type="boolean" min="0" max="1" frac="0"/>
    <input off_x="-45" off_y="0" name="delay" id="o1.delay" type="range" min="0" max="32767" frac="0"/>
    <input name="in_cntr" id="o1.in_cntr" type="range" min="0" max="32767" frac="0" off_x="-45" off_y="20"/>
    <output off_x="45" off_y="-20" name="out" id="o1.out" type="boolean" min="0" max="1" frac="0">
      <expression>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="in"/>
          <operator type="equal"/>
          <operand type="literal" value="1"/>
          <operator type="and"/>
          <operand type="signal" idRef="in_cntr"/>
          <operator type="more-or-equal"/>
          <operand type="signal" idRef="delay"/>
        </operand>
        <text>1 WHEN (in = 1 AND in_cntr &gt;= delay)</text>
      </expression>
      <expression>
        <operand type="literal" value="0"/>
        <text>0 OTHERWISE</text>
      </expression>
    </output>
    <output name="cntr" id="o1.cntr" type="range" min="-32768" max="32767" frac="0" off_x="45" off_y="20">
      <expression>
        <operand type="literal" value="0"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="in"/>
          <operator type="equal"/>
          <operand type="literal" value="0"/>
        </operand>
        <text>0 WHEN (in = 0)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="in_cntr" delay="1"/>
        <operator type="add"/>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="signal" idRef="in_cntr" delay="1"/>
        <operator type="less"/>
        <operand type="signal" idRef="delay"/>
        <text>in_cntr[-1] + 1 WHEN (in_cntr[-1] &lt; delay)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="delay"/>
        <text>delay OTHERWISE</text>
      </expression>
    </output>
  </operation>
</net>
