Default Module Attributes Format

Module Attributes Format

Modules may possess attributes just as leaf-level boxes can. Default module attributes are listed under the <DEFINE_MODULE ...> tag as:
        <DEFAULT_ATTRIBUTE> name=value </DEFAULT_ATTRIBUTE>
As with defualt attributes for boxes, the value is optional. The default attribute serves as a way of listing a module'a attributes for GUI users while editing diagrams.

Attribute values of module-instances are set using the same syntax as for box-instances. For example:
        <mod name="module_instance_name" type="module_type_name" >
              <a name="attrib_name"> value </a>
              ...
        </mod>

Below is a complete example showing how to set both instance- and default- attributes for modules. Two default-attributes are set for the module-type defined as rack_type_xyz. The two default attributes are: Depth and width. One attribute, Weight, is set where the module is instantiated.



	<?xml version="1.0" standalone="yes"?>
	<csim_hw_file>
	CGUIformatVersion 3.000000


	<DEFINE_MODULE type="top_level" rank="top_diagram">

	  <DEFINE_NODE_INSTANCES>
		<mod name="Rack_1" type="rack_type_xyz" >
			<a name="Weight">54.3</a>
			<vrt x="3.6" y="2.6"/> <vrt x="6.8" y="4.8"/>
		</mod>
	  </DEFINE_NODE_INSTANCES>

	  <DEFINE_TOPOLOGY>
	  </DEFINE_TOPOLOGY>

	</DEFINE_MODULE>



	<DEFINE_MODULE type="rack_type_xyz" rank="child">
	  <DEFAULT_ATTRIBUTE> Depth = 12.5 </DEFAULT_ATTRIBUTE>
	  <DEFAULT_ATTRIBUTE> Wdith = 19.0 </DEFAULT_ATTRIBUTE>
	
	  <DEFINE_NODE_INSTANCES>
		<box name="Board_1" type="SingleBoardController" >
			<vrt x="1.6" y="1.6"/> <vrt x="3.2" y="2.8"/>
		</box>
		<box name="Board_2" type="Memory_1" >
			<vrt x="1.6" y="3.8"/> <vrt x="3.2" y="5"/>
		</box>
	  </DEFINE_NODE_INSTANCES>

	  <DEFINE_TOPOLOGY>
	  </DEFINE_TOPOLOGY>

	</DEFINE_MODULE>


	</csim_hw_file>