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

macro X = 1

DEFINE_DEVICE_TYPE:  Simple
  DEFAULT_ATTRIBUTE( X=1 );

  DEFINE_THREAD:   start_up
   {
    char value[50];
    float x;
    FILE *results;

    CSIM_GET_ATTRIBUTE( "X", value, 50 );
    sscanf(value,"%f",&x);
    results = fopen("result.dat","w");
    if (results==0) {printf("Error: cannot open result.dat\n"); exit(0);}
    fprintf(results,"%g %g\n", x, x * x );
    fclose(results);    
   }
  END_DEFINE_THREAD.

END_DEFINE_DEVICE_TYPE.

<DEFINE_MODULE>  top_level <top_diagram> </top_diagram>
  <DEFINE_NODE_INSTANCES>
	<ins 1> Example  =  Simple	
	  <vrt> 2.000000 2.600000  5.800000 4.200000 </vrt> </ins>
  </DEFINE_NODE_INSTANCES>

  <DEFINE_TOPOLOGY>
  </DEFINE_TOPOLOGY>
</DEFINE_MODULE>

</csim_hw_file>
