Documentation‎ > ‎

Write a Minimal Mason File


Header
The XML parser used requires the following header at the top of the page.  Please note that this is considered a closed tag- it simply lets the parser know what version Mason file is being read.

     <?xml version="1.0" ?>


Mason Tags
The Mason data is encapsulated in a <mason> tag, as below:

     <?xml version="1.0" ?>
     <mason>               
     </mason>              

Run Information
Beyond the actual components and ports, several tags are required for Mason to run- there are no defaults.  These include the simulation frequency and the location of the output file.

     <?xml version="1.0" ?>                                                                          
     <mason>                                                
        <freq start="100 MHz" stop="200 MHz" step="5 MHz" />
        <output name="sample.out" />                        

     </mason>                                               

Models

Mason takes an approach similar to Spice where models are defined separate from where they are instantiated.  That is, we describe what a component is and give the model an alias which can be used later to build our circuit.  Think of it like the palette, not the picture of the circuit itself.

     <?xml version="1.0"?>                                                               
     <mason>                                                                             
        <freq start="100 MHz" stop="200 MHz" step="5 MHz" />                             
        <output name="sample.out" />                                                     
        <model alias="TL">                                                               
           <primitive name="simple_transmission_lines/lossless_transmission_line.xml" /> 
        </model>                                                                         
     </mason>                                                                            

Ports and Devices
To build the circuit, you need to define both how the components connect as well as where the ports to the circuit are.  This uses a decidedly SPICE like approach of defining nodes/ nets.  The following Mason file will run correctly.

     <?xml version="1.0"?>                                                               
     <mason>                                                                             
        <freq start="100 MHz" stop="200 MHz" step="5 MHz" />                             
        <output name="sample.out" />                                                     
        <model alias="TL">                                                               
           <primitive name="simple_transmission_lines/lossless_transmission_line.xml" /> 
        </model>                                                                         
 
       <port number="1" node="1" impedance="50" />                                      
        <port number="2" node="2" impedance="100" />                                     

        <TL node_list="1 2" >                                                            
           <z0 value="70.71" />                                                          
           <f0 value="150 MHz" />                                                        
           <theta value="90 deg" />                                                      
        </TL>                                                                            
     </mason>                                                                            

Flags (optional)
Finally, while optional, flags are useful to modify the way Mason runs.  They can control the way files are output and the way Mason runs the simulation.  Below are some useful modifiers to change the output of the file.

     <?xml version="1.0"?>                                                               
     <mason>                                                                             
        <freq start="100 MHz" stop="200 MHz" step="5 MHz" />                             
        <output name="sample.out" />                                                     
        <model alias="TL">                                                               
           <primitive name="simple_transmission_lines/lossless_transmission_line.xml" /> 
        </model>                                                                         
        <port number="1" node="1" impedance="50" />                                      
        <port number="2" node="2" impedance="100" />                                     

        <TL node_list="1 2" >                                                            
           <z0 value="100" />                                                            
           <f0 value="150 MHz" />                                                        
           <theta value="90 deg" />                                                      
        </TL>                                                                            
        <flag output_data_format="dB" set_width="15" />                                  
     </mason>                                                                            


Comments