defpackage firrtl/errors : import core import verse import firrtl/ir2 import firrtl/ir-utils import firrtl/primops import firrtl/passes import firrtl-main ; TODO ; make sure it compiles, write tests, look over code to make sure its right ;========== ALL CHECKS ================= ;PARSER CHECK ; * No nested modules <- parser ; * Only modules in circuit (no statements or expressions) <- parser ; * Module must be a reference in inst declaration ;AFTER WIDTH INFERENCE ; o No names ; o No Unknowns ; o All widths are positive ; o pad's width is greater than value's width ; o widths are large enough to contain value ;AFTER LOWERING ; o All things connect to once ; o no reg ; o no accessors ;AFTER ?????? ; o No combinational loops ; o cannot connect to a pad, or a register. only connct to a reference ;================= High Form Check ========================== ; * Subexps of Subfield and Index can only be subfields, index, or refs ; * Can only connect to a Ref or Subfield or Index or WritePort ; * A module has the same name as main of circuit ; * mems cannot be a bundle with flips ; * instance module must have the same name as a defined module ; * reset must be UInt<1> ; * Unique names per module ; * No name can be a prefix of any other name. ; * all references are declared ; * UInt only has positive ints ; * Vector types has positive size ; * Width sizes are positive ; * Primops have the correct number of arguments public defstruct CheckHighForm <: Pass : sym : Symbol public defmethod pass (b:CheckHighForm) -> (Circuit -> Circuit) : check-high-form{_,sym(b)} public defmethod name (b:CheckHighForm) -> String : "High Form Check" public defmethod short-name (b:CheckHighForm) -> String : "high-form-check" ;----------------- Errors ------------------------ defn NotUnique (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Reference " name " does not have a unique name."] defn IsPrefix (info:FileInfo, name1:Symbol, name2:Symbol) : PassException $ string-join $ [info ": Reference " name1 " and " name2 " share a prefix."] defn InvalidLOC (info:FileInfo) : PassException $ string-join $ [info ": Invalid connect to an expression that is not a reference or a WritePort."] defn NegUInt (info:FileInfo) : PassException $ string-join $ [info ": UIntValue cannot be negative."] defn UndeclaredReference (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Reference " name " is not declared."] defn MemWithFlip (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Memory " name " cannot be a bundle type with flips."] defn InvalidSubfield (info:FileInfo) : PassException $ string-join $ [info ": Invalid subfield access to non-reference."] defn InvalidIndex (info:FileInfo) : PassException $ string-join $ [info ": Invalid index access to non-reference."] defn NoTopModule (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": A single module must be named " name "."] defn ModuleNotDefined (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Module " name " is not defined."] defn WrongReset (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Module " name " has a reset that is not of type UInt<1>."] defn IncorrectNumArgs (info:FileInfo, op:Symbol, n:Int) : PassException $ string-join $ [info ": Primop " op " requires " n " expression arguments."] defn IncorrectNumConsts (info:FileInfo, op:Symbol, n:Int) : PassException $ string-join $ [info ": Primop " op " requires " n " integer arguments."] defn NegWidth (info:FileInfo) : PassException $ string-join $ [info ": Width cannot be negative."] defn NegVecSize (info:FileInfo) : PassException $ string-join $ [info ": Vector type size cannot be negative."] ;---------------- Helper Functions -------------- defn has-flip? (t:Type) -> True|False : var has? = false defn find-flip (t:Type) -> Type : match(t) : (t:BundleType) : for f in fields(t) do : if flip(f) == REVERSE : has? = true t (t) : t find-flip(t) map(find-flip,t) has? defn contains? (c:?T,cs:Streamable) -> True|False : label myret : for x in cs do : if x == c : myret(true) false defn is-prefix? (s:Symbol,v:Vector,sym:Symbol) -> Symbol|False : defn is-prefix? (s1:Symbol,s2:Symbol) -> True|False : var is? = true val s1* = to-string(s1) val s2* = to-string(s2) for (x in s1*, y in s2*) do : if x != y : is? = false if length(s1*) > length(s2*) : if s1*[length(s2*)] != to-string(sym)[0] : is? = false if length(s1*) < length(s2*) : if s2*[length(s1*)] != to-string(sym)[0] : is? = false if length(s1*) == length(s2*) : is? = false is? label myret : for x in v do : if is-prefix?(x,s) : myret(x) false defn check-high-form-primop (e:DoPrim, errors:Vector,info:FileInfo) -> False : defn correct-num (ne:Int|False,nc:Int) -> False : if not (ne typeof False) : if length(args(e)) != ne as Int : add(errors,IncorrectNumArgs(info,to-symbol(op(e)),ne as Int)) if length(consts(e)) != nc : add(errors,IncorrectNumConsts(info,to-symbol $ op(e),nc)) switch {op(e) == _} : ADD-OP : correct-num(2,0) SUB-OP : correct-num(2,0) MUL-OP : correct-num(2,0) DIV-OP : correct-num(2,0) MOD-OP : correct-num(2,0) QUO-OP : correct-num(2,0) REM-OP : correct-num(2,0) ADD-WRAP-OP : correct-num(2,0) SUB-WRAP-OP : correct-num(2,0) LESS-OP : correct-num(2,0) LESS-EQ-OP : correct-num(2,0) GREATER-OP : correct-num(2,0) GREATER-EQ-OP : correct-num(2,0) EQUAL-OP : correct-num(2,0) NEQUAL-OP : correct-num(2,0) MUX-OP : correct-num(3,0) PAD-OP : correct-num(1,1) AS-UINT-OP : correct-num(1,0) AS-SINT-OP : correct-num(1,0) DYN-SHIFT-LEFT-OP : correct-num(2,0) DYN-SHIFT-RIGHT-OP : correct-num(2,0) SHIFT-LEFT-OP : correct-num(1,1) SHIFT-RIGHT-OP : correct-num(1,1) CONVERT-OP : correct-num(1,0) NEG-OP : correct-num(1,0) BIT-NOT-OP : correct-num(1,0) BIT-AND-OP : correct-num(2,0) BIT-OR-OP : correct-num(2,0) BIT-XOR-OP : correct-num(2,0) BIT-AND-REDUCE-OP : correct-num(false,0) BIT-OR-REDUCE-OP : correct-num(false,0) BIT-XOR-REDUCE-OP : correct-num(false,0) CONCAT-OP : correct-num(2,0) BIT-SELECT-OP : correct-num(1,1) BITS-SELECT-OP : correct-num(1,2) ;--------------- Check High Form Pass ------------------- public defn check-high-form (c:Circuit,sym:Symbol) -> Circuit : val errors = Vector() defn check-valid-loc (info:FileInfo,e:Expression) -> False : match(e) : (e:UIntValue|SIntValue|DoPrim|ReadPort|Register) : add(errors,InvalidLOC(info)) (e) : false defn check-high-form-w (info:FileInfo,w:Width) -> Width : match(w) : (w:IntWidth) : if width(w) < 0 : add(errors,NegWidth(info)) w (w) : w defn check-high-form-t (info:FileInfo,t:Type) -> Type : match(map(check-high-form-t{info,_},t)) : (t:VectorType) : if size(t) < 0 : add(errors,NegVecSize(info)) (t) : false map(check-high-form-w{info,_:Width},t) defn check-high-form-e (info:FileInfo,e:Expression,names:Vector) -> Expression : match(map(check-high-form-e{info,_,names},e)) : (e:Ref) : if not contains?(name(e),names) : add(errors,UndeclaredReference(info,name(e))) (e:Subfield) : match(exp(e)) : (e:Ref|Subfield|Index) : false (e) : add(errors,InvalidSubfield(info)) (e:Index) : match(exp(e)) : (e:Ref|Subfield|Index) : false (e) : add(errors,InvalidIndex(info)) (e:DoPrim) : check-high-form-primop(e,errors,info) ;; (e:UIntValue) : ;; if value(e) < 0 : ;; add(errors,NegUInt(info)) (e) : false map(check-high-form-w{info,_:Width},e) map(check-high-form-t{info,_:Type},e) e defn check-high-form-s (s:Stmt,names:Vector) -> Stmt : defn check-name (info:FileInfo,name:Symbol) -> False : if contains?(name,names) : add(errors,NotUnique(info,name)) val prefix = is-prefix?(name,names,sym) if prefix typeof Symbol : add(errors,IsPrefix(info,name,prefix as Symbol)) map(check-high-form-t{info(s),_:Type},s) map{check-high-form-s{_,names},_} $ { match(map(check-high-form-e{info(s),_,names},s)) : (s:DefWire|DefRegister) : check-name(info(s),name(s)) add(names,name(s)) (s:DefMemory) : check-name(info(s),name(s)) add(names,name(s)) if has-flip?(type(s)) : add(errors, MemWithFlip(info(s), name(s))) (s:DefInstance) : if not contains?(name(module(s) as Ref),map(name,modules(c))) : add(errors, ModuleNotDefined(info(s),name(module(s) as Ref))) check-name(info(s),name(s)) add(names,name(s)) (s:DefNode) : check-name(info(s),name(s)) add(names,name(s)) (s:DefAccessor) : check-name(info(s),name(s)) add(names,name(s)) (s:Connect) : check-valid-loc(info(s),loc(s)) (s:BulkConnect) : check-valid-loc(info(s),loc(s)) (s) : false s }() defn check-high-form-m (m:Module) -> False : val names = Vector() for m in modules(c) do : add(names,name(m)) for p in ports(m) do : add(names,name(p)) if name(p) == `reset : if direction(p) == OUTPUT : add(errors,WrongReset(info!(m),name(m))) else : if type(p) typeof UIntType : if width(type(p) as UIntType) != IntWidth(1) : add(errors,WrongReset(info!(m),name(m))) else : add(errors,WrongReset(info!(m),name(m))) map(check-high-form-t{info(p),_},type(p)) map(check-high-form-w{info(p),_},type(p)) add(names,`reset) match(m) : (m:ExModule) : false (m:InModule) : check-high-form-s(body(m),names) false var number-top-m = 0 for m in modules(c) do : if name(m) == main(c) : number-top-m = number-top-m + 1 check-high-form-m(m) if number-top-m != 1 : add(errors,NoTopModule(info!(c),main(c))) throw(PassExceptions(errors)) when not empty?(errors) c ;================= KIND CHECK ========================== ; o Cannot connect directly to a mem ever ; o onreset can only handle a register ; o Cannot use a mem in anything except an accessor, Readport, or Writeport public defstruct CheckKinds <: Pass public defmethod pass (b:CheckKinds) -> (Circuit -> Circuit) : check-kinds public defmethod name (b:CheckKinds) -> String : "Check Kinds" public defmethod short-name (b:CheckKinds) -> String : "check-kinds" ;----------------- Errors --------------------- defn NotMem (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Reference " name " must be a mem."] defn IsMem (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Reference " name " cannot be a mem."] defn OnResetNotReg (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Illegal on-reset to non-reg reference " name "."] ;----------------- Check Kinds Pass --------------------- ; I may have been overeager in looking for places where mems can't be, as mems are guaranteed to have a vector ; type, and this will get caught in the type check pass public defn check-kinds (c:Circuit) -> Circuit : val errors = Vector() defn check-not-mem (info:FileInfo,e:Expression) -> False : do(check-not-mem{info,_},e) match(e) : (e:WRef) : if kind(e) == MemKind() : add(errors,IsMem(info,name(e))) (e:WSubfield) : check-not-mem(info,exp(e)) (e:WIndex) : check-not-mem(info,exp(e)) (e) : false defn check-is-reg (info:FileInfo,e:Expression) -> False : do(check-is-reg{info,_},e) match(e) : (e:WRef) : if kind(e) != RegKind() : add(errors,OnResetNotReg(info,name(e))) (e:WSubfield) : check-is-reg(info,exp(e)) (e:WIndex) : check-is-reg(info,exp(e)) (e) : false defn check-is-mem (info:FileInfo,e:Expression) -> False : do(check-is-mem{info,_},e) match(e) : (e:WRef) : if kind(e) != MemKind() : add(errors,NotMem(info,name(e))) (e:WSubfield) : check-is-mem(info,exp(e)) (e:WIndex) : check-is-mem(info,exp(e)) (e) : false defn check-kinds-e (info:FileInfo,e:Expression) -> False : do(check-kinds-e{info,_},e) match(e) : (e:ReadPort) : check-is-mem(info,mem(e)) check-not-mem(info,index(e)) check-not-mem(info,enable(e)) (e:WritePort) : check-is-mem(info,mem(e)) check-not-mem(info,index(e)) check-not-mem(info,enable(e)) (e) : do(check-not-mem{info,_},e) defn check-kinds-s (s:Stmt) -> False : do(check-kinds-e{info(s),_:Expression},s) match(s) : (s:DefNode) : check-not-mem(info(s),value(s)) (s:DefAccessor) : check-not-mem(info(s),index(s)) (s:Conditionally) : check-not-mem(info(s),pred(s)) (s:Connect) : check-not-mem(info(s),loc(s)) check-not-mem(info(s),exp(s)) (s:BulkConnect) : check-not-mem(info(s),loc(s)) check-not-mem(info(s),exp(s)) (s:OnReset) : check-is-reg(info(s),loc(s)) check-not-mem(info(s),exp(s)) (s) : false do(check-kinds-s,s) for m in modules(c) do : match(m) : (m:ExModule) : false (m:InModule) : check-kinds-s(body(m)) throw(PassExceptions(errors)) when not empty?(errors) c ;==================== CHECK TYPES ===================== ; o Subfields are only on bundles, before type inference <- need to not error, just do unknown-type ; o Indexes are only on vectors ; o pred in conditionally must be of type UInt ; o enable/index in read/writeports must be UInt ; o node's value cannot be a bundle with a flip in it ; o := has same types ; o 2nd arg in dshr/l must be UInt, in general do primops public defstruct CheckTypes <: Pass public defmethod pass (b:CheckTypes) -> (Circuit -> Circuit) : check-types public defmethod name (b:CheckTypes) -> String : "Check Types" public defmethod short-name (b:CheckTypes) -> String : "check-types" ;----------------- Errors --------------------- defn SubfieldNotInBundle (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Subfield " name " is not in bundle."] defn SubfieldOnNonBundle (info:FileInfo, name:Symbol) : PassException $ string-join $ [info ": Subfield " name " is accessed on a non-bundle."] defn IndexTooLarge (info:FileInfo, value:Int) : PassException $ string-join $ [info ": Index with value " value " is too large."] defn IndexOnNonVector (info:FileInfo) : PassException $ string-join $ [info ": Index illegal on non-vector type."] defn IndexNotUInt (info:FileInfo) : PassException $ string-join $ [info ": Index is not of UIntType."] defn EnableNotUInt (info:FileInfo) : PassException $ string-join $ [info ": Enable is not of UIntType."] defn InvalidConnect (info:FileInfo) : PassException $ string-join $ [info ": Type mismatch."] defn PredNotUInt (info:FileInfo) : PassException $ string-join $ [info ": Predicate not a UIntType."] defn OpNotGround (info:FileInfo, op:Symbol) : PassException $ string-join $ [info ": Primop " op " cannot operate on non-ground types."] defn OpNotUInt (info:FileInfo, op:Symbol,e:Symbol) : PassException $ string-join $ [info ": Primop " op " requires argument " e " to be a UInt type."] defn OpNotAllUInt (info:FileInfo, op:Symbol) : PassException $ string-join $ [info ": Primop " op " requires all arguments to be UInt type."] defn OpNotAllSameType (info:FileInfo, op:Symbol) : PassException $ string-join $ [info ": Primop " op " requires all operands to have the same type."] defn NodeWithFlips (info:FileInfo) : PassException $ string-join $ [info ": Node cannot be a bundle type with flips."] ;---------------- Helper Functions -------------- defmethod equal? (t1:Type,t2:Type) -> True|False : match(t1,t2) : (t1:UIntType,t2:UIntType) : true (t1:SIntType,t2:SIntType) : true (t1:BundleType,t2:BundleType) : var same? = true for (f1 in fields(t1),f2 in fields(t2)) do : if flip(f1) != flip(f2) : same? = false if name(f1) != name(f2) : same? = false if type(f1) != type(f2) : same? = false same? (t1:VectorType,t2:VectorType) : if type(t1) == type(t2) and size(t1) == size(t2) : true else : false (t1,t2) : false defn u () -> UIntType : UIntType(UnknownWidth()) defn s () -> SIntType : SIntType(UnknownWidth()) defn check-types-primop (e:DoPrim, errors:Vector,info:FileInfo) -> False : defn all-same-type (ls:List) -> False : for x in ls do : if type(head(ls)) != type(x) : add(errors,OpNotAllSameType(info,to-symbol $ op(e))) defn all-ground (ls:List) -> False : for x in ls do : if not (type(x) typeof UIntType or type(x) typeof SIntType) : add(errors,OpNotGround(info,to-symbol $ op(e))) defn all-uint (ls:List) -> False : for x in ls do : if not (type(x) typeof UIntType) : add(errors,OpNotAllUInt(info,to-symbol $ op(e))) defn is-uint (x:Expression) -> False : if not (type(x) typeof UIntType) : add(errors,OpNotUInt(info,to-symbol $ op(e),to-symbol(x))) all-ground(args(e)) switch {op(e) == _} : ADD-OP : false SUB-OP : false MUL-OP : false DIV-OP : false MOD-OP : false QUO-OP : false REM-OP : false ADD-WRAP-OP : false SUB-WRAP-OP : false LESS-OP : false LESS-EQ-OP : false GREATER-OP : false GREATER-EQ-OP : false EQUAL-OP : all-same-type(args(e)) NEQUAL-OP : all-same-type(args(e)) MUX-OP : all-same-type(tail(args(e))) is-uint(head(args(e))) PAD-OP : false AS-UINT-OP : false AS-SINT-OP : false DYN-SHIFT-LEFT-OP : is-uint(args(e)[1]) DYN-SHIFT-RIGHT-OP : is-uint(args(e)[1]) SHIFT-LEFT-OP : false SHIFT-RIGHT-OP : false CONVERT-OP : false NEG-OP : false BIT-NOT-OP : all-uint(args(e)) BIT-AND-OP : all-uint(args(e)) BIT-OR-OP : all-uint(args(e)) BIT-XOR-OP : all-uint(args(e)) BIT-AND-REDUCE-OP : all-uint(args(e)) BIT-OR-REDUCE-OP : all-uint(args(e)) BIT-XOR-REDUCE-OP : all-uint(args(e)) CONCAT-OP : all-uint(args(e)) BIT-SELECT-OP : all-uint(args(e)) BITS-SELECT-OP : all-uint(args(e)) ;----------------- Check Types Pass --------------------- public defn check-types (c:Circuit) -> Circuit : val errors = Vector() defn check-types-e (info:FileInfo,e:Expression) -> Expression : match(map(check-types-e{info,_},e)) : (e:WRef) : e (e:WSubfield) : match(type(exp(e))) : (t:BundleType) : val ft = for p in fields(t) find : name(p) == name(e) if ft == false : add(errors,SubfieldNotInBundle(info,name(e))) (t) : add(errors,SubfieldOnNonBundle(info,name(e))) (e:WIndex) : match(type(exp(e))) : (t:VectorType) : if value(e) >= size(t) : add(errors,IndexTooLarge(info,value(e))) (t) : add(errors,IndexOnNonVector(info)) (e:DoPrim) : check-types-primop(e,errors,info) (e:ReadPort|WritePort) : if type(index(e)) != u() : add(errors,IndexNotUInt(info)) if type(enable(e)) != u() : add(errors,EnableNotUInt(info)) (e:Register) : if type(enable(e)) != u() : add(errors,EnableNotUInt(info)) (e:UIntValue|SIntValue) : false e defn check-types-s (s:Stmt) -> Stmt : map{check-types-s,_} $ { match(map(check-types-e{info(s),_},s)) : (s:Connect) : if type(loc(s)) != type(exp(s)) : add(errors,InvalidConnect(info(s))) (s:OnReset) : if type(loc(s)) != type(exp(s)) : add(errors,InvalidConnect(info(s))) (s:Conditionally) : if type(pred(s)) != u() : add(errors,PredNotUInt(info(s))) (s:DefNode) : if has-flip?(type(value(s))) : add(errors,NodeWithFlips(info(s))) (s) : false s }() for m in modules(c) do : match(m) : (m:ExModule) : false (m:InModule) : check-types-s(body(m)) throw(PassExceptions(errors)) when not empty?(errors) c ;================= GENDER CHECK ========================== ; o Nodes always male ; o Accessors only have one gender, unless rdwr ; o output/input only one gender ; o correctly check for the base bundle public defstruct CheckGenders <: Pass public defmethod pass (b:CheckGenders) -> (Circuit -> Circuit) : check-genders public defmethod name (b:CheckGenders) -> String : "Check Genders" public defmethod short-name (b:CheckGenders) -> String : "check-genders" ;----------------- Errors --------------------- defn WrongGender (info:FileInfo,expr:Symbol,wrong:Symbol,right:Symbol) : PassException $ string-join $ [info ": Expression " expr "has gender " wrong " but requires gender " right "."] defn UnknownGenders (info:FileInfo,name:Symbol) : PassException $ string-join $ [info ": Accessor " name " has an unknown gender."] ;---------------- Helper Functions -------------- defn dir-to-gender (d:Direction) -> Gender : switch {_ == d} : INPUT : MALE OUTPUT : FEMALE ;----------------- Check Genders Pass --------------------- public defn check-genders (c:Circuit) -> Circuit : val errors = Vector() defn check-gender (info:FileInfo,genders:HashTable,e:Expression,right:Gender) -> False : val gender = get-gender(e,genders) if gender != right and gender != BI-GENDER: add(errors,WrongGender(info,to-symbol(e),to-symbol(gender),to-symbol(right))) defn get-gender (e:Expression,genders:HashTable) -> Gender : match(e) : (e:WRef) : genders[name(e)] (e:WSubfield) : val f = {_ as Field} $ for f in fields(type(exp(e)) as BundleType) find : name(f) == name(e) get-gender(exp(e),genders) * flip(f) (e:WIndex) : get-gender(exp(e),genders) (e:DoPrim) : MALE (e:UIntValue) : MALE (e:SIntValue) : MALE (e:ReadPort) : MALE (e:WritePort) : FEMALE (e:Register) : MALE defn check-genders-e (info:FileInfo,e:Expression,genders:HashTable) -> False : do(check-genders-e{info,_,genders},e) match(e) : (e:WRef) : false (e:WSubfield) : false (e:WIndex) : false (e:DoPrim) : for e in args(e) do : check-gender(info,genders,e,MALE) (e:UIntValue) : false (e:SIntValue) : false (e:ReadPort) : do(check-gender{info,genders,_,MALE},e) (e:WritePort) : do(check-gender{info,genders,_,MALE},e) (e:Register) : do(check-gender{info,genders,_,MALE},e) defn check-genders-s (s:Stmt,genders:HashTable) -> False : do(check-genders-e{info(s),_:Expression,genders},s) match(s) : (s:DefWire) : genders[name(s)] = BI-GENDER (s:DefRegister) : genders[name(s)] = BI-GENDER (s:DefNode) : check-gender(info(s),genders,value(s),MALE) genders[name(s)] = MALE (s:DefMemory) : genders[name(s)] = BI-GENDER (s:DefInstance) : genders[name(s)] = MALE (s:WDefAccessor) : if gender(s) == UNKNOWN-GENDER : add(errors,UnknownGenders(info(s),name(s))) check-gender(info(s),genders,index(s),MALE) check-gender(info(s),genders,source(s),gender(s)) genders[name(s)] = gender(s) (s:Connect) : check-gender(info(s),genders,loc(s),FEMALE) check-gender(info(s),genders,exp(s),MALE) (s:BulkConnect) : check-gender(info(s),genders,loc(s),FEMALE) check-gender(info(s),genders,exp(s),MALE) (s:OnReset) : check-gender(info(s),genders,loc(s),FEMALE) check-gender(info(s),genders,exp(s),MALE) (s:Conditionally) : check-gender(info(s),genders,pred(s),MALE) (s:EmptyStmt) : false (s:Begin) : false for m in modules(c) do : val genders = HashTable(symbol-hash) for p in ports(m) do : genders[name(p)] = dir-to-gender(direction(p)) match(m) : (m:ExModule) : false (m:InModule) : check-genders-s(body(m),genders) throw(PassExceptions(errors)) when not empty?(errors) c