• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
        • Transforms
          • Unparameterization
          • Elaborate
            • Elabindex
              • Vl-elabindex-traverse
              • Vl-elabkey
              • Vl-elabscopes-update-subscope
              • Vl-elabscopes-do-instruction/update
              • Vl-elabtraversals-remove-common-prefix
              • Vl-elabscopes-pop/update-one
              • Vl-elabscopes
              • Vl-maybe-elabkey
              • Vl-elabscopes-traverse/update
              • Vl-elabscopes-pop/update
              • Vl-elabscope-update-package-subscope
              • Vl-elabinstruction
                • Vl-elabinstruction-fix
                • Vl-elabinstruction-case
                  • Vl-elabinstruction-equiv
                  • Vl-elabinstruction-p
                  • Vl-elabinstruction-push-named
                  • Vl-elabinstruction-push-anon
                  • Vl-elabinstruction-pop
                  • Vl-elabinstruction-kind
                  • Vl-elabinstruction-root
                • Vl-elabscope-update-subscope?
                • Vl-elabscope-update-subscope
                • Vl-elabscope-update-item-subscope
                • Vl-elabscope-update-index-subscope
                • Vl-elabscope-update-def-subscope
                • Vl-elabscope-update-class-subscope
                • Vl-elabscope-update-item-info
                • Vl-elabscope
                • Vl-elabscopes-do-instruction
                • Vl-elabpaths-append
                • Vl-elabscopes-traverse
                • Vl-elabscopes-push-named
                • Vl-elabscopes-item-info
                • Vl-elabscopes-push-scope
                • Vl-elabindex-update-item-info
                • Vl-elabscopes-subscope
                • Vl-elabscopes-push-anon
                • Vl-elabscopes-root/update
                • Vl-elabscopes-pop
                • Vl-elabindex-push
                • Vl-elabscope-package-subscope
                • Vl-elabscope-item-subscope
                • Vl-elabscope-class-subscope
                • Vl-elabindex-traverse-undo-entry
                • Vl-elabscope-subscope
                • Vl-elabscope-item-info
                • Vl-elabscope-def-subscope
                • Vl-scope->elabkey
                • Vl-elabscopes->elabtraversal
                • Vl-elabscopes-root
                • Vl-elabscopes-init-ss
                • Vl-elabscopes->top-scope
                • Vl-elabindex-update-undostack
                • Vl-elabindex-init
                • Vl-elabindex-sync-scopes
                • Vl-elabindex-update-scopes
                • Vl-elabindex-push-undo-entry
                • Vl-elabindex-update-ss
                • Vl-elabindex-undo
                • Vl-elabtraversal-stack
                • Vl-elabscopes-init
                • Vl-elabindex->undostack
                • Vl-elabindex->scopes
                • Vl-elabtraversal
                • Vl-elabindex->ss
              • Vl-override-parameter
              • Vl-genblob-elaborate
              • Vl-modelement-elaborate
              • Vl-design-elaborate-aux
              • Vl-package-elaborate-aux
              • Vl-taskdecl-elaborate
              • Vl-clkdecl-elaborate
              • Vl-defaultdisablelist-elaborate
              • Vl-modport-portlist-elaborate
              • Vl-modinst-elaborate-aux
              • Vl-maybe-parse-temps-elaborate
              • Vl-ansi-portdecllist-elaborate
              • Vl-ansi-portdecl-elaborate
              • Vl-parse-temps-elaborate
              • Vl-dpiimportlist-elaborate
              • Vl-clkassignlist-elaborate
              • Vl-cassertionlist-elaborate
              • Vl-assertionlist-elaborate
              • Vl-taskdecllist-elaborate
              • Vl-sequencelist-elaborate
              • Vl-propportlist-elaborate
              • Vl-propertylist-elaborate
              • Vl-plainarglist-elaborate
              • Vl-namedarglist-elaborate
              • Vl-maybe-clkskew-elaborate
              • Vl-gclkdecllist-elaborate
              • Vl-gateinstlist-elaborate
              • Vl-elabtasklist-elaborate
              • Vl-defaultdisable-elaborate
              • Vl-sequence-elaborate
              • Vl-property-elaborate
              • Vl-modportlist-elaborate
              • Vl-modport-port-elaborate
              • Vl-modinstlist-elaborate
              • Vl-letdecllist-elaborate
              • Vl-interfaceport-elaborate
              • Vl-initiallist-elaborate
              • Vl-gateinst-elaborate
              • Vl-fundecllist-elaborate
              • Vl-clkdecllist-elaborate
              • Vl-assignlist-elaborate
              • Vl-assign-elaborate-aux
              • Vl-arguments-elaborate
              • Vl-alwayslist-elaborate
              • Vl-regularport-elaborate
              • Vl-portlist-elaborate
              • Vl-finallist-elaborate
              • Vl-dpiimport-elaborate
              • Vl-clkassign-elaborate
              • Vl-bindlist-elaborate
              • Vl-aliaslist-elaborate
              • Vl-warn-about-negative-indices
              • Vl-udplist-elaborate
              • Vl-propport-elaborate
              • Vl-modinst-elaborate
              • Vl-udp-elaborate
              • Vl-port-elaborate
              • Vl-plainarg-elaborate
              • Vl-namedarg-elaborate
              • Vl-modport-elaborate
              • Vl-gclkdecl-elaborate
              • Vl-elabtask-elaborate
              • Vl-clkskew-elaborate
              • Vl-assign-elaborate
              • Vl-always-elaborate-aux
              • Vl-always-elaborate
              • Vl-alias-elaborate
              • Vl-initial-elaborate
              • Vl-bind-elaborate
              • Vl-final-elaborate
              • Vl-fundecl-paramdecls-for-const-args
              • Vl-fundecl-body-with-const-args
              • Vl-exprlist-args-to-4vec-consts
              • Sv::svex-constval
            • Addnames
            • Annotate
            • Clean-warnings
            • Eliminitial
            • Custom-transform-hooks
            • Problem-modules
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-elabinstruction

    Vl-elabinstruction-case

    Case macro for the different kinds of vl-elabinstruction structures.

    This is an fty sum-type case macro, typically introduced by defflexsum or deftagsum. It allows you to safely check the type of a vl-elabinstruction structure, or to split into cases based on its type.

    Short Form

    In its short form, vl-elabinstruction-case allows you to safely check the type of a vl-elabinstruction structure. For example:

    (vl-elabinstruction-case x :pop)

    is essentially just a safer alternative to writing:

    (equal (vl-elabinstruction-kind x) :pop)

    Why is using vl-elabinstruction-case safer? When we directly inspect the kind with equal, there is no static checking being done to ensure that, e.g., :pop is a valid kind of vl-elabinstruction structure. That means there is nothing to save you if, later, you change the kind keyword for this type from :pop to something else. It also means you get no help if you just make a typo when writing the :pop symbol. Over the course of developing VL, we found that such issues were very frequent sources of errors!

    Long Form

    In its longer form, vl-elabinstruction-case allows you to split into cases based on the kind of structure you are looking at. A typical example would be:

    (vl-elabinstruction-case x
      :pop ...
      :root ...
      :push-named ...
      :push-anon ...)

    It is also possible to consolidate ``uninteresting'' cases using :otherwise.

    For convenience, the case macro automatically binds the fields of x for you, as appropriate for each case. That is, in the :pop case, you can use defprod-style foo.bar style accessors for x without having to explicitly add a pop b* binder.