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 utility 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
HTML |
---|
<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
HTML |
---|
<h2 id="results"><p>Results will be here</p></h2>
|
This utility is configured to run two different ways.
- The group below will run the script from the AWRDE using the dialog from the utility.
- There is a form lower down that runs and returns the errors to this page. Any error with a link will browse the program to that error, offering more capability than the previous way to run.
Run Check from the AWRDE
Awr script page macro | ||||||||
---|---|---|---|---|---|---|---|---|
|
When the utility is done, a data file named "Project_Errors" is added to your project and opened.
If the data file "Project_Errors" is in the project, the script will remember the last checks you ran and will have those checks enabled in the dialog. Each will overwrite the "Project_Errors" file, you should make a copy of the file if you want to keep results around.
Run Check from this Website
HTML |
---|
<form id = "design_form">
<input type="checkbox" name="sch_obs" value="1" checked="true">Obsolete Circuit Models (recommended replacement listed)<br>
<input type="checkbox" name="sys_obs" value="1" checked="true">Obsolete System Models (recommended replacement listed)<br>
<input type="checkbox" name="freq" value="1" checked="true">_FREQ in Output Equations (recommended equation solution listed)<br>
<input type="checkbox" name="layout_opts" value="1" checked="true">Layout Options (list options needed for layout style found)<br>
<input type="checkbox" name="layout_prec" value="1" checked="true">Model Layout Precision (list layout parameter with more precision that the DBU)<br>
<input type="checkbox" name="width_mismatch" value="1" checked="true">Mismatched Widths (check for connected models with widths that are not matched)<br>
<input type="checkbox" name="shorted" value="1" checked="true">Shorted Circuit Elements (list models with all nodes shorted)<br>
<input type="checkbox" name="open" value="1" checked="true">Open Circuit Nodes (list models with nodes not connected)<br>
<input type="checkbox" name="overlap" value="1" checked="true">Overlapping Circuit Elements (list models that are completely overlapping)<br>
<input type="checkbox" name="gds_layers" value="1" checked="true">GDS Formatted Drawing Layers (Lists any GDSII formatted Drawing Layers)<br>
<input type="checkbox" name="gds_layers" value="1" checked="true">PDK Version Check (Checks the existing PDKs and see if there is a newer version available)<br>
How Much to Check <br>
<input type="radio" name="check_type" value="entire" checked="true">Entire Design<br>
<input type="radio" name="check_type" value="active">Active Schematic/System Diagram<br>
</form>
|
HTML |
---|
<input type="button" class="gh-button" value="Run Design Checker From Website" onclick="awrform_submit();">
<br>
<!--<input type="button" class="gh-button" value="Run Design Checker with VB UI" onclick="run_check();">-->
<script type="text/javascript">
function wait_check(Response) {
runAwrScript('parse_check', return_html);
}
function control_check(Response) {
runAwrGlobalScript('Design_Checker','Design_Checker',wait_check);
}
function return_html(Response) {
/* this gets called once runAwrScript is complete */
var fnCall = JSON.parse(Response); |
HTML |
<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 if (fnCall.errCode == 10) Then{ ReDim wds(0) Set wds(0) obj = MWOfficedocument.WindowsgetElementById(i"results"); var myHtml = ""; for(var i = 0; 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< 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) { if (typeof(errs[ind].doc) == "undefined") { myHtml += "<p>" + errs[ind].msg + "</p>"; } else { myHtml += "<p><a class=\"external-link\" rel=\"nofollow\" onclick = \"runAwrScript('highlight_schematic','" + errs[ind].doc + "','" + errs[ind].elem + "','" + errs[ind].type + "');\">" + errs[ind].msg + "</a></p>"; } } } } obj.innerHTML =myHtml } else alert(fnCall.errMsg); } Iffunction wdsrun_check(i).Type = 9 Then 'schematic{ /* javascript does not wait for function completion so we need Set w = wds(i)a callback function if we want a return w.Activate value */ document.getElementById("results").innerHTML = "Check Running, it might take a while, please be patient" runAwrGlobalScript('Design_Checker','Design_Checker',wait_check); } w.WindowState=mwWS_Maximized function awrform_submit() { var x = document.getElementById("design_form"); var text = ""; var i; foundfor (i = 1 0; i < x.length ;i++) { if (x.elements[i].checked) { text = text + "1,"; } else { text = text + "0,"; } End If} <!--document.getElementById("results").innerHTML = text; used to display the End If Next icontrol string--> document.getElementById("results").innerHTML = "Check Running, it might take a while, please be patient" runAwrScript('Design_Checker_Control_File',text, control_check); } </script> |
Review Results
HTML |
---|
<h2 id="results"><p></p></h2> |
HTML |
---|
<script id="awrscript" type="text/awrscript"> If found = 0 Then Function highlight_schematic(s As String, e As String, typ As Integer) Dim sc As Schematic SetDim wsy =As sc.NewWindowSystemDiagram Dim el As Element Dim w EndAs IfWindow Dim wds() As Window 'get viewarray number of windows ReDim wds(0) '0 index will tmp = w.Captionbe blank 'get array of windows For tksi = Split(tmp,":") 1 To MWOffice.Windows.Count ReDim IfPreserve UBoundwds(tks) = 0 Theni) Set wds(i) = MWOffice.Windows(i) vnNext i If typ = 1 Then'schematic If ElseProject.Schematics.Exists(s) Then Set sc vn=CInt(tks(1)) = Project.Schematics(s) found End= If0 If sc.Elements.Exists(e) ThenFor i = 1 To UBound(wds) Set el = sc.Elements(e) If window_doc(wds(i).Caption) = sc.Name Then el.Selected=True If wds(i).Type = 9 Then 'schematic sc.Views(vn).ZoomSelected Set w = sc.Views(vn).ZoomOut wds(i) End If End Ifw.Activate ElseIf typ = 2 Then 'system diagram If Project.SystemDiagrams.Exists(s) Then w.WindowState=mwWS_Maximized Set sy = Project.SystemDiagrams(s) found = 1 found = 0 For i = 0 To UBound(wds) End If End If window_doc(wds(i).Caption) = sy.Name Then Next i If wds(i).Typefound = 120 Then 'schematic Set w = sc.NewWindow w.WindowState=mwWS_Maximized Set w = wds(i) End If 'get view number w.Activate tmp = w.Caption tks w.WindowState=mwWS_Maximized= Split(tmp,":") If UBound(tks) = 0 Then found = 1 vn = 1 End IfElse End Ifvn=CInt(tks(1)) NextEnd iIf 'remove any selected elements If found = 0 sc.SelectedElements.RemoveAll If sc.Elements.Exists(e) Then Set wel = sy.NewWindowsc.Elements(e) End If el.Selected=True 'get view number sc.Views(vn).ZoomSelected tmp = w.Caption tks = Split(tmp,":") sc.Views(vn).ZoomOut End If UBound(tks) = 0 Then End If ElseIf typ = 2 Then vn = 1'system diagram If ElseProject.SystemDiagrams.Exists(s) Then Set sy vn=CInt(tks(1))= Project.SystemDiagrams(s) found End= If0 If sy.Elements.Exists(e) ThenFor i = 1 To UBound(wds) Set elIf window_doc(wds(i).Caption) = sy.Elements(e)Name Then el.Selected=True If wds(i).Type = 12 Then 'schematic sy.Views(vn).ZoomSelected Set w = sy.Views(vn).ZoomOutwds(i) End If End Ifw.Activate End If End Function Function window_doc(s As String) As String tks = Split(s,":") tks2 = Split(tks(0),"(")w.WindowState=mwWS_Maximized window_doc = tks2(0) End Function Function parse_check() As String dnt = Project.DataFiles("Project_Errors").DataAsText tksfound = Split(dnt,vbLf)1 'make hmtl 'If no tab, his h3 End 'If tab, use p but need To use the header To Get Type, 1=sch, 2=sys, 3 other For Now.End If html = "[" start = Next Truei For i = 1 To UBoundIf (tks) 'skip first linefound = 0 Then 'Debug.Print tks(i) Set 'sectionw titles, but skip = sy.NewWindow w.WindowState=mwWS_Maximized If Trim(tks(i)) = ""End ThenIf 'skip blanks ElseIf Left(tks(i),1) <> vbTab Then'found header, start new top level object. 'get view number tmp = w.Caption Selecttks Case= tks(iSplit(tmp,":") Case "Checking for Obsolete Circuit Models:"If UBound(tks) = 0 Then typvn = 1 Case "Checking for Obsolete System Models:"Else typ=2vn=CInt(tks(1)) Case "Checking for _FREQ in Output Equations:" End If 'remove any selected elements sy.SelectedElements.RemoveAll typ=3 'could open up this window, not done yet.If sy.Elements.Exists(e) Then Case "Checking Layout Settings:" Set el = sy.Elements(e) typ=3 'could get access to this dialog box, would be a new case. el.Selected=True Case "Checking Layout Parameters Precision:" sy.Views(vn).ZoomSelected typ=1sy.Views(vn).ZoomOut Case "Checking for Models Connected with Mismatched Widths:"End If End If typ=1 End If Mwoffice.activate End Function Function window_doc(s As String) As String tks Case "Checking for Shorted Elements:"= Split(s,":") tks2 = Split(tks(0),"(") window_doc = tks2(0) End Function Function parse_check() As typ=1String dnt = Project.DataFiles("Project_Errors").DataAsText Casetks "Checking for Open Nodes:" = Split(dnt,vbLf) 'make hmtl 'If no tab, his h3 typ=1 Case "Checking for Overlapping Elements:"'If tab, use p but need To use the header To Get Type, 1=sch, 2=sys, 3 other For Now. html = "[" start = True typFor i = 1 To UBound (tks) 'skip first line Case "Checking for GDSII Formatted Layers in Drawing Layer List:" 'Debug.Print tks(i) 'section titles, but skip If typ=3 Trim(tks(i)) = "" Then 'skip blanks Case "Checking if Project PDKs Need Updates:" ElseIf Left(tks(i),1) <> vbTab Then'found header, start new top level object. Select typ=3Case tks(i) Case Else"Checking for Obsolete Circuit Models:" typ = 31 Case "Checking Endfor Select Obsolete System Models:" 'html = html & "<h3>" & Replace(tks(i),":","") & "</h3>" & vbCrLf typ=2 Case "Checking for _FREQ If InStr(tks(i),"Check time") Thenin Output Equations:" 'html typ=3 html'could & "{""Text"":""" & tks(i) & """}" open up this window, not done yet. Case "Checking Layout Settings:" If start = True Then 'see if the first object, otherwise need to close it down typ=3 'could get access to this dialog box, would be a new case. start=False Case "Checking Layout Parameters Precision:" Else typ=1 htmlCase ="Checking htmlfor &Models "] },Connected with Mismatched Widths:" End Iftyp=1 Case "Checking for html = html & "{""Text"":""" & tks(i) & """}" Shorted Elements:" Elsetyp=1 Case "Checking for Open IfNodes:" start = True Then 'see if the first object, otherwise need to close it down typ=1 Case "Checking for Overlapping Elements:" starttyp=False1 Case "Checking for GDSII Else Formatted Layers in Drawing Layer List:" html typ=3 html & "] }," Case "Checking if Project PDKs Need Updates:" End If typ=3 html = html & "{""Text"":""" & tks(i) & """, ""errors"": ["Case Else End If typ = 3 'need to not have comma at the end.End Select Else 'means not header, use'html type= tohtml see& if"<h3>" can find schematic/system diagram& Replace(tks(i),":","") & "</h3>" & vbCrLf If typ = 1 Or typ = 2 Then InStr(tks(i),"Check time") Then 'html = html & "{""Text"":""" & tks2 = Split(tks(i),":") & """}" sIf start = Trim(Split(tks2(1),",")(0)) True Then 'see if the first object, otherwise need to close it down e = Trim(Split(tks2(2)," ")(1)) start=False e = Replace(e,",","") 'one check has commaElse 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""] }," End If html = html & "{""Text"":""" & Replace(tks(i),vbTab,"") & """}" Else 'determine next line if it is another error orIf newstart category= toTrue getThen array'see separatorif right the first object, otherwise need to close it down If Left(tks(i+1),1) = vbTab Then start=False html = html & ","Else End If html = html & "] }," 'needs a comma between items but not at theEnd endIf Else html = html & "{""Text"":""" & tks(i) & """, ""errors"": [" 'just print messages here and the type. End If html = html'need & "{""type"":""" & typ & """,""msg"":""" & Replace(tks(i),vbTab,"")& """}"to not have comma at the end. Else 'means not header, use type to see If Left(tks(i+1),1) = vbTab Thenif can find schematic/system diagram If typ = 1 Or typ = 2 html = html & "," Then End If InStr(tks(i),"skipped since active window") Then End If End If Next i html = html & " ]" 'end of json object at top level. parse_check= html End Function </script> |
To Do
- How to get the JavaScript to wait for the vb code to be finished.
- For opening window and highlight, don't open new window if already opened. This is an update in the VBCode that does this.
- for the html created, need to have a class not an id so we can format all of those links as one.
- Get rest of the page on here from the KB
- 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
...
"{""type"":""" & typ & """,""msg"":""" & Replace(tks(i),vbTab,"")& """}"
If Left(tks(i+1),1) = vbTab Then
html = html & ","
End If
Else
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
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
Sub Design_Checker_Control_File(s As String)
Dim dctrl As DataFile
fn = "Design_Checker_Control"
If Project.DataFiles.Exists(fn) Then
Project.DataFiles.Remove(fn)
End If
Set dctrl = Project.DataFiles.Add(fn,fn,True,mwDFT_TXT)
dctrl.DataAsText=s
End Sub
</script> |
...
Error Types Descriptions
Obsolete Circuit Models
...
_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 change 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.
...
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.
...
PDK Version Check
This checks for if there are any newer PDKs availabe available 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.