Documentation‎ > ‎

Flag Block

Flag Definitions

The standard flag settings may be set in the format:
Parameter = value unit

Mason gives access to some features that will only occasionally be useful. To take advantage of these features, Mason allows for flags to be set. The available flags have been grouped by function:

Using the "Show?" Feature

If you set the argument in the Flag block to be not shown, that flag setting will not be used.

Special File Outputs

Generates particular files that augment the design process.
  1. Create a PADS ASCII file (see the PADS output video)

    1. Create a PADS ASCII file using the given file name
      1. Mason actually outputs two files
        1. one treats each microstrip component as a separate device and also outputs the pre-defined decals (like 0402 for lumped resistors)
        2. The second file outputs what is effectively a single decal which can be defined in concert with an external schematic capture tool (like DxDesigner); appends "combined.asc" to the file name.
      2. As of version 4.5, you can output PCB Layout files using subcircuits
    2. Create both files, individual devices and combined as one decal
      1. <flag PADS-ASCII=”receiver.asc” />
    3. Create just the layout with individual devices
      1. <flag  PADS-INDIVIDUAL =”receiver.asc” /> 
    4. Create just the layout with combined devices
      1. <flag  PADS-COMBINED =”receiver.asc” />
    5. Define which of the components will be used to start the layout (can affect the angle things end up)
      1. <flag   FIRST-POST  =”TL1” />
  2. Output a file with all the Monte Carlo runs

    1. Output a file with all the statistical data, useful for post processing
      1. This is what the included Mason Plot program reads for statistical analysis
      2. File is the same as the output, + ".stat" (fixed to simplify plotting)
      3. Only shows the outputs from the last Monte Carlo run
    2. <flag stat_output = "true" />
  3. Output a primitive file and a MATLAB file based on a network of primitive files

    1. Output a new primitive file which can be used for future runs
      1. The variables in the model will be the arguments for the primitive file
      2. The arguments for each part must be prefaced with the RefDes + '___' (three underscores)
        1. ANT1 has a property __eps_r, __eps_r = ANT1___eps_r
        2. This assumes two underscores are being used for the argument name prefix
        3. The variable name feeding into the device's argument MUST follow the save pattern as the device's argument name, e.g. if the argument for the device TL1 is "loss_tangent", the variable feeding it MUST be "TL1___loss_tangent", and NOT "TL1___loss_tan"
      3. No Touchstone files may be used- strictly primitives (dynamic models)
      4. Calculations can be used to manipulate the arguments (variables)
      5. Optimizations and statistics can't be used
      6. Must use 50-ohm ports
      7. Be careful using S_X_Y in your calculations (e.g. "S_2_1 = S_1_2"); this doesn't map well in the new primitive files since "S_2_1" in this case will get mapped to something like "T1_S_2_1 = S_1_2", where S_1_2 will not have been defined.
      8. See also: Creating new parts in the TinyCAD library
      9. Example File: compensated_tee_junction
      10. The definitive guide is here: Make New Primitive Files
    2. Also creates a similarly named Matlab/ Octave file
    3. <flag make_primitive=”new_primitive.xml” />
      1. Note, in TinyCAD, the flag is written without quotes: make_primitive=new_primitive.xml

Output File Data Formats

These flags control the output of the Touchstone (S-Parameter) file that Mason generates.   
  1. Set what s-parameter to solve for

    1. If this flag is not set, all s-parameters for the network will be solved for; however, this can be used to solve for specific s-parameters instead of all of them.  Can use multiple flags for multiple parameters
    2. Potentially speeds up the run, decreases the memory usage
    3. <flag sparam="2   1" />
  1. Show Optimization details

    1. Update the Touchstone output file every time an improvement is found
    2. Potentially slows down the run
    3. <flag opt_output="true" />
  2. Output Data Format

    1. This modifies how the data is saved to the output file. The default is a complex pair of real and imaginary numbers.
    2. This flag takes one of three arguments
      1. RI
        1. real and imaginary (no punctuation)
        2. example: 0.707 0.707
      2. MA
        1. magnitude and angle (degrees)
        2. example: 1 45
      3. dB
        1. dB and angle (degrees)
        2. example: 0 45
    3. <flag output_data_format=”dB”></flag>
  3. Output Frequency Format

    1. This modifies how the data is saved to the output file. The default is in Hz.
    2. This flag takes one of the following arguments: kHz, MHz, GHz, THz
    3. <flag output_frequency_format=”MHz”></flag>
  4. Set Width

    1. The output file by default uses 25 characters per column of data. This allows you to change that width.
    2. <flag set_width=”22”></flag>
  5. Output version

    1. By default Mason will use a modified Touchstone format (version 1.1) which puts all the S-Parameters per frequency on a single line
    2. Version 1.0 does not flip S_2_1 and S_1_2 for two ports versus very other port
    3. Version 1.2 is a true Touchstone format
    4. <flag output_version=”1.2”></flag>

Random Number Generation Controls

Controls how random numbers are handled, primary used for making optimizers and statistics based on random numbers into repeatable runs.
  1. Seed the random number generator (see validation)

    1. Normally Mason will seed the random number generator with a time stamp. Use of this flag allows for a specific seed value to be used.
    2. <flag seed=”0”></flag>
  2. Use a file with random numbers instead of generating them (see validation)

    1. Use pre-generated random numbers from a file (better cross--platform agreement)
    2. <flag seed_file==”validation/random.txt”></flag>

Debug/ Developer Specific

These generally won't be useful unless your developing for the code.
  1. Control if the builtin primitive code is used

    1. Some of the primitives in the library have been changed into compiled code
    2. The compiled code is taken from the XML files that come with the download (but is not linked to the XML files)
    3. If a primitive file is referenced that is not compiled in, the code will default to using the XML file if it exists (you do not need to set turbo_cp to "false" just to use new primitives)
    4. If you edit the XML files in the library, you can set turbo_cp to "false"
    5. <flag turbo_cp="true" /> (uses the compiled code)
  2. Output figure of merit

    1. Output all figures of merit in the order the goal was entered
      1. The output will be the squares, for the sum of the squares figure of merit-- sum and root the output to get the actual figure of merit
      2. Might not be implemented in version 2.0 yet...
    2. <flag fom_output=”fom.txt” />
  3. Add extra comments during the run

    1. Output some details useful for knowing a little more what's going on
    2. First step towards debugging...
    3. <flag verbose="true" />
  4. Enable multi-threaded runs [beta]
    1. Controls the number of threads used in the run
    2. Default is 1
    3. <flag threads="2" />