0 Replies Latest reply on Aug 19, 2014 11:32 PM by geir.olsen

    Properties for global nets

    geir.olsen

      Hi All!

       

      I am trying to use a visual basic script to generate a report for derating of components. For resistors I need to calculate the power consumption of each resistor, and the margin to the rated power. I want to do this by adding a couple of attribute to each net, called VMAX and VMIN.

       

      Then by combining this with the resistor value and rating, I can calculate the actual power and compare it to the rated value.

       

      I get hold of the components on the active sheet using:

       

      Set colComponents = Application.ActiveView.Query(VDM_COMP, VD_ALL)

      For Each objComponent In colComponents

          'Only run on resistors, res_a and res_c is the two resistor symbol names

          If objComponent.SymbolBlock.SymbolType = VDB_MODULE Then

              ComponentSymName = objComponent.SymbolBlock.GetName(SHORT_NAME)

          End If

          If strComp(ComponentSymName, "res_a", 1) = 0 _

              Or StrComp(ComponentSymName, "res_c", 1) = 0 _

          Then

              Set objRatingAttr = objComponent.FindAttribute("RATING")

              If objRatingAttr Is Nothing Then

                  RatingVal = " "

              Else

                  RatingVal = objRatingAttr.Value

              End If

              Set objValueAttr = objComponent.FindAttribute("VALUE")

              If objValueAttr Is Nothing Then

                  ResVal = " "

              Else

                  ResVal = objRatingAttr.Value

              End If

              Set objConnections = objComponent.GetConnections()

              For Each objConnection In objConnections

                  Set Net = objConnection.Net

                  Set CmpPin = objConnection.CompPin

                  Set Seg = objConnection.Segment

                  If Not Net Is Nothing Then

                      Set objVMAX_Attr = Net.FindAttribute("VMAX")

                      If objVMAX_Attr is Nothing Then

                          VMaxVal = "NS"

                      Else

                          VMaxVal = objVMAX_Attr.Value

                      End If

                      Set objVMIN_Attr = Net.FindAttribute("VMIN")

                      If objVMIN_Attr is Nothing Then

                          VMinVal = "NS"

                      Else

                          VMinVal = objVMIN_Attr.Value

                      End If

                  End If

                  listboxOutput.AddString(" Value:    " & RatingVal & _

                              " Rating:   " & RatingVal & _

                              " VMax:     " & VMaxVal & _

                              " VMin:     " & VMinVal & _

                              " Pin Name: " & CmpPin.Pin.Label.TextString & _

                              " Net Name: " & NetName)

              Next

          End If

      Next

       

      I have a global net (type net symbol) that is used on several pages, called 3V3. Lets say that I set the properties "VMAX = 3.3" and "VMIN = 0" on page 4 in the design for this net in viewdraw. I do this by highlighting one of the segments on that net, use the properties tab, and add the properties.

       

      If I then run the above script on page 5, the two attributes are not visible in the script for page 5.

      If I use the schematics editor in viewdraw and look at the properties for one of the 3V3 net on page 5, the VMAX and VMIN attributes are visible.

       

      This also applies to all other named nets that occurs on more than one page. If I add the attributes in viewdraw on one page I cant read the same attributes on the same net on another page.

       

      - The design is flat, 17 pages

      - I connect signals from page to page by using net names

      - All power symbols is done with pin symbols with global net names

      - I use DxDesigner in PADS 9.5

       

      How do I set a property that is visible from a script for all instances of a given net on all pages of the design.

       

      Is the problem here that the property is attached to the given segment of that net and not the net directly?

       

      Any suggestion on how to do this?

       

      Best Regards

      Geir Tore Olsen