The Design Checker is a collection of checks to look for mistakes in your design that are hard to spot in designs, especially big or complex designs.   The script allows you to configure the checks you would like to run and then displays any errors that were found in either the current project or the active schematic or system diagram.   

Run Check

 

 <input type="button" class="gh-button" value="Run Design Checker" onclick="run_check();">
<script type="text/javascript">
    function return_html(Response) {
        /* this gets called once runAwrScript is complete */
        var fnCall = JSON.parse(Response);
        if (fnCall.errCode == 0) {
                obj = document.getElementById("results");
				var myHtml = "";
				 for(var i = 0; i < fnCall.retValue.length; i += 1) {
					 myHtml +="<h3>" + fnCall.retValue[i].Text + "</h3>";
	
					if (i < fnCall.retValue.length-1 ) {
					 	var errs = fnCall.retValue[i].errors;
					 	for (var ind = 0; ind < errs.length; ind += 1) {
							myHtml += "<p id=\"mwo_higlight\" onclick = \"runAwrScript('highlight_schematic','" + errs[ind].doc + "','" + errs[ind].elem + "','" + errs[ind].type + "');\">" + errs[ind].msg + "</p>";
						}
					}
				
				 }
				obj.innerHTML =myHtml
  			}
		
		 else
            alert("Failed to get project name");
    }
    function run_check()
    {
        /* javascript does not wait for function completion so we need a callback
           function if we want a return value */
        runAwrGlobalScript('Design_Checker','Design_Checker');
        runAwrScript('parse_check', return_html);
    }
</script>

 

Review Results

 <h2 id="results"><p>Results will be here</p></h2>
<script id="awrscript" type="text/awrscript">
    Function highlight_schematic(s As String, e As String, typ As Integer)
    Dim sc As Schematic
    Dim sy As SystemDiagram
    Dim el As Element
    Dim w As Window
    Dim wds() As Window

    'get array of windows
    For i = 1 To MWOffice.Windows.Count
        If i = 1 Then
            ReDim wds(0)
            Set wds(0) = MWOffice.Windows(i)
        Else
            ReDim Preserve wds(i-1)
            Set wds(i-1) = MWOffice.Windows(i)
        End If
    Next i


    If typ = 1 Then'schematic
        If Project.Schematics.Exists(s) Then
            Set sc = Project.Schematics(s)
            found = 0
            For i = 0 To UBound(wds)
                If window_doc(wds(i).Caption) = sc.Name Then
                    If wds(i).Type = 9 Then 'schematic
                        Set w = wds(i)
                        w.Activate
                        w.WindowState=mwWS_Maximized
                        found = 1
                    End If
                End If
            Next i
            If found = 0 Then
                Set w = sc.NewWindow
            End If
            'get view number
            tmp = w.Caption
            tks = Split(tmp,":")
            If UBound(tks) = 0 Then
                vn = 1
            Else
                vn=CInt(tks(1))
            End If
            If sc.Elements.Exists(e) Then
                Set el = sc.Elements(e)
                el.Selected=True
                sc.Views(vn).ZoomSelected
                sc.Views(vn).ZoomOut
            End If
        End If
    ElseIf typ = 2 Then 'system diagram
        If Project.SystemDiagrams.Exists(s) Then
            Set sy = Project.SystemDiagrams(s)
            found = 0
            For i = 0 To UBound(wds)
                If window_doc(wds(i).Caption) = sy.Name Then
                    If wds(i).Type = 12 Then 'schematic
                        Set w = wds(i)
                        w.Activate
                        w.WindowState=mwWS_Maximized
                        found = 1
                    End If
                End If
            Next i
            If found = 0 Then
                Set w = sy.NewWindow
            End If
            'get view number
            tmp = w.Caption
            tks = Split(tmp,":")
            If UBound(tks) = 0 Then
                vn = 1
            Else
                vn=CInt(tks(1))
            End If
            If sy.Elements.Exists(e) Then
                Set el = sy.Elements(e)
                el.Selected=True
                sy.Views(vn).ZoomSelected
                sy.Views(vn).ZoomOut
            End If
        End If
    End If
End Function
Function window_doc(s As String) As String
    tks = Split(s,":")
    tks2 = Split(tks(0),"(")
    window_doc = tks2(0)
End Function
Function parse_check() As String

    dnt = Project.DataFiles("Project_Errors").DataAsText
    tks = Split(dnt,vbLf)
    'make hmtl
    'If no tab, his h3
    'If tab, use p but need To use the header To Get Type, 1=sch, 2=sys, 3 other For Now.
    html = "["
    start = True

    For i = 1 To UBound (tks) 'skip first line
        'Debug.Print tks(i)
        'section titles, but skip
        If Trim(tks(i)) = "" Then 'skip blanks

        ElseIf Left(tks(i),1) <> vbTab Then'found header, start new top level object.
            Select Case tks(i)
            Case "Checking for Obsolete Circuit Models:"
                typ = 1
            Case "Checking for Obsolete System Models:"
                typ=2
            Case "Checking for _FREQ in Output Equations:"
                typ=3 'could open up this window, not done yet.
            Case "Checking Layout Settings:"
                typ=3 'could get access to this dialog box, would be a new case.
            Case "Checking Layout Parameters Precision:"
                typ=1
            Case "Checking for Models Connected with Mismatched Widths:"
                typ=1
            Case "Checking for Shorted Elements:"
                typ=1
            Case "Checking for Open Nodes:"
                typ=1
            Case "Checking for Overlapping Elements:"
                typ=1
            Case "Checking for GDSII Formatted Layers in Drawing Layer List:"
                typ=3
            Case "Checking if Project PDKs Need Updates:"
                typ=3
            Case Else
                typ = 3
            End Select

            'html = html & "<h3>" & Replace(tks(i),":","") & "</h3>" & vbCrLf
            If InStr(tks(i),"Check time") Then
                'html = html & "{""Text"":""" &  tks(i) & """}"

                If start = True Then 'see if the first object, otherwise need to close it down
                    start=False
                Else
                    html = html & "] },"
                End If
                html = html & "{""Text"":""" &  tks(i) & """}"
            Else
                If start = True Then 'see if the first object, otherwise need to close it down
                    start=False
                Else
                    html = html & "] },"
                End If
                html = html & "{""Text"":""" &  tks(i) & """, ""errors"": ["
            End If
            'need to not have comma at the end.

        Else 'means not header, use type to see if can find schematic/system diagram
            If typ = 1 Or typ = 2  Then
                tks2 = Split(tks(i),":")
                s = Trim(Split(tks2(1),",")(0))
                e = Trim(Split(tks2(2)," ")(1))
                e = Replace(e,",","") 'one check has comma aftter element.
   				'html = html & "<p id=""mwo_highligt"" onclick=""runAwrScript('highlight_schematic','" & s & "','" & e & "','" & 1 & "')"">" & tks(i) & "</p>" & vbCrLf
                html = html & "{""doc"":""" & s & """,""elem"":""" & e & """,""type"":""" & typ & """,""msg"":""" & Replace(tks(i),vbTab,"")& """}"
                'determine next line if it is another error or new category to get array separator right
                If Left(tks(i+1),1) = vbTab Then
                    html = html & ","
                End If
                'needs a comma between items but not at the end
            Else
                'just print messages here and the type.
                html = html & "{""type"":""" & typ & """,""msg"":""" & Replace(tks(i),vbTab,"")& """}"
                If Left(tks(i+1),1) = vbTab Then
                    html = html & ","
                End If
            End If
        End If
    Next i
    html = html & "  ]" 'end of json object at top level.
    parse_check= html
End Function
</script> 

To Do

  1. How to get the JavaScript to wait for the vb code to be finished.  
  2. For opening window and highlight, don't open new window if already opened.  This is an update in the VBCode that does this. 
  3. for the html created, need to have a class not an id so we can format all of those links as one.  
  4. Get rest of the page on here from the KB
  5. Build the form in html that controls the code.  Will have to reformat the VB Code to take input for this control.  Need to think how that would work.  

Lessons Learned

Error Types Descriptions

Obsolete Circuit Models

This check will look for any circuit model that is now considered obsolete and recommend an different model to use. Typically these models issue a warning when simulated but the warning is easy to miss. As a designer you should decide if the obsolete model is okay to continue using in your design.

Obsolete System Models

This check will look for any system model that is now considered obsolete and recommend an different model to use. Typically these models issue a warning when simulated but the warning is easy to miss. As a designer you should decide if the obsolete model is okay to continue using in your design.

_FREQ in Output Equations

Many times while writing output equations, you will want to also get the frequencies associated with any measurement (or any other measurement's x-axis values). People have used _FREQ built in variable in the past. This variable can changed based on simulation order which means equations that work at one point could not work when a design changes. The better approach is to the "swpval(x)" function where x would be the result of an output equation.

Orthogonal Layout Mode

There are several layout options available on the Options > Layout Options and the Layout tab that help designs not have gaps in layout when building hierarchical designs. The right settings depend on if your layout is orthogonal or not. We find that many designers are not sure which mode they are in and so this check will determine if your layout is orthogonal or not and which options to change if needed.

Model Layout Precision

Many times model parameters can have more precision that the data base unit size of the layout. This typically is not a problem but might cause layouts to not properly snap together.

Mismatched Widths

This checks for any models that are connected that have widths parameters that do not match. We prefer users to use intelligent models (where a model can get its width from the model it is connected to), however many customers do not and can have data entry errors where widths of connecting models should match but do not. For example, when using equations, it is possible to type the wrong equation values as shown below.

This check will report any elements that were found in this condition.

Shorted Circuit Elements

This checks for any models that are enabled but have all of their nodes shorted together. This condition is typically a case where a designer intended to disable an element and did not.

This check will report any elements that were found in this condition.

Open Circuit Elements

This checks for any models that are enabled and have nodes that are not connected to anything. This condition is typically a case where a designer overlapped nodes to connect them and miss placed a part. The picture below shows this case where the nodes of both resistors are not overlapped. In a big schematic this error would be difficult to spot.

This check will report any elements that were found in this condition.

Overlapping Circuit Elements

This checks for any models that are exactly on top of one another. The picture below shows this case where the left resistor looks like there is one resistor, but actually there are two that are exactly overlapping.

This check will report any elements that were found in this condition.

GDS Formatted Drawing Layers

This checks for any drawing layers using GDSII formatted drawing layer names. This typically happens when using a model or importing an artwork cell where the correct layers are not already setup. The drawing system will automatically add the layers as drawing layers and model layers. Typically designers like to keep the drawing layer list clean for the named layers they understand for their process. The typical fix is to go into the model layer mapping and map the same model layer to a different drawing layer for your process and then delete this drawing layer.

PDK Version Check

This checks for if there are any newer PDKs availabe for the existing PDK's in the project. The check goes through each existing PDKs one by one and then goes through the AWR PDK Availibility library in the vendor libraries and see if there is a newer version of the PDK available. Then it informs the user of the result. You need to have internet connection to run this check.