• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
          • Vl-loadstate
          • Parser
            • Parse-expressions
            • Parse-udps
              • Vl-idtokenlist->names
              • Vl-make-traditional-udp-head
              • Vl-udp-head-p
              • Vl-parse-traditional-udp-head
              • Vl-parse-1+-udp-input-declarations-separated-by-commas
              • Vl-parse-udp-output-declaration
              • Vl-parse-integrated-udp-head
              • Vl-parse-udp-declaration
              • Vl-udp-body-p
              • Vl-parse-udp-initial-statement
              • Vl-parse-combinational-entries-until-endtable
              • Vl-parse-udp-port-declaration
              • Vl-parse-udp-input-declaration
              • Vl-parse-sequential-entries-until-endtable
              • Vl-parse-level-symbol
              • Vl-parse-edge-symbol
              • Vl-parse-1+-udp-port-declarations
              • Vl-parse-0+-udp-port-declarations
              • Vl-skip-through-endprimitive
              • Vl-parse-udp-reg-declaration
              • Vl-parse-udp-init-val
              • Vl-parse-sequential-entry
              • Vl-parse-level-input-list
              • Vl-parse-edge-input-list
              • Vl-parse-udp-body
              • Vl-parse-seq-input-list
              • Vl-parse-edge-indicator
              • Vl-parse-combinational-entry
              • Vl-parse-combinational-body
              • Vl-port/vardecllist-p
              • Vl-parse-sequential-table
              • Vl-parse-output-symbol
              • Vl-parse-0+-level-symbols
              • Vl-parse-next-state
              • Vl-parse-current-state
              • Vl-make-udp-with-parse-error
              • Vl-make-udp-portdecls
              • Vl-port/vardecllist->vardecls
              • Vl-port/vardecllist->portdecls
              • Vl-port/vardecl
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
            • Parse-insts
            • Parse-datatype
            • Parse-functions
            • Parse-datatypes
            • Parse-strengths
            • Vl-parse-genvar-declaration
            • Vl-parse
            • Parse-ports
            • Seq
            • Parse-packages
          • Vl-load-merge-descriptions
          • Scope-of-defines
          • Vl-load-file
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-loadresult
          • Vl-read-file
          • Vl-find-basename/extension
          • Vl-find-file
          • Vl-read-files
          • Extended-characters
          • Vl-load
          • Vl-load-main
          • Vl-load-description
          • Vl-descriptions-left-to-load
          • Inject-warnings
          • Vl-load-descriptions
          • Vl-load-files
          • Vl-load-summary
          • Vl-collect-modules-from-descriptions
          • Vl-descriptionlist
        • Transforms
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Parser

Parse-udps

Functions for parsing User Defined Primitives (UDPs).

There are two different ways to write UDPs, basically you can have either an integrated port/portdecl list like:

primitive foo(output reg o, input a, input b);
  ...
endprimitive

Or you can have a more traditional separation between the ports and their declarations, e.g.,:

primitive foo(o, a, b);
  output o;
  reg o;
  input a;
  input b;
  ...
endprimitive

In either case, our parser will create a temporary vl-udp-head-p structure that records the output port declaration, the associated input port declarations (in the correct order), and an indication of whether the output port is a reg or not (i.e., whether or not this is a sequential UDP).

When parsing the body we can use the head information to know whether we should be parisng a sequential or combinational UDP and whether the initial statement is well-formed.

Subtopics

Vl-idtokenlist->names
(vl-idtokenlist->names x) maps vl-idtoken->name across a list.
Vl-make-traditional-udp-head
Cross-check ports against port declarations for traditional UDPs.
Vl-udp-head-p
Temporary structure for parsing UDPs.
Vl-parse-traditional-udp-head
Matches port stuff for UDPs with traditional, separated ports and port declarations lists.
Vl-parse-1+-udp-input-declarations-separated-by-commas
udp_input_declaration { ',' udp_input_declaration }
Vl-parse-udp-output-declaration
Matches udp_output_declaration.
Vl-parse-integrated-udp-head
Matches port stuff for UDPs with integrated port/port declaration lists.
Vl-parse-udp-declaration
Parse a udp_declaration.
Vl-udp-body-p
Temporary structure for parsing UDPs.
Vl-parse-udp-initial-statement
udp_initial_statement ::= 'initial' output_port_identifier '=' init_val ';'
Vl-parse-combinational-entries-until-endtable
Matches combinational_entry { combinational_entry }.
Vl-parse-udp-port-declaration
Matches udp_port_declaration.
Vl-parse-udp-input-declaration
udp_input_declaration ::= { attribute_instance } 'input' list_of_port_identifiers
Vl-parse-sequential-entries-until-endtable
Matches sequential_entry { sequential_entry }
Vl-parse-level-symbol
level_symbol ::= '0' | '1' | 'x' | 'X' | '?' | 'b' | 'B'
Vl-parse-edge-symbol
edge_symbol ::= 'r' | 'R' | 'f' | 'F' | 'p' | 'P' | 'n' | 'N' | '*'.
Vl-parse-1+-udp-port-declarations
Matches udp_port_declaration { udp_port_declaration }.
Vl-parse-0+-udp-port-declarations
Matches { udp_port_declaration }.
Vl-skip-through-endprimitive
Special error recovery for parse errors encountered during primitives.
Vl-parse-udp-reg-declaration
udp_reg_declaration ::= { attribute_instance } 'reg' variable_identifier
Vl-parse-udp-init-val
init_val ::= 1'b0 | 1'b1 | 1'bx | 1'bX | 1'B0 | 1'B1 | 1'Bx | 1'BX | 1 | 0
Vl-parse-sequential-entry
sequential_entry ::= seq_input_list ':' current_state ':' next_state ';'
Vl-parse-level-input-list
level_input_list ::= level_symbol { level_symbol }
Vl-parse-edge-input-list
edge_input_list ::= { level_symbol } edge_indicator { level_symbol }
Vl-parse-udp-body
udp_body ::= combinational_body | sequential_body
Vl-parse-seq-input-list
seq_input_list ::= level_input_list | edge_input_list
Vl-parse-edge-indicator
edge_indicator ::= '(' level_symbol level_symbol ' | edge_symbol')
Vl-parse-combinational-entry
combinational_entry ::= level_input_list ':' output_symbol ';'
Vl-parse-combinational-body
combinational_body ::= 'table' combinational_entry { combinational_entry } 'endtable'
Vl-port/vardecllist-p
(vl-port/vardecllist-p x) recognizes lists where every element satisfies vl-port/vardecl-p.
Vl-parse-sequential-table
Matches 'table' sequential_entry { sequential_entry } 'endtable'
Vl-parse-output-symbol
output_symbol ::= '0' | '1' | 'x' | 'X'
Vl-parse-0+-level-symbols
Matches { level_symbol }
Vl-parse-next-state
next_state ::= output_symbol | '-'
Vl-parse-current-state
current_state ::= level_symbol
Vl-make-udp-with-parse-error
Vl-make-udp-portdecls
Vl-port/vardecllist->vardecls
Vl-port/vardecllist->portdecls
Vl-port/vardecl