Verilog Parser
verilog_ast.h File Reference

Contains Declarations of datastructures and functions which represent and operate on the Verilog Abstract Syntax Tree (AST) More...

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "verilog_ast_common.h"

Go to the source code of this file.

Data Structures

struct  ast_assignment
 Top level descriptor for an assignment. More...
 
struct  ast_block_item_declaration
 Describes the declaration of a block item. More...
 
struct  ast_block_reg_declaration
 Describes the declaration of a set of registers within a block. More...
 
struct  ast_case_item
 Describes a single exeuctable item in a case statement. More...
 
struct  ast_case_statement
 Describes the top level of a case statement in terms of its items. More...
 
struct  ast_cmos_switch_instance
 A single CMOS switch (transistor) instance. More...
 
struct  ast_concatenation
 Fully describes a concatenation in terms of type and data. More...
 
struct  ast_conditional_statement
 Describes a single if-then-do statement. More...
 
struct  ast_config_declaration
 Describes a single config declaration in it's entirety. More...
 
struct  ast_config_rule_statement
 Fully describes a config rule statemnet. See Annex 1.2. More...
 
struct  ast_continuous_assignment
 Describes a set of assignments with the same drive strength and delay. More...
 
struct  ast_delay2
 Describes a 2 point delay distribution. More...
 
struct  ast_delay3
 Describes a 3 point delay distribution. More...
 
struct  ast_delay_ctrl
 Describes a single delay control statement. More...
 
struct  ast_delay_value
 Describes the type and value of a delay specifier. More...
 
struct  ast_disable_statement
 Contains the identifier from a disable statement. More...
 
struct  ast_edge_sensitive_full_path_declaration
 Describes a parallel edge sensitive path declaration. More...
 
struct  ast_edge_sensitive_parallel_path_declaration
 Describes a single edge sensitive path declaration. More...
 
struct  ast_enable_gate_instance
 A single enable gate. More...
 
struct  ast_enable_gate_instances
 A collection of enable gates with the same type and delay properties. More...
 
struct  ast_event_control
 Describes the type of event triggers. More...
 
struct  ast_event_expression
 Describes a single event expression. More...
 
struct  ast_expression
 Storage type for an entire expression / subexpression tree. More...
 
struct  ast_function_call
 describes a single call to a function, constant function, or system fucntion. More...
 
struct  ast_function_declaration
 Fully describes the declaration of a verilog function. More...
 
struct  ast_function_item_declaration
 Describes a function item declaration, which is either a block item or port declaration. More...
 
struct  ast_gate_instantiation
 Fully describes the instantiation of one or more gate level primitives. More...
 
struct  ast_generate_block
 Simple wrapper and placeholder for generate associated meta-data. More...
 
struct  ast_hybrid_assignment
 caters for procedural_continuous_assignments in Annex A.6.2 of spec. More...
 
struct  ast_identifier
 Structure containing all information on an identifier. More...
 
struct  ast_if_else
 Describes a complete set of if-elseif-else statements. More...
 
struct  ast_library_declaration
 Describes a library declaration of file and include paths. More...
 
struct  ast_library_descriptions
 Super structure for different library construct types. More...
 
struct  ast_loop_statement
 Fully describes a single loop statement. More...
 
struct  ast_lvalue
 Stores and describes an expression l value. More...
 
union  ast_lvalue_data
 Storage for the data describing an assignment L Value. More...
 
struct  ast_metadata
 Stores "meta" information and other tagging stuff about nodes. More...
 
struct  ast_module_declaration
 Fully describes a single module declaration in terms of parameters ports and internal constructs. More...
 
struct  ast_module_instance
 A single instance of a defined module. More...
 
struct  ast_module_instantiation
 Describes the instantiation of one or more modules of the same type with the same parameters. More...
 
struct  ast_module_item
 Describes a single module item, its type and data structure. More...
 
struct  ast_mos_switch_instance
 A single MOS switch (transistor) instance. More...
 
struct  ast_n_input_gate_instance
 An N-input gate instance. e.g. 3-to-1 NAND. More...
 
struct  ast_n_input_gate_instances
 A collection of n-input gates with the same type and delay properties. More...
 
struct  ast_n_output_gate_instance
 Describes a single gate with one input and several outputs. More...
 
struct  ast_n_output_gate_instances
 
struct  ast_net_declaration
 Describes a single net declaration. More...
 
struct  ast_node_attributes
 Node data describing an attribute. More...
 
struct  ast_node
 Node type that forms the tree. More...
 
struct  ast_number
 Stores the base, value and width (in bits) of a number. More...
 
struct  ast_parameter_declarations
 Stores the type and characteristics of one or more parameter declarations. More...
 
struct  ast_pass_enable_switch
 A single pass enable switch with pass and enable terminals. More...
 
struct  ast_pass_enable_switches
 Describes a collection of pass enable switches withe the same type and delay characteristics. More...
 
struct  ast_pass_switch_instance
 A single pass transistor instance. More...
 
struct  ast_path_declaration
 Struct which holds the type and data of a path declaration. More...
 
struct  ast_port_connection
 Decribes a single port connection in a module instance. More...
 
struct  ast_port_declaration
 Fully describes a single port declaration. More...
 
struct  ast_primary
 Stores the type and value of an AST primary expression. More...
 
union  ast_primary_value
 The expression primary can produce several different sub-expressions: More...
 
struct  ast_primitive_pull_strength
 Describes the pull strength and direction of a primitive. More...
 
struct  ast_procedural_assignment
 Describes a procedural assignment, can be blocking or nonblocking. More...
 
struct  ast_pull_gate_instance
 Describes a single pull gate instance. More...
 
struct  ast_pull_strength
 Fully describes the pull's of a net going up and down. More...
 
struct  ast_pulse_control_specparam
 Describes the pulse characteristics in signal transmission? More...
 
struct  ast_range_or_type
 Holds either a range or a type data item. More...
 
struct  ast_range
 Describes a range or dimension. More...
 
struct  ast_reg_declaration
 Describes a single reg declaration. More...
 
struct  ast_simple_full_path_declaration
 Describes the declaration of a path. More...
 
struct  ast_simple_parallel_path_declaration
 Describes the declaration of a path. More...
 
struct  ast_single_assignment
 encodes a single assignment. More...
 
struct  ast_source_item
 Contains a source item and it's type. More...
 
struct  ast_statement_block
 Fully describes a single block of statements. More...
 
struct  ast_statement
 Describes a single statement, and can contain sequential statement blocks. More...
 
struct  ast_switch_gate
 Describes a single gate type along with it's delay properties. More...
 
struct  ast_switches
 A collection of CMOS, MOS or PASS switches of the same type. More...
 
struct  ast_task_declaration
 Creates and returns a new task declaration statement. More...
 
struct  ast_task_enable_statement
 Fully describes a task enable statement. More...
 
struct  ast_task_port
 
struct  ast_timing_control_statement
 Describes a single procedural timing control statement. More...
 
struct  ast_type_declaration
 Fully describes the declaration of elements one might find inside a module. More...
 
struct  ast_udp_body
 Describes a single UDP body sequentially or combinatorially. More...
 
struct  ast_udp_combinatorial_entry
 Describes a single combinatorial entry in the UDP ast tree. More...
 
struct  ast_udp_declaration
 Describes the declaration of a user defined primitive (UDP) More...
 
struct  ast_udp_initial_statement
 Describes the initial statement of a sequential udp body. More...
 
struct  ast_udp_instance
 Describes a single instance of a UDP. More...
 
struct  ast_udp_instantiation
 Describes an a list of instances of a particular kind of UDP. More...
 
struct  ast_udp_port
 Describes a single port for a user defined primitive. More...
 
struct  ast_udp_sequential_entry
 describes a sequential entry in a udp body. More...
 
struct  ast_var_declaration
 Describes a simple set of declarations of a particular type. More...
 
struct  ast_wait_statement
 Describes a single wait statement. More...
 
struct  verilog_source_tree
 Top level container for parsed source code. More...
 

Typedefs

typedef struct ast_delay_value_t ast_delay_value
 
typedef struct ast_pull_strength_t ast_drive_strength
 
typedef char * ast_file
 Refers to a source code file name.
 
typedef int ast_line
 Refers to a source code file line number.
 
typedef void * ast_macro_use
 
typedef void * ast_minmax_exp
 
typedef char * ast_string
 
typedef void * ast_tf_input_declaration
 

Enumerations

enum  ast_assignment_type { ASSIGNMENT_CONTINUOUS, ASSIGNMENT_BLOCKING, ASSIGNMENT_NONBLOCKING, ASSIGNMENT_HYBRID }
 Describes the type (and implicitly, the location) of an assignment. More...
 
enum  ast_block_item_declaration_type { BLOCK_ITEM_REG, BLOCK_ITEM_PARAM, BLOCK_ITEM_TYPE }
 Describes what sort of block item is being declared. More...
 
enum  ast_block_type {
  BLOCK_SEQUENTIAL, BLOCK_SEQUENTIAL_INITIAL, BLOCK_SEQUENTIAL_ALWAYS, BLOCK_FUNCTION_SEQUENTIAL,
  BLOCK_PARALLEL
}
 Describes the type of a block of statements.
 
enum  ast_boolean { AST_TRUE =1, AST_FALSE =0 }
 Stores the values of booleans.
 
enum  ast_case_statement_type { CASE, CASEX, CASEZ }
 Records the three different types of case statement Verilog has.
 
enum  ast_charge_strength { CHARGE_SMALL, CHARGE_MEDIUM, CHARGE_LARGE, CHARGE_DEFAULT }
 Describes (coloquially?!) the charge strength on a driver. More...
 
enum  ast_concatenation_type {
  CONCATENATION_EXPRESSION, CONCATENATION_CONSTANT_EXPRESSION, CONCATENATION_NET, CONCATENATION_VARIABLE,
  CONCATENATION_MODULE_PATH
}
 Describes the type of concatenation being dealt with. More...
 
enum  ast_declaration_type {
  DECLARE_EVENT, DECLARE_GENVAR, DECLARE_INTEGER, DECLARE_TIME,
  DECLARE_REALTIME, DECLARE_REAL, DECLARE_NET, DECLARE_REG,
  DECLARE_UNKNOWN
}
 Describes the datatype of the construct being declared. More...
 
enum  ast_delay_ctrl_type { DELAY_CTRL_VALUE, DELAY_CTRL_MINTYPMAX }
 Denotes whether a delay control expression is a single value or a range.
 
enum  ast_delay_value_type { DELAY_VAL_PARAMETER, DELAY_VAL_SPECPARAM, DELAY_VAL_NUMBER, DELAY_VAL_MINTYPMAX }
 Describes the union member of an ast_delay_value structure to be accessed.
 
enum  ast_edge { EDGE_POS, EDGE_NEG, EDGE_NONE, EDGE_ANY }
 Describes a rising or falling edge, or where none is specified. More...
 
enum  ast_enable_gatetype { EN_BUFIF0, EN_BUFIF1, EN_NOTIF0, EN_NOTIF1 }
 Describes a variety of enable gate type.
 
enum  ast_event_control_type { EVENT_CTRL_NONE, EVENT_CTRL_ANY, EVENT_CTRL_TRIGGERS }
 Whether an event control struct contains a list of triggers, no triggers.
 
enum  ast_event_expression_type { EVENT_EXPRESSION, EVENT_POSEDGE, EVENT_NEGEDGE, EVENT_SEQUENCE }
 
enum  ast_expression_type {
  PRIMARY_EXPRESSION, UNARY_EXPRESSION, BINARY_EXPRESSION, RANGE_EXPRESSION_UP_DOWN,
  RANGE_EXPRESSION_INDEX, MINTYPMAX_EXPRESSION, CONDITIONAL_EXPRESSION, MODULE_PATH_PRIMARY_EXPRESSION,
  MODULE_PATH_BINARY_EXPRESSION, MODULE_PATH_UNARY_EXPRESSION, MODULE_PATH_CONDITIONAL_EXPRESSION, MODULE_PATH_MINTYPMAX_EXPRESSION,
  STRING_EXPRESSION
}
 Describes the kind of expression a node contains. More...
 
enum  ast_gate_type {
  GATE_CMOS, GATE_MOS, GATE_PASS, GATE_ENABLE,
  GATE_N_OUT, GATE_N_IN, GATE_PASS_EN, GATE_PULL_UP,
  GATE_PULL_DOWN
}
 Describes a kind of gate primitive. More...
 
enum  ast_gatetype_n_input {
  N_IN_AND, N_IN_NAND, N_IN_NOR, N_IN_OR,
  N_IN_XOR, N_IN_XNOR
}
 Describes the logical function performed by a builtin n-input gate.
 
enum  ast_hybrid_assignment_type {
  HYBRID_ASSIGNMENT_ASSIGN, HYBRID_ASSIGNMENT_DEASSIGN, HYBRID_ASSIGNMENT_FORCE_NET, HYBRID_ASSIGNMENT_FORCE_VAR,
  HYBRID_ASSIGNMENT_RELEASE_VAR, HYBRID_ASSIGNMENT_RELEASE_NET
}
 Describes the different types of procedural continuous assignments.
 
enum  ast_id_range_or_index { ID_HAS_RANGE, ID_HAS_RANGES, ID_HAS_INDEX, ID_HAS_NONE }
 Used to tell if an identifier has a bit vector or index attatched to it. More...
 
enum  ast_identifier_type {
  ID_ARRAYED, ID_BLOCK, ID_CELL, ID_CONFIG,
  ID_ESCAPED_ARRAYED, ID_ESCAPED_HIERARCHICAL_BRANCH, ID_ESCAPED_HIERARCHICAL, ID_ESCAPED_HIERARCHICALS,
  ID_ESCAPED, ID_EVENT, ID_EVENT_TRIGGER, ID_FUNCTION,
  ID_GATE_INSTANCE, ID_GENERATE_BLOCK, ID_GENVAR, ID_HIERARCHICAL_BLOCK,
  ID_HIERARCHICAL_EVENT, ID_HIERARCHICAL_FUNCTION, ID_HIERARCHICAL, ID_HIERARCHICAL_NET,
  ID_HIERARCHICAL_TASK, ID_HIERARCHICAL_VARIABLE, ID_CSV, ID_INOUT_PORT,
  ID_INPUT, ID_INPUT_PORT, ID_INSTANCE, ID_LIBRARY,
  ID_MODULE, ID_MODULE_INSTANCE, ID_NAME_OF_GATE_INSTANCE, ID_NAME_OF_INSTANCE,
  ID_NET, ID_OUTPUT, ID_OUTPUT_PORT, ID_PARAMETER,
  ID_PORT, ID_REAL, ID_SIMPLE_ARRAYED, ID_SIMPLE_HIERARCHICAL_BRANCH,
  ID_SIMPLE_HIERARCHICAL, ID_SIMPLE, ID_SPECPARAM, ID_SYSTEM_FUNCTION,
  ID_SYSTEM_TASK, ID_TASK, ID_TOPMODULE, ID_UNKNOWN,
  ID_UNEXPANDED_MACRO, ID_UDP, ID_UDP_INSTANCE, ID_VARIABLE
}
 Describes the type of contruct that the identifier corresponds to. More...
 
enum  ast_level_symbol {
  LEVEL_0, LEVEL_1, LEVEL_B, LEVEL_X,
  LEVEL_Q
}
 Describes a single logic level symbol. More...
 
enum  ast_library_item_type { LIB_LIBRARY, LIB_INCLUDE, LIB_CONFIG }
 Describes a library item.
 
enum  ast_loop_type {
  LOOP_FOREVER, LOOP_REPEAT, LOOP_WHILE, LOOP_FOR,
  LOOP_GENERATE
}
 Describes the different syntactic methods of looping.
 
enum  ast_lvalue_type {
  SPECPARAM_ID, PARAM_ID, NET_IDENTIFIER, VAR_IDENTIFIER,
  GENVAR_IDENTIFIER, NET_CONCATENATION, VAR_CONCATENATION
}
 Identifies the kind of LValue the ast_lvalue structure holds. More...
 
enum  ast_module_item_type {
  MOD_ITEM_PORT_DECLARATION, MOD_ITEM_GENERATED_INSTANTIATION, MOD_ITEM_PARAMETER_DECLARATION, MOD_ITEM_SPECIFY_BLOCK,
  MOD_ITEM_SPECPARAM_DECLARATION, MOD_ITEM_PARAMETER_OVERRIDE, MOD_ITEM_CONTINOUS_ASSIGNMENT, MOD_ITEM_GATE_INSTANTIATION,
  MOD_ITEM_UDP_INSTANTIATION, MOD_ITEM_MODULE_INSTANTIATION, MOD_ITEM_INITIAL_CONSTRUCT, MOD_ITEM_ALWAYS_CONSTRUCT,
  MOD_ITEM_NET_DECLARATION, MOD_ITEM_REG_DECLARATION, MOD_ITEM_INTEGER_DECLARATION, MOD_ITEM_REAL_DECLARATION,
  MOD_ITEM_TIME_DECLARATION, MOD_ITEM_REALTIME_DECLARATION, MOD_ITEM_EVENT_DECLARATION, MOD_ITEM_GENVAR_DECLARATION,
  MOD_ITEM_TASK_DECLARATION, MOD_ITEM_FUNCTION_DECLARATION
}
 Describes the type of data structure representing a module item. More...
 
enum  ast_n_output_gatetype { N_OUT_BUF, N_OUT_NOT }
 Describes the type of an n_output gate.
 
enum  ast_net_type {
  NET_TYPE_SUPPLY0, NET_TYPE_SUPPLY1, NET_TYPE_TRI, NET_TYPE_TRIAND,
  NET_TYPE_TRIOR, NET_TYPE_TRIREG, NET_TYPE_WIRE, NET_TYPE_WAND,
  NET_TYPE_WOR, NET_TYPE_NONE
}
 Describes the type of a net in Verilog. More...
 
enum  ast_node_type {
  ATTRIBUTE_LIST, EXPRESSION, IDENTIFIER, MODULE,
  NONE
}
 Enum type describing the data value that an AST node holds. More...
 
enum  ast_number_base { BASE_BINARY, BASE_OCTAL, BASE_DECIMAL, BASE_HEX }
 Base value of a number representation.
 
enum  ast_number_representation { REP_BITS, REP_INTEGER, REP_FLOAT }
 How is the number represented? More...
 
enum  ast_operator {
  OPERATOR_STAR, OPERATOR_PLUS, OPERATOR_MINUS, OPERATOR_ASL,
  OPERATOR_ASR, OPERATOR_LSL, OPERATOR_LSR, OPERATOR_DIV,
  OPERATOR_POW, OPERATOR_MOD, OPERATOR_GTE, OPERATOR_LTE,
  OPERATOR_GT, OPERATOR_LT, OPERATOR_L_NEG, OPERATOR_L_AND,
  OPERATOR_L_OR, OPERATOR_C_EQ, OPERATOR_L_EQ, OPERATOR_C_NEQ,
  OPERATOR_L_NEQ, OPERATOR_B_NEG, OPERATOR_B_AND, OPERATOR_B_OR,
  OPERATOR_B_XOR, OPERATOR_B_EQU, OPERATOR_B_NAND, OPERATOR_B_NOR,
  OPERATOR_TERNARY, OPERATOR_NONE = 0
}
 Stores different Operators. More...
 
enum  ast_parameter_type {
  PARAM_INTEGER, PARAM_REAL, PARAM_REALTIME, PARAM_TIME,
  PARAM_GENERIC, PARAM_SPECPARAM
}
 Data value types that a module parameter can take on. More...
 
enum  ast_pass_enable_switchtype { PASS_EN_TRANIF0, PASS_EN_TRANIF1, PASS_EN_RTRANIF0, PASS_EN_RTRANIF1 }
 Describes a particular type of pass enable switch.
 
enum  ast_path_declaration_type {
  SIMPLE_PARALLEL_PATH, SIMPLE_FULL_PATH, EDGE_SENSITIVE_PARALLEL_PATH, EDGE_SENSITIVE_FULL_PATH,
  STATE_DEPENDENT_PARALLEL_PATH, STATE_DEPENDENT_FULL_PATH, STATE_DEPENDENT_EDGE_PARALLEL_PATH, STATE_DEPENDENT_EDGE_FULL_PATH
}
 Describes the type of path being declared.
 
enum  ast_port_direction { PORT_INPUT, PORT_OUTPUT, PORT_INOUT, PORT_NONE }
 Describes the direction of a port. More...
 
enum  ast_primary_type { CONSTANT_PRIMARY, PRIMARY, MODULE_PATH_PRIMARY }
 Describes the kind of expression primary being represented, and hence the sort of expression we are dealing with.
 
enum  ast_primary_value_type {
  PRIMARY_NUMBER, PRIMARY_IDENTIFIER, PRIMARY_CONCATENATION, PRIMARY_FUNCTION_CALL,
  PRIMARY_MINMAX_EXP, PRIMARY_MACRO_USAGE
}
 The kind of production the expression primary holds.
 
enum  ast_primitive_strength {
  STRENGTH_HIGHZ0, STRENGTH_HIGHZ1, STRENGTH_SUPPLY0, STRENGTH_STRONG0,
  STRENGTH_PULL0, STRENGTH_WEAK0, STRENGTH_SUPPLY1, STRENGTH_STRONG1,
  STRENGTH_PULL1, STRENGTH_WEAK1, STRENGTH_NONE
}
 Describes the drive strength of a single primitive.
 
enum  ast_pull_direction { PULL_UP, PULL_DOWN, PULL_NONE }
 Describes pull direction.
 
enum  ast_source_item_type { SOURCE_MODULE = 0, SOURCE_UDP = 1 }
 Describes the type of a item in the list of source entries. More...
 
enum  ast_statement_type {
  STM_GENERATE =0, STM_ASSIGNMENT =1, STM_CASE =2, STM_CONDITIONAL =3,
  STM_DISABLE =4, STM_EVENT_TRIGGER =5, STM_LOOP =6, STM_BLOCK =7,
  STM_BLOCK_ALWAYS =8, STM_BLOCK_INITIAL =9, STM_TIMING_CONTROL =10, STM_FUNCTION_CALL =11,
  STM_TASK_ENABLE =12, STM_WAIT =13, STM_MODULE_ITEM =14
}
 Describes the kind of statement in a statement struct. More...
 
enum  ast_switchtype {
  SWITCH_CMOS, SWITCH_RCMOS, SWITCH_NMOS, SWITCH_PMOS,
  SWITCH_RNMOS, SWITCH_RPMOS, SWITCH_TRAN, SWITCH_RTRAN
}
 describes the type of a single MOS switch.
 
enum  ast_task_port_type {
  PORT_TYPE_TIME, PORT_TYPE_REAL, PORT_TYPE_REALTIME, PORT_TYPE_INTEGER,
  PORT_TYPE_NONE
}
 Return value type for a task. More...
 
enum  ast_timing_control_statement_type { TIMING_CTRL_DELAY_CONTROL, TIMING_CTRL_EVENT_CONTROL, TIMING_CTRL_EVENT_CONTROL_REPEAT }
 What sort of procedural timing control statement is this?
 
enum  ast_udp_body_type { UDP_BODY_SEQUENTIAL, UDP_BODY_COMBINATORIAL }
 Is the body of the UDP specified combinatorially or sequentially.
 
enum  ast_udp_init_val { UDP_INIT_1, UDP_INIT_0, UDP_INIT_X }
 Describes the initial value of a UDP output.
 
enum  ast_udp_next_state {
  UDP_NEXT_STATE_X, UDP_NEXT_STATE_0, UDP_NEXT_STATE_1, UDP_NEXT_STATE_DC,
  UDP_NEXT_STATE_QM
}
 Describes the possible output values for a UDP element. More...
 
enum  ast_udp_seqential_entry_prefix { PREFIX_EDGES, PREFIX_LEVELS }
 Whether a sequential body entry starts with level or edge symbols.
 

Functions

void ast_append_attribute (ast_node_attributes *parent, ast_node_attributes *toadd)
 Creates and returns a new attribute node with the specified value and name. More...
 
ast_identifier ast_append_identifier (ast_identifier parent, ast_identifier child)
 Used to construct linked lists of hierarchical identifiers. More...
 
char * ast_expression_tostring (ast_expression *exp)
 A utility function for converting an ast expression tree back into a string representation. More...
 
void ast_extend_concatenation (ast_concatenation *element, ast_expression *repeat, void *data)
 Adds a new data element on to the front of a concatenation. More...
 
void ast_extend_if_else (ast_if_else *conditional_statements, ast_list *new_statement)
 Adds an additional conditional (ha..) to an existing if-else statement. More...
 
ast_statement_blockast_extract_statement_block (ast_statement_type type, ast_statement *body)
 Takes a body statement (type = STM_BLK) and splits it into it's event trigger and statements.
 
int ast_identifier_cmp (ast_identifier a, ast_identifier b)
 Acts like strcmp but works on ast identifiers.
 
void ast_identifier_set_index (ast_identifier id, ast_expression *index)
 Used to set the index field of an identifier. More...
 
void ast_identifier_set_range (ast_identifier id, ast_range *range)
 Used to set the range field of an identifier. More...
 
char * ast_identifier_tostring (ast_identifier id)
 Simply returns the fully qualified representation of an identifier as a string. More...
 
ast_node_attributes * ast_new_attributes (ast_identifier name, ast_expression *value)
 Creates and returns as a pointer a new attribute descriptor. More...
 
ast_expression * ast_new_binary_expression (ast_expression *left, ast_expression *right, ast_operator operation, ast_node_attributes *attr, ast_boolean constant)
 Creates a new binary infix expression with the supplied operands. More...
 
ast_block_item_declaration * ast_new_block_item_declaration (ast_block_item_declaration_type type, ast_node_attributes *attributes)
 Creates and returns a new block item declaration of the specified type. More...
 
ast_block_reg_declarationast_new_block_reg_declaration (ast_boolean is_signed, ast_range *range, ast_list *identifiers)
 Creates and returns a new block register declaration descriptor. More...
 
ast_assignment * ast_new_blocking_assignment (ast_lvalue *lval, ast_expression *expression, ast_timing_control_statement *delay_or_event)
 Creates and returns a new blocking procedural assignment object. More...
 
ast_case_itemast_new_case_item (ast_list *conditions, ast_statement *body)
 Create and return a new item in a cast statement. More...
 
ast_case_statementast_new_case_statement (ast_expression *expression, ast_list *cases, ast_case_statement_type type)
 Creates and returns a new case statement. More...
 
ast_cmos_switch_instanceast_new_cmos_switch_instance (ast_identifier name, ast_lvalue *output_terminal, ast_expression *ncontrol_terminal, ast_expression *pcontrol_terminal, ast_expression *input_terminal)
 A single CMOS switch (transistor) instance.
 
ast_concatenation * ast_new_concatenation (ast_concatenation_type type, ast_expression *repeat, void *first_value)
 Creates a new AST concatenation element with the supplied type and initial starting value. More...
 
ast_expression * ast_new_conditional_expression (ast_expression *condition, ast_expression *if_true, ast_expression *if_false, ast_node_attributes *attr)
 Creates a new conditional expression node. More...
 
ast_conditional_statementast_new_conditional_statement (ast_statement *statement, ast_expression *condition)
 Creates and returns a new conditional statement. More...
 
ast_config_declarationast_new_config_declaration (ast_identifier identifier, ast_identifier design_statement, ast_list *rule_statements)
 Creates and returns a new config declaration node.
 
ast_config_rule_statementast_new_config_rule_statement (ast_boolean is_default, ast_identifier clause_1, ast_identifier clause_2)
 Creates and returns a new configuration rule statment node. More...
 
ast_primaryast_new_constant_primary (ast_primary_value_type type)
 Creates a new ast primary which is part of a constant expression tree with the supplied type and value. More...
 
ast_assignment * ast_new_continuous_assignment (ast_list *assignments, ast_drive_strength *strength, ast_delay3 *delay)
 Creates and returns a new continuous assignment object. More...
 
ast_delay2 * ast_new_delay2 (ast_delay_value *min, ast_delay_value *max)
 Create a new delay2 instance.
 
ast_delay3 * ast_new_delay3 (ast_delay_value *min, ast_delay_value *avg, ast_delay_value *max)
 Create a new delay3 instance.
 
ast_delay_ctrlast_new_delay_ctrl_mintypmax (ast_expression *mintypmax)
 creates and returns a new delay control statement.
 
ast_delay_ctrlast_new_delay_ctrl_value (ast_delay_value *value)
 creates and returns a new delay control statement.
 
ast_delay_valueast_new_delay_value (ast_delay_value_type type, void *data)
 Create a new delay value.
 
ast_disable_statementast_new_disable_statement (ast_identifier id)
 Creates and returns a pointer to a new disable statement.
 
ast_edge_sensitive_full_path_declarationast_new_edge_sensitive_full_path_declaration (ast_edge edge, ast_list *input_terminal, ast_operator polarity, ast_list *output_terminal, ast_expression *data_source, ast_list *delay_value)
 Describes a parallel edge sensitive path declaration. More...
 
ast_edge_sensitive_parallel_path_declarationast_new_edge_sensitive_parallel_path_declaration (ast_edge edge, ast_identifier input_terminal, ast_operator polarity, ast_identifier output_terminal, ast_expression *data_source, ast_list *delay_value)
 Describes a single edge sensitive path declaration. More...
 
ast_concatenation * ast_new_empty_concatenation (ast_concatenation_type type)
 Creates and returns a new empty concatenation of the specified type. More...
 
ast_enable_gate_instanceast_new_enable_gate_instance (ast_identifier name, ast_lvalue *output_terminal, ast_expression *enable_terminal, ast_expression *input_terminal)
 A single Enable gate instance.
 
ast_enable_gate_instancesast_new_enable_gate_instances (ast_gatetype_n_input type, ast_delay3 *delay, ast_drive_strength *drive_strength, ast_list *instances)
 Creates collection of enable gates with the same type and properties.
 
ast_event_controlast_new_event_control (ast_event_control_type type, ast_event_expression *expression)
 Creates and returns a new event control specifier.
 
ast_event_expression * ast_new_event_expression (ast_edge trigger_edge, ast_expression *expression)
 Creates a new event expression node. More...
 
ast_event_expression * ast_new_event_expression_sequence (ast_event_expression *left, ast_event_expression *right)
 Creates a new event expression node, which is itself a sequence of sub-expressions.
 
ast_expression * ast_new_expression_primary (ast_primary *p)
 Creates and returns a new expression primary. More...
 
ast_loop_statementast_new_for_loop_statement (ast_statement *inner_statements, ast_single_assignment *initial_condition, ast_single_assignment *modify_assignment, ast_expression *continue_condition)
 Creates and returns a new for loop statement. More...
 
ast_loop_statementast_new_forever_loop_statement (ast_statement *inner_statement)
 Creates and returns a new forever loop statement. More...
 
ast_function_call * ast_new_function_call (ast_identifier id, ast_boolean constant, ast_boolean system, ast_node_attributes *attr, ast_list *arguments)
 Creates and returns a new node representing a function call. More...
 
ast_function_declarationast_new_function_declaration (ast_boolean automatic, ast_boolean is_signed, ast_boolean function_or_block, ast_range_or_type *rot, ast_identifier identifier, ast_list *item_declarations, ast_statement *statements)
 Creates and returns a function declaration node. More...
 
ast_function_item_declarationast_new_function_item_declaration ()
 Creates and returns a new function item declaration. More...
 
ast_gate_instantiationast_new_gate_instantiation (ast_gate_type type)
 Creates and returns a new gate instantiation descriptor. More...
 
ast_generate_block * ast_new_generate_block (ast_identifier identifier, ast_list *generate_items)
 Creates and returns a new block of generate items.
 
ast_statement * ast_new_generate_item (ast_statement_type type, void *construct)
 Creates and returns a new item which exists inside a generate statement. More...
 
ast_loop_statementast_new_generate_loop_statement (ast_list *inner_statements, ast_single_assignment *initial_condition, ast_single_assignment *modify_assignment, ast_expression *continue_condition)
 Creates and returns a new generate loop statement. More...
 
ast_assignment * ast_new_hybrid_assignment (ast_hybrid_assignment_type type, ast_single_assignment *assignment)
 Creates a new hybrid assignment of the specified type. More...
 
ast_assignment * ast_new_hybrid_lval_assignment (ast_hybrid_assignment_type type, ast_lvalue *lval)
 Creates a new hybrid assignment of the specified type. More...
 
ast_identifier ast_new_identifier (char *identifier, unsigned int from_line)
 Creates and returns a new node representing an identifier. More...
 
ast_if_elseast_new_if_else (ast_conditional_statement *if_condition, ast_statement *else_condition)
 Creates a new if-then-else-then statement. More...
 
ast_expression * ast_new_index_expression (ast_expression *left)
 Creates a new range index expression with the supplied operands. More...
 
ast_library_declarationast_new_library_declaration (ast_identifier identifier, ast_list *file_paths, ast_list *incdirs)
 Creates a new library declaration node.
 
ast_library_descriptionsast_new_library_description (ast_library_item_type type)
 Creates and returns a new library description object.
 
ast_lvalueast_new_lvalue_concat (ast_lvalue_type type, ast_concatenation *id)
 Creates and returns a new ast_lvalue pointer, with the data type being a concatenation holder of either NET_CONCATENATION or VAR_CONCATENATION.
 
ast_lvalueast_new_lvalue_id (ast_lvalue_type type, ast_identifier id)
 Creates and returns a new ast_lvalue pointer, with the data type being a single identifier of either NET_IDENTIFIER or VAR_IDENTIFIER.
 
ast_expression * ast_new_mintypmax_expression (ast_expression *min, ast_expression *typ, ast_expression *max)
 Creates a new (min,typical,maximum) expression. More...
 
ast_module_declaration * ast_new_module_declaration (ast_node_attributes *attributes, ast_identifier identifier, ast_list *parameters, ast_list *ports, ast_list *constructs)
 Creates a new module instantiation. More...
 
ast_module_instanceast_new_module_instance (ast_identifier instance_identifier, ast_list *port_connections)
 Creates and returns a new instance of a module with a given identifer and set of port connections.
 
ast_module_instantiationast_new_module_instantiation (ast_identifier module_identifer, ast_list *module_parameters, ast_list *module_instances)
 Creates and returns a new set of module instances with shared parameters.
 
ast_module_item * ast_new_module_item (ast_node_attributes *attributes, ast_module_item_type type)
 Creates and returns a new module item descriptor. More...
 
ast_primaryast_new_module_path_primary (ast_primary_value_type type)
 Creates a new ast primary which is part of a constant expression tree with the supplied type and value. More...
 
ast_mos_switch_instanceast_new_mos_switch_instance (ast_identifier name, ast_lvalue *output_terminal, ast_expression *enable_terminal, ast_expression *input_terminal)
 A single MOS switch (transistor) instance.
 
ast_n_input_gate_instanceast_new_n_input_gate_instance (ast_identifier name, ast_list *input_terminals, ast_lvalue *output_terminal)
 An N-input gate instance. e.g. 3-to-1 NAND.
 
ast_n_input_gate_instancesast_new_n_input_gate_instances (ast_gatetype_n_input type, ast_delay3 *delay, ast_drive_strength *drive_strength, ast_list *instances)
 Creates collection of n-input gates with the same type and properties.
 
ast_n_output_gate_instanceast_new_n_output_gate_instance (ast_identifier name, ast_list *outputs, ast_expression *input)
 Creates and returns a new n_output gate instance. More...
 
ast_n_output_gate_instancesast_new_n_output_gate_instances (ast_n_output_gatetype type, ast_delay2 *delay, ast_drive_strength *drive_strength, ast_list *instances)
 Creates and returns a set of n_output gates with the same properties.
 
ast_port_connectionast_new_named_port_connection (ast_identifier port_name, ast_expression *expression)
 Creates and returns a new port connection representation. More...
 
ast_listast_new_net_declaration (ast_type_declaration *type_dec)
 Creates a new net declaration object. More...
 
ast_assignment * ast_new_nonblocking_assignment (ast_lvalue *lval, ast_expression *expression, ast_timing_control_statement *delay_or_event)
 Creates and returns a new nonblocking procedural assignment object. More...
 
ast_number * ast_new_number (ast_number_base base, ast_number_representation representation, char *digits)
 Creates a new number representation object. More...
 
ast_parameter_declarationsast_new_parameter_declarations (ast_list *assignments, ast_boolean signed_values, ast_boolean local, ast_range *range, ast_parameter_type type)
 creates and returns a new set of parameter declarations of the same type More...
 
ast_pass_enable_switchast_new_pass_enable_switch (ast_identifier name, ast_lvalue *terminal_1, ast_lvalue *terminal_2, ast_expression *enable)
 Creates and returns a new pass enable switch instance.
 
ast_pass_enable_switchesast_new_pass_enable_switches (ast_pass_enable_switchtype type, ast_delay2 *delay, ast_list *switches)
 Creates and returns a collection of pass enable switches.
 
ast_pass_switch_instanceast_new_pass_switch_instance (ast_identifier name, ast_lvalue *terminal_1, ast_lvalue *terminal_2)
 A single pass transistor instance.
 
ast_path_declarationast_new_path_declaration (ast_path_declaration_type type)
 Creates and returns a new path declaration type. Expects that the data be filled in manually;.
 
ast_port_declarationast_new_port_declaration (ast_port_direction direction, ast_net_type net_type, ast_boolean net_signed, ast_boolean is_reg, ast_boolean is_variable, ast_range *range, ast_list *port_names)
 Creates and returns a new port declaration representation. More...
 
ast_primaryast_new_primary (ast_primary_value_type type)
 Creates a new ast primary which is part of an expression tree with the supplied type and value. More...
 
ast_primaryast_new_primary_function_call (ast_function_call *call)
 Creates a new AST primary wrapper around a function call. More...
 
ast_primitive_pull_strengthast_new_primitive_pull_strength (ast_pull_direction direction, ast_primitive_strength strength_1, ast_primitive_strength strength_0)
 Creates and returns a new structure describing primitive net strength.
 
ast_pull_gate_instanceast_new_pull_gate_instance (ast_identifier name, ast_lvalue *output_terminal)
 Describes a single pull gate instance.
 
ast_pull_strengthast_new_pull_stregth (ast_primitive_strength strength_1, ast_primitive_strength strength_2)
 Create and return a new pull strength indicator for 1 and 0.
 
ast_pulse_control_specparamast_new_pulse_control_specparam (ast_expression *reject_limit, ast_expression *error_limit)
 Creates and returns a new pulse control data structure.
 
ast_range * ast_new_range (ast_expression *upper, ast_expression *lower)
 Creates and returns a new range or dimension representation node.
 
ast_expression * ast_new_range_expression (ast_expression *left, ast_expression *right)
 Creates a new range expression with the supplied operands. More...
 
ast_range_or_typeast_new_range_or_type (ast_boolean is_range)
 Creates and returns a new object storing either a range or a type. More...
 
ast_listast_new_reg_declaration (ast_type_declaration *type_dec)
 Creates a new reg declaration object. More...
 
ast_loop_statementast_new_repeat_loop_statement (ast_statement *inner_statement, ast_expression *continue_condition)
 Creates and returns a repeat loop statement. More...
 
ast_simple_full_path_declarationast_new_simple_full_path_declaration (ast_list *input_terminals, ast_operator polarity, ast_list *output_terminals, ast_list *delay_value)
 Creates and returns a pointer to a new simple full path declaration.
 
ast_simple_parallel_path_declarationast_new_simple_parallel_path_declaration (ast_identifier input_terminal, ast_operator polarity, ast_identifier output_terminal, ast_list *delay_value)
 Creates and returns a pointer to a new simple parallel path declaration.
 
ast_single_assignment * ast_new_single_assignment (ast_lvalue *lval, ast_expression *expression)
 Creates and returns a new continuous assignment. More...
 
ast_source_itemast_new_source_item (ast_source_item_type type)
 Creates and returns a new source item representation. More...
 
ast_statement * ast_new_statement (ast_node_attributes *attr, ast_boolean is_function_statement, void *data, ast_statement_type type)
 Creates a new AST statement and returns it. More...
 
ast_statement_blockast_new_statement_block (ast_block_type type, ast_identifier block_identifier, ast_list *declarations, ast_list *statements)
 Creates and returns a new statement block of the specified type. More...
 
ast_expression * ast_new_string_expression (ast_string string)
 Creates a new string expression. More...
 
ast_switch_gateast_new_switch_gate_d2 (ast_switchtype type, ast_delay2 *delay)
 Instances a new switch type with a delay2.
 
ast_switch_gateast_new_switch_gate_d3 (ast_switchtype type, ast_delay3 *delay)
 Instances a new switch type with a delay3.
 
ast_switchesast_new_switches (ast_switch_gate *type, ast_list *switches)
 creates and returns a new collection of AST switches. More...
 
ast_identifier ast_new_system_identifier (char *identifier, unsigned int from_line)
 Creates and returns a new node representing an identifier. More...
 
ast_task_declarationast_new_task_declaration (ast_boolean automatic, ast_identifier identifier, ast_list *ports, ast_list *declarations, ast_statement *statements)
 Creates and returns a new task declaration statement. More...
 
ast_task_enable_statementast_new_task_enable_statement (ast_list *expressions, ast_identifier identifier, ast_boolean is_system)
 creates and returns a pointer to a new task-enable statement.
 
ast_task_portast_new_task_port (ast_port_direction direction, ast_boolean reg, ast_boolean is_signed, ast_range *range, ast_task_port_type type, ast_list *identifiers)
 
ast_timing_control_statementast_new_timing_control_statement_delay (ast_timing_control_statement_type type, ast_statement *statement, ast_delay_ctrl *delay_ctrl)
 Creates and returns a new timing control statement node.
 
ast_timing_control_statementast_new_timing_control_statement_event (ast_timing_control_statement_type type, ast_expression *repeat, ast_statement *statement, ast_event_control *event_ctrl)
 Creates and returns a new timing control statement node.
 
ast_type_declarationast_new_type_declaration (ast_declaration_type type)
 Creates and returns a node to represent the declaration of a new module item construct. More...
 
ast_udp_bodyast_new_udp_combinatoral_body (ast_list *combinatorial_entries)
 Creates and returns a new combinatorial UDP body representation.
 
ast_udp_combinatorial_entryast_new_udp_combinatoral_entry (ast_list *input_levels, ast_udp_next_state output_symbol)
 Creates a new combinatorial entry for a UDP node.
 
ast_udp_declarationast_new_udp_declaration (ast_node_attributes *attributes, ast_identifier identifier, ast_list *ports, ast_udp_body *body)
 Creates a new UDP declaration node. More...
 
ast_udp_initial_statementast_new_udp_initial_statement (ast_identifier output_port, ast_number *initial_value)
 Creates a new initial statement node.
 
ast_udp_portast_new_udp_input_port (ast_list *identifiers, ast_node_attributes *attributes)
 Creates a new UDP input port AST node. More...
 
ast_udp_instanceast_new_udp_instance (ast_identifier identifier, ast_range *range, ast_lvalue *output, ast_list *inputs)
 Creates a new instance of a UDP. More...
 
ast_udp_instantiationast_new_udp_instantiation (ast_list *instances, ast_identifier identifier, ast_drive_strength *drive_strength, ast_delay2 *delay)
 Creates a new list of UDP instances with shared properties. More...
 
ast_udp_portast_new_udp_port (ast_port_direction direction, ast_identifier identifier, ast_node_attributes *attributes, ast_boolean reg, ast_expression *default_value)
 Creates a new UDP port AST node. More...
 
ast_udp_bodyast_new_udp_sequential_body (ast_udp_initial_statement *initial_statement, ast_list *sequential_entries)
 Creates and returns a new sequential UDP body representation.
 
ast_udp_sequential_entryast_new_udp_sequential_entry (ast_udp_seqential_entry_prefix prefix_type, ast_list *levels_or_edges, ast_level_symbol current_state, ast_udp_next_state output)
 Creates a new sequntial body entry for a UDP node.
 
ast_expression * ast_new_unary_expression (ast_primary *operand, ast_operator operation, ast_node_attributes *attr, ast_boolean constant)
 Creates a new unary expression with the supplied operation. More...
 
ast_listast_new_var_declaration (ast_type_declaration *type_dec)
 Creates a new variable declaration object. More...
 
ast_wait_statementast_new_wait_statement (ast_expression *wait_for, ast_statement *statement)
 Creates and returns a new wait statement.
 
ast_loop_statementast_new_while_loop_statement (ast_statement *inner_statement, ast_expression *continue_condition)
 Creates and returns a while loop statement. More...
 
ast_node * ast_node_new ()
 Creates a new empty ast_node and returns it. More...
 
char * ast_number_tostring (ast_number *n)
 A utility function for converting an ast number into a string. More...
 
char * ast_operator_tostring (ast_operator op)
 Returns the string representation of an operator;.
 
char * ast_primary_tostring (ast_primary *p)
 A utility function for converting an ast expression primaries back into a string representation. More...
 
void verilog_free_source_tree (verilog_source_tree *tofree)
 Releases a source tree object from memory. More...
 
verilog_source_treeverilog_new_source_tree ()
 Creates and returns a new, empty source tree. More...
 

Variables

ast_metadata meta
 Node metadata.
 
verilog_source_treeyy_verilog_source_tree
 This is where we put all of the parsed constructs. More...
 
int yylineno
 

Detailed Description

Contains Declarations of datastructures and functions which represent and operate on the Verilog Abstract Syntax Tree (AST)

Contains definitions of functions which operate on the Verilog Abstract Syntax Tree (AST)

Enumeration Type Documentation

enum ast_edge

Describes a rising or falling edge, or where none is specified.

Enumerator
EDGE_NEG 

Positive edge.

EDGE_NONE 

Negative edge.

EDGE_ANY 

Not edge triggered.

Positive or negative edge.

Stores different Operators.

Enumerator
OPERATOR_ASL 

Arithmetic shift left.

OPERATOR_ASR 

Arithmetic shift right.

OPERATOR_LSL 

logical shift left

OPERATOR_LSR 

logical shift right

OPERATOR_DIV 

divide

OPERATOR_POW 

pow

OPERATOR_MOD 

mod

OPERATOR_GTE 

greater than or equal to

Describes the direction of a port.

Enumerator
PORT_INPUT 

Input port.

PORT_OUTPUT 

Output port.

PORT_INOUT 

Bi-directional port.

PORT_NONE 

Used for when we don't know at declaration time.