I have the requested information in the following text. I have
indicated where each rule is called from using "<<<<<<<<<"
I appreciate all your help with this.
Jeff Ruff
Rule 1
(defrule circle-pad-without-tolerance
(pkgtype ?p &:(neq ?p bga))
(PkgShape ?ps &:(eq ?ps circle))
(UseTol ?ut &:(eq ?ut false))
=>
(printout t "Circular pad that is not a bga found" crlf)
(if (eq ?code smd)
then
(printout t "Surface mount part found" crlf)
;;Calculate Top copper pad
(assert (top-pad (* (- 1 ?ToeToPad) ?CirclePadDiameter)))
(bind ?top-pad (* (- 1 ?ToeToPad) ?CirclePadDiameter))
(store TopPad ?top-pad)
(printout t "Top Pad Diameter is " ?top-pad crlf)
;;Calculate Top mask pad
(assert (top-mask (+ ?top-pad (* (* 2 ?PadToMaskX)
?RuleMultiplier))))
(bind ?top-mask (+ ?top-pad (* (* 2 ?PadToMaskX)
?RuleMultiplier)))
(store TopMask ?top-mask)
(printout t "Top Mask Diameter is " ?top-mask crlf)
;;Calculate Top paste pad
(assert (top-paste (+ ?top-pad (* (* 2 ?PadToPasteX)
?RuleMultiplier))))
(bind ?top-paste (+ ?top-pad (* (* 2 ?PadToPasteX)
?RuleMultiplier)))
(store TopPaste ?top-paste)
(printout t "Top Paste Diameter is " ?top-paste crlf)
(assert (create-padstack-name))
else
;; Calculate drill
(assert (drill-dia (+ ?CirclePadDiameter (* 2 (* ?pinTodrill
?RuleMultiplier)))))
(bind ?drill-dia (+ ?CirclePadDiameter (* 2 (* ?pinTodrill
?RuleMultiplier))))
(printout t "Drill Diameter is "?drill-dia crlf)
;;Calculate Top copper pad
(assert (top-pad (+ ?drill-dia (* 2 (* ?padTodrill
?RuleMultiplier)))))
(bind ?top-pad (+ ?drill-dia (* 2 (* ?padTodrill
?RuleMultiplier))))
(store TopPad ?top-pad)
(printout t "Top Pad Diameter is " ?top-pad crlf)
;;Calculate Top Mask pad
(assert (top-mask (+ ?top-pad (* 2 (* ?PadToMaskX
?RuleMultiplier)))))
(bind ?top-mask (+ ?top-pad (* 2 (* ?PadToMaskX
?RuleMultiplier))))
(store TopMask ?top-mask)
(printout t "Top Mask Diameter is " ?top-mask crlf)
;;Calculate Internal copper pad
(assert (int-pad (+ ?top-pad (* 2 (* ?intPadoffX
?RuleMultiplier)))))
(bind ?int-pad (+ ?top-pad (* 2 (* ?intPadoffX
?RuleMultiplier))))
(store IntPad ?int-pad)
(printout t "Internal Pad Diameter is " ?int-pad crlf)
;;Calculate Internal mask clearance
(assert (int-clr (+ ?top-pad (* 2 (* ?intClroffX
?RuleMultiplier)))))
(bind ?int-clr (+ ?top-pad (* 2 (* ?intClroffX
?RuleMultiplier))))
(store IntClr ?int-clr)
(printout t "Internal Clearance Diameter is " ?int-clr crlf)
;;Calculate Bottom copper pad
(assert (bot-pad (+ ?top-pad (* 2 (* ?botPadoffX
?RuleMultiplier)))))
(bind ?bot-pad (+ ?top-pad (* 2 (* ?botPadoffX
?RuleMultiplier))))
(store BotPad ?bot-pad)
(printout t "Bottom Pad Diameter is " ?bot-pad crlf)
;;Calculate Bottom Mask pad
(assert (bot-clr (+ ?top-pad (* 2 (* ?botClroffX
?RuleMultiplier)))))
(bind ?bot-clr (+ ?top-pad (* 2 (* ?botClroffX
?RuleMultiplier))))
(store BotClr ?bot-clr)
(printout t "Bottom Clearance Diameter is " ?bot-clr crlf)
;;Set flag to create padstack name
(assert (create-padstack-name))<<<<<<<<<<<<<<<<<Rule2
)
);;Close smt-circle-pad rule without tolerances
Rule 2
;;Create padstack name
(defrule padstack-name
(create-padstack-name)
=>
(printout t "Creating Padstack Name" crlf)
(if (eq ?code smd)
then
(bind ?pos1 s)
else
(bind ?pos1 t)
)
(bind ?pos2 p)
(if (or (eq ?unit mm) (eq ?unit micron))
then
(bind ?pos3 m)
else
(bind ?pos3 i)
)
(if (eq (fetch pkgShape) circle)
then
(bind ?pos4-11 (format nil "%04d" (* (fetch TopPad) 0.001)))
else
(bind ?pos4-8 (format nil "%04d" (* (fetch TopPadWidth)
0.001)))
(bind ?pos9-11 (format nil "%04d" (* (fetch TopPadHeight)
0.001)))
)
(if (eq (fetch pkgType) bga)
then
(bind ?pos12 b)
)
(if (eq (fetch pkgType) pga)
then
(bind ?pos12 p)
)
(if (eq (fetch pkgType) plcc)
then
(bind ?pos12 c)
)
(if (eq (fetch pkgType) qfp)
then
(bind ?pos12 q)
)
(if (eq (fetch pkgType) soic)
then
(bind ?pos12 s)
)
(if (eq (fetch pkgType) dip)
then
(bind ?pos12 d)
)
(if (eq (fetch pkgType) zip)
then
(bind ?pos12 z)
)
(if (eq (fetch pkgType) sip)
then
(bind ?pos12 n)
)
(if (eq (fetch pkgType) smd_discrete)
then
(bind ?pos12 m)
)
(if (eq (fetch pkgType) th_discrete)
then
(bind ?pos12 t)
)
(if (eq (fetch pkgType) soj)
then
(bind ?pos12 j)
)
(bind ?pos13 1)
(if(eq (fetch pkgShape) circle)
then
(assert (capture-padstack)) <<<<<<<<<<<<<<Rule3
(bind ?padstack-name (str-cat ?pos1 ?pos2 ?pos3 ?pos4-11 ?pos12
?pos13))
else
(assert (capture-padstack))
(bind ?padstack-name (str-cat ?pos1 ?pos2 ?pos3 ?pos4-8 ?pos9-11
?pos12 ?pos13))
)
(store PadStackName ?padstack-name)
(printout t "Derived padstack name " (fetch PadStackName) crlf)
;;Add PhysPort to pin element and assign padstack name as MasterViewName
(set ?pView viewType (get-member JDBViewType
VIEWTYPE_IS_PHYSICAL_PACKAGE))
(bind ?pGroup (?pView findGroup "body"))
;;(printout t "The Group is " (get ?pGroup groupId) crlf)
(bind ?q (?pView pinElements))
(while (?q hasMoreElements)
(bind ?pPin (?q nextElement))
(bind ?pPhysPort (?pPin createPhysPort))
(?pPhysPort setMasterViewName ?padstack-name)
;;(printout t "The Pin found is " (get ?pPin pinName) crlf)
)
(JDBViewFact ?pView)
);;Close name padstack
Rule 3
(defrule add-pad-to-jdb
(capture-padstack)
=>
(printout t "Updating JDB for PadStack Information" crlf)
)
Output from program
Jess Version 6.0 12/7/2001
JESS startup rule set to load JDB content
f-0 (MAIN::pkgWidth 6600000.0)
f-1 (MAIN::pkgWidthTol 5080000.0)
f-2 (MAIN::pkgLength 3.188E7)
f-3 (MAIN::pkgLengthTol 640000.0)
f-4 (MAIN::pkgHeight nil)
f-5 (MAIN::pkgHeightTol 0.0)
f-6 (MAIN::Ypitch 7620000.0)
f-7 (MAIN::Xpitch 2540000.0)
f-8 (MAIN::pindir 0)
f-9 (MAIN::PkgShape circle)
f-10 (MAIN::pkgtype dip)
f-11 (MAIN::code th)
f-12 (MAIN::units mm)
f-13 (MAIN::UseTol false)
f-14 (MAIN::pinloctol 1420000.0)
f-15 (MAIN::pinSizeTol 0.0)
f-16 (MAIN::pkgpitch std)
f-17 (MAIN::ruleSet two)
f-18 (MAIN::diaCircle 530000.0)
f-19 (MAIN::dimRectangleWidth nil)
f-20 (MAIN::dimRectangleHeight nil)
f-21 (MAIN::RuleMulti 1000000.0)
f-22 (MAIN::silkscreen 0.2)
f-23 (MAIN::toeTopad 0.8)
f-24 (MAIN::heelTopad 0.8)
f-25 (MAIN::padTomaskX 0.1)
f-26 (MAIN::padTomaskY 0.1)
f-27 (MAIN::padTopasteX 0.0)
f-28 (MAIN::padTopasteY 0.0)
f-29 (MAIN::padTodrill 0.52)
f-30 (MAIN::intPadoffX 0.0)
f-31 (MAIN::intPadoffY 0.0)
f-32 (MAIN::intClroffX 0.1)
f-33 (MAIN::intClroffY 0.1)
f-34 (MAIN::botPadoffX 0.0)
f-35 (MAIN::botPadoffY 0.0)
f-36 (MAIN::botClroffX 0.05)
f-37 (MAIN::botClroffY 0.05)
f-38 (MAIN::side 0.05)
f-39 (MAIN::courtYardexcess 0.25)
f-40 (MAIN::roundOfffactor 0.05)
f-41 (MAIN::pinTodrill 0.025)
For a total of 42 facts.
Setting rules in group rules
using code th pkgShape circle mask 0.1
Circular pad that is not a bga found
Drill Diameter is 580000.0
Top Pad Diameter is 1620000.0
Top Mask Diameter is 1820000.0
Internal Pad Diameter is 1620000.0
Internal Clearance Diameter is 1820000.0
Bottom Pad Diameter is 1620000.0
Bottom Clearance Diameter is 1720000.0
Creating Padstack Name
Derived padstack name tpm1620d1 <<<<<<<<Rule 3
should fire here
Done Opening Jess Engine to calculate pad geometries
"tpm1620d1" tpm1620d1
Requested View name is com.chipdata.jdb.JDBView@b4bc1e
Found View dip_test
Requested View name is com.chipdata.jdb.JDBView@b4bc1e
Found View dip_test
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:ejfried@;ca.sandia.gov]
Sent: Tuesday, November 05, 2002 1:33 PM
To: [EMAIL PROTECTED]
Subject: Re: JESS: Variable not being asserted
I think Ruff, Jeff wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> In further investigation, it appears that I cannot assert within a
rule
> called by a previous assert. I was trying to assert the value on the
RHS
> of a rule which is fired from a previous assertion within another
rule.
> Is this a problem for 6.0?
Nope, no such restriction.
>
> I can provide more of the code and/or output if required.
Seeing rules 1, 2, and 3, together with the output of (facts) at the
point when rule3 should fire but doesn't, would probably be enough for
us to help.
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify
[EMAIL PROTECTED]
--------------------------------------------------------------------
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------