<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type"content="text/html; charset=utf-8">
    <link href="../style.css" rel="Stylesheet" type="text/css">
    <title>Mode editor</title>
  </head>
  <body>
    <h2>Mode editor</h2>
    <p>
      The mode editor can be used to edit the details of a component mode.
    </p>
	  <p>
	    <b>Name</b> is a mandatory identifier for the <i>mode</i>.
    </p>
    <p>
        <b>Display name</b> is an optional and used for a more user-friendly identifier.
    </p>
    <p>
      <b>Short description</b> is an optional field for compact description of the <i>mode</i>.
    </p>
    <p>
      <b>Description</b> is an optional field for textual description of the <i>mode</i>.		
    </p>

    <h3>Condition</h3>
    <p>
      The condition defines when the mode is active. If the condition expression evaluates
      to true, the component is operating in the defined mode. The condition may depend
      on run-time value of a port, register field and other modes. The expression accepts
      the following special functions:
      <ul>
        <li><b>$ipxact_port_value</b>( [port slice name] )</li>
        <li><b>$ipxact_field_value</b>( [field slice name] )</li>
        <li><b>$ipxact_mode_condition</b>( [mode name] )</li>
      </ul>
      The functions refer to a port input value, a value stored in a bitfield or
      another mode condition value, respectively. The port slices and field slices
      are defined below.
    </p>

    <h3>Condition ports</h3>
    <p>
      The condition ports can be referenced in the condition to check for their value
      in the mode. 
    </p>
	  <p>
	    <b>Name</b> is a mandatory identifier for the <i>port reference</i>.
    </p>
    <p>
	    <b>Physical port</b> is a mandatory and identifies the <i>port</i> in the 
      component whose value may be checked in the condition.
    </p>
    <!--
    <p>
	    <b>Sub port</b> not supported yet.
    </p>
    -->
    <p>
      <b>Left</b> and <b>right bounds</b> are optional for selecting a range of
      bits in the port. If no indices are defined, the whole port is selected.
    </p>
    <p>
      <b>Description</b> is an optional field for textual description of the <i>port</i>.		
    </p>

    <h3>Condition fields</h3>
    <p>
      The condition fields can be referenced in the condition to check for their bit
      pattern in the mode. 
    </p>
	  <p>
	    <b>Name</b> is a mandatory identifier for the <i>field reference</i>.
    </p>
    <p>
	    <b>Field</b> is a mandatory and identifies the <i>field</i> in the 
      component whose bit pattern may be checked in the condition.
    </p>
    <p>
      <b>Leftmost bit</b> and <b>rightmost bit</b> are optional for selecting a range of
      bits in the field. If no indices are defined, the whole field is selected.
    </p>
    <p>
      <b>Description</b> is an optional field for textual description of the <i>port</i>.		
    </p>

    <hr>
    <p>
    EXAMPLE. The mode named reset is active when the value of the bit 0 in the physical port
    button_in i.e. button_in[0:0] is equal to 1. 
    <br>
    <br>
    <img src="../images/modeExample.png" alt="Example of a reset condition">
  </p>
  </body>
</html>
