pss-langserver
Version:
A Language server for the Portable Stimulus Standard
245 lines (244 loc) • 16.1 kB
JavaScript
;
/*
* Copyright (C) 2025 Darshan(@thisisthedarshan)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.keywords = void 0;
exports.keywords = {
list: [
/* Core PSS Keywords (Section 4.4) */
"abstract", "action", "activity", "array", "as", "assert", "atomic", "bind", "bins", "bit", "body",
"bool", "break", "buffer", "chandle", "compile", "component", "concat", "const", "constraint",
"continue", "cover", "covergroup", "coverpoint", "cross", "declaration", "default", "disable",
"dist", "do", "dynamic", "else", "enum", "eventually", "exec", "export", "extend", "false", "file",
"float32", "float64", "forall", "foreach", "function", "has", "header", "if", "iff", "ignore_bins",
"illegal_bins", "import", "in", "init", "init_down", "init_up", "inout", "input", "instance", "int",
"join_branch", "join_first", "join_none", "join_select", "list", "lock", "map", "match", "monitor",
"null", "output", "override", "package", "parallel", "pool", "post_solve", "pre_body", "pre_solve",
"private", "protected", "public", "pure", "rand", "randomize", "ref", "repeat", "replicate",
"resource", "return", "run_end", "run_start", "schedule", "select", "sequence", "set", "share",
"solve", "state", "static", "stream", "string", "struct", "super", "symbol", "target", "this",
"true", "type", "typedef", "unique", "void", "while", "with", "yield",
"addr_handle_t", "packed", "solveonly", "targetonly",
/* Core Library Functions (Annex C) */
"format", "print", "message", "file_open", "file_close", "file_exists", "file_write", "file_read",
"file_write_lines", "file_read_lines", "error", "fatal", "urandom", "urandom_range", "log", "log10",
"exp", "sqrt", "pow", "round", "floor", "ceil", "sin", "cos", "tan", "asin", "acos", "atan", "atan2",
"hypot", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "float_mantissa", "float_exponent",
"float_sign", "to_float", "make_handle_from_claim", "make_handle_from_handle", "addr_value",
"addr_value_solve", "addr_value_abs", "get_tag", "read8", "read16", "read32", "read64", "write8",
"write16", "write32", "write64", "read_bytes", "write_bytes", "read_struct", "write_struct", "read",
"write", "read_val", "write_val", "write_masked", "write_val_masked", "write_field", "write_fields",
"get_offset_of_instance", "get_offset_of_instance_array", "get_offset_of_path", "set_handle",
/* Packages (Annex C) */
"std_pkg", "executor_pkg", "addr_reg_pkg"
],
descriptions: [
/* Core PSS Keywords */
"Marks an action or component as abstract, preventing direct instantiation (Section 10.2.3).",
"Defines an executable unit with inputs, outputs, and resource dependencies (Section 10).",
"Specifies a sequence of action traversals within an action (Section 12).",
"Declares a fixed-size collection of elements (Section 7.9.2).",
"Used in binding to alias flow or resource objects (Section 12.9).",
"Enforces a condition at compile-time or runtime, halting if false (Section B.17).",
"Ensures a block executes without interruption (Section 12.3.7).",
"Connects flow or resource objects to actions or pools (Section 12.9).",
"Defines coverage bins for data coverage analysis (Section 18.3.3).",
"Declares an unsigned integer type with specified bit-width (Section 7.2).",
"Specifies the implementation body of an exec block (Section 22.1).",
"Declares a boolean type with values true or false (Section 7.4).",
"Terminates the current loop iteration (Section B.16).",
"Declares a flow object for temporary data storage (Section 13.1).",
"Declares an opaque pointer type for foreign language interfacing (Section 7.7).",
"Defines conditional compilation directives (Section B.17).",
"Defines a structural entity containing actions and resources (Section 9).",
"Specifies sequential execution of scenarios (Section 19.3.3).",
"Declares a constant value immutable after initialization (Section 7.1).",
"Defines rules for randomization or scheduling (Section 16).",
"Skips the current loop iteration and proceeds to the next (Section B.16).",
"Declares a behavioral coverage specification (Section 19).",
"Groups coverage points for data coverage (Section 18.1).",
"Defines a specific data point to cover (Section 18.3).",
"Combines multiple coverage points for analysis (Section 18.4).",
"Declares variables or types (Section 7).",
"Sets a default value or behavior (Section 16.1.10).",
"Disables a constraint or coverage item (Section 16.1).",
"Specifies a weighted distribution for randomization (Section 16.1.11).",
"Executes an action traversal once (Section 10.2).",
"Indicates runtime-determined behavior (Section 7.10).",
"Specifies alternative execution path in conditional statements (Section 12.4.5).",
"Declares a set of named integer constants (Section 7.5).",
"Specifies a scenario to occur at some future point (Section 19.3.4).",
"Defines platform-specific code blocks (Section 22.1).",
"Makes a function or type available outside its scope (Section 22.4).",
"Adds functionality to an existing type (Section 20.2).",
"Literal value representing logical false (Section 7.4).",
"Specifies an external file for exec blocks (Section 22.1).",
"Declares a 32-bit floating-point type (Annex C.1).",
"Declares a 64-bit floating-point type (Annex C.1).",
"Iterates over all elements satisfying a condition (Section 16.1.8).",
"Iterates over a collection (Section 12.4.3).",
"Declares a reusable procedure (Section 22.2).",
"Checks for the existence of a symbol at compile-time (Section B.18).",
"Specifies meta-information for exec blocks (Section 22.1).",
"Defines a conditional execution block (Section 12.4.5).",
"Specifies a condition for coverage sampling (Section 18.4).",
"Excludes bins from coverage analysis (Section 18.3.5).",
"Marks bins as illegal for coverage (Section 18.3.6).",
"Includes external definitions or code (Section 21.1).",
"Tests membership in a range or collection (Section 8.5.9).",
"Defines initial state setup (Section 22.1).",
"Initializes components downward in the hierarchy (Section 22.1).",
"Initializes components upward in the hierarchy (Section 22.1).",
"Declares a bidirectional parameter (Section 22.2.2).",
"Declares an input parameter (Section 22.2.2).",
"Declares an instance of a component or type (Section 9.4).",
"Declares a signed integer type (Section 7.2).",
"Joins parallel branches with branch completion (Section 12.3).",
"Joins only the first completing branch (Section 12.3).",
"Disables joining of parallel branches (Section 12.3).",
"Selects the best matching branch for joining (Section 12.3).",
"Declares a dynamic ordered collection (Section 7.9.3).",
"Exclusively claims a resource (Section 14.2).",
"Declares a key-value pair collection (Section 7.9.4).",
"Selects based on pattern matching (Section 12.4.6).",
"Defines a behavioral coverage observer (Section 19).",
"Represents an absence of value (Section 7).",
"Declares an output parameter (Section 22.2.2).",
"Redefines an inherited member (Section 20.5).",
"Groups related definitions (Section 21.1).",
"Executes actions concurrently (Section 12.3.4).",
"Declares a shared resource collection (Section 15).",
"Executes after constraint solving (Section 22.1).",
"Executes before the main body (Section 22.1).",
"Executes before constraint solving (Section 22.1).",
"Restricts access to the declaring scope (Section 20.4).",
"Restricts access to the declaring scope and subclasses (Section 20.4).",
"Allows unrestricted access (Section 20.4).",
"Marks a component or function as side-effect-free (Section 9.6, 22.2.6).",
"Marks a field for randomization (Section 16.4.1).",
"Triggers randomization of rand fields (Section 16.4).",
"Declares a reference to an object (Section 7.10).",
"Repeats a block a specified number of times (Section 12.4.1).",
"Duplicates an action or resource (Section 12.5.1).",
"Declares a schedulable resource (Section 14).",
"Exits a function with a value (Section 22.2).",
"Executes at the end of a run (Section 22.1).",
"Executes at the start of a run (Section 22.1).",
"Defines execution order of actions (Section 12.3.5).",
"Chooses one of multiple scenarios (Section 12.4.4).",
"Defines a strict order of actions (Section 19.3).",
"Declares an unordered unique collection (Section 7.9.5).",
"Allows non-exclusive resource access (Section 14.2).",
"Marks a function for constraint solving (Section 22.3).",
"Declares a persistent condition (Section 13.3).",
"Declares a scope-shared member (Section 7.1).",
"Declares a data flow object (Section 13.2).",
"Declares a character sequence type (Section 7.6).",
"Declares a composite data type (Section 7.8).",
"References the parent type (Section 20.1).",
"Declares a named sub-activity (Section 12.7).",
"Marks a function for target platform execution (Section 22.3).",
"References the current object instance (Section 9.5).",
"Literal value representing logical true (Section 7.4).",
"Declares a type parameter (Section 11).",
"Defines a type alias (Section 7.11).",
"Enforces distinct values in a collection (Section 16.1.9).",
"Declares a function with no return value (Section 22.2).",
"Executes a block while a condition holds (Section 12.4.2).",
"Scopes a block with constraints or conditions (Section 12.9).",
"Yields control in cooperative multitasking (Section 22.7.14).",
"Type definition for an address handle (chandle), used in address-related operations (Annex C.3).",
"Declares a packed struct with specific endianness (Section 7.8).",
"Restricts a function to the solve platform only (implied in Section 22.3).",
"Restricts a function to the target platform only (implied in Section 22.3).",
/* Core Library Functions (Annex C) */
"Formats a string with arguments (solve platform only, Annex C.1).",
"Prints a formatted string (solve platform only, Annex C.1).",
"Outputs a message with verbosity level (target platform only, Annex C.1).",
"Opens a file with specified options (solve platform only, Annex C.1).",
"Closes a file handle (solve platform only, Annex C.1).",
"Checks if a file exists (solve platform only, Annex C.1).",
"Writes formatted data to a file (solve platform only, Annex C.1).",
"Reads data from a file up to a size (solve platform only, Annex C.1).",
"Writes a list of strings to a file (solve platform only, Annex C.1).",
"Reads a file into a list of strings (solve platform only, Annex C.1).",
"Reports an error with formatted arguments (Annex C.1).",
"Terminates with a fatal error and message (Annex C.1).",
"Generates a 32-bit random number (Annex C.1).",
"Generates a 32-bit random number in a range (Annex C.1).",
"Computes the natural logarithm (Annex C.1).",
"Computes the base-10 logarithm (Annex C.1).",
"Computes the exponential function (Annex C.1).",
"Computes the square root (Annex C.1).",
"Raises a number to a power (Annex C.1).",
"Rounds a floating-point number (Annex C.1).",
"Computes the floor of a number (Annex C.1).",
"Computes the ceiling of a number (Annex C.1).",
"Computes the sine function (Annex C.1).",
"Computes the cosine function (Annex C.1).",
"Computes the tangent function (Annex C.1).",
"Computes the arcsine function (Annex C.1).",
"Computes the arccosine function (Annex C.1).",
"Computes the arctangent function (Annex C.1).",
"Computes the arctangent of y/x (Annex C.1).",
"Computes the hypotenuse (Annex C.1).",
"Computes the hyperbolic sine (Annex C.1).",
"Computes the hyperbolic cosine (Annex C.1).",
"Computes the hyperbolic tangent (Annex C.1).",
"Computes the inverse hyperbolic sine (Annex C.1).",
"Computes the inverse hyperbolic cosine (Annex C.1).",
"Computes the inverse hyperbolic tangent (Annex C.1).",
"Extracts the mantissa from a float64 (Annex C.1).",
"Extracts the exponent from a float64 (Annex C.1).",
"Extracts the sign bit from a float64 (Annex C.1).",
"Constructs a float64 from components (Annex C.1).",
"Creates an address handle from a claim (Annex C.3).",
"Creates an address handle from another handle (Annex C.3).",
"Gets the address value of a handle (target, Annex C.3).",
"Solves the address value of a handle (solve, Annex C.3).",
"Gets the absolute address value (solve, Annex C.3).",
"Retrieves the tag of an address handle (Annex C.3).",
"Reads an 8-bit value from an address (target, Annex C.3).",
"Reads a 16-bit value from an address (target, Annex C.3).",
"Reads a 32-bit value from an address (target, Annex C.3).",
"Reads a 64-bit value from an address (target, Annex C.3).",
"Writes an 8-bit value to an address (target, Annex C.3).",
"Writes a 16-bit value to an address (target, Annex C.3).",
"Writes a 32-bit value to an address (target, Annex C.3).",
"Writes a 64-bit value to an address (target, Annex C.3).",
"Reads bytes into a list from an address (target, Annex C.3).",
"Writes bytes from a list to an address (target, Annex C.3).",
"Reads a packed struct from an address (target, Annex C.3).",
"Writes a packed struct to an address (target, Annex C.3).",
"Reads a register value (target, Annex C.3).",
"Writes a register value (target, Annex C.3).",
"Reads a bit vector from a register (target, Annex C.3).",
"Writes a bit vector to a register (target, Annex C.3).",
"Writes a masked value to a register (target, Annex C.3).",
"Writes a masked bit vector to a register (target, Annex C.3).",
"Writes a field in a register by name (target, Annex C.3).",
"Writes multiple fields in a register (target, Annex sapeva).",
"Gets the offset of an instance (Annex C.3).",
"Gets the offset of an array instance (Annex C.3).",
"Gets the offset along a path (Annex C.3).",
"Sets the address handle for a register group (Annex C.3).",
/* Packages */
"Standard package with utility types and functions (Annex C.1).",
"Package for scenario execution and resource management (Annex C.2).",
"Package for addressable resource modeling (Annex C.3)."
]
};