Verilog Parser
verilog_ast.h
Go to the documentation of this file.
1 
7 #include <stdarg.h>
8 #include <stdlib.h>
9 #include <string.h>
10 
11 #include "verilog_ast_common.h"
12 
13 #ifndef VERILOG_AST_H
14 #define VERILOG_AST_H
15 
16 extern int yylineno;
17 
19 typedef struct ast_node_t ast_node;
20 
25 typedef struct ast_identifier_t * ast_identifier;
26 
28 typedef struct ast_concatenation_t ast_concatenation;
29 
31 typedef struct ast_expression_t ast_expression;
33 typedef struct ast_function_call_t ast_function_call;
34 
36 typedef struct ast_module_item_t ast_module_item;
37 
39 typedef enum ast_operator_e{
40  OPERATOR_STAR ,
41  OPERATOR_PLUS ,
42  OPERATOR_MINUS ,
51  OPERATOR_LTE ,
52  OPERATOR_GT ,
53  OPERATOR_LT ,
54  OPERATOR_L_NEG ,
55  OPERATOR_L_AND ,
56  OPERATOR_L_OR ,
57  OPERATOR_C_EQ ,
58  OPERATOR_L_EQ ,
59  OPERATOR_C_NEQ ,
60  OPERATOR_L_NEQ ,
61  OPERATOR_B_NEG ,
62  OPERATOR_B_AND ,
63  OPERATOR_B_OR ,
64  OPERATOR_B_XOR ,
65  OPERATOR_B_EQU ,
66  OPERATOR_B_NAND ,
67  OPERATOR_B_NOR ,
68  OPERATOR_TERNARY ,
69  OPERATOR_NONE = 0
70 } ast_operator;
71 
72 typedef char * ast_string ;
74 typedef struct ast_assignment_t ast_assignment;
76 typedef struct ast_single_assignment_t ast_single_assignment;
78 typedef struct ast_generate_block_t ast_generate_block;
79 typedef struct ast_delay3_t ast_delay3;
80 typedef struct ast_delay2_t ast_delay2;
81 typedef struct ast_delay_value_t ast_delay_value ;
82 typedef struct ast_pull_strength_t ast_drive_strength;
83 typedef void * ast_macro_use ;
84 typedef void * ast_minmax_exp ;
86 typedef struct ast_number_t ast_number ;
87 typedef struct ast_range_t ast_range ;
88 typedef struct ast_block_item_declaration_t ast_block_item_declaration;
89 typedef void * ast_tf_input_declaration;
90 typedef struct ast_statement_t ast_statement;
91 typedef struct ast_module_declaration_t ast_module_declaration;
92 
94 typedef enum ast_boolean_e
95 {
96  AST_TRUE=1,
97  AST_FALSE=0
98 } ast_boolean;
99 
101 typedef enum ast_edge_e{
102  EDGE_POS,
106 } ast_edge;
107 
109 typedef enum ast_port_direction_e{
115 
123 typedef int ast_line;
126 typedef char * ast_file;
127 
131 typedef struct ast_metadata_t{
134 } ast_metadata;
135 
138 //-------------- Numbers ---------------------------------------
139 
147 typedef enum ast_number_base_e{
149  BASE_BINARY,
150  BASE_OCTAL,
151  BASE_DECIMAL,
152  BASE_HEX
154 
156 typedef enum ast_number_representation_e{
161 
167  unsigned int width;
170  union{
171  char * as_bits;
172  float as_float;
173  int as_int;
174  };
175 };
176 
180 ast_number * ast_new_number(
181  ast_number_base base,
182  ast_number_representation representation,
183  char * digits
184 );
185 
190 char * ast_number_tostring(
191  ast_number * n
192 );
193 
194 
198 //-------------- attributes ------------------------------------
199 
211 typedef struct ast_node_attributes_t ast_node_attributes;
213 {
215  ast_identifier attr_name;
216  ast_expression * attr_value;
217 
218  ast_node_attributes * next;
219 };
220 
221 
227 ast_node_attributes * ast_new_attributes(
228  ast_identifier name,
229  ast_expression * value
230 );
231 
239 void ast_append_attribute(ast_node_attributes * parent,
240  ast_node_attributes * toadd);
241 
243 // -------------------------------- Concatenations ---------------------------
244 
253 typedef enum ast_concatenation_type_e
255 {
262 
267  ast_expression * repeat;
269 };
270 
285 ast_concatenation * ast_new_concatenation(ast_concatenation_type type,
286  ast_expression * repeat,
287  void * first_value);
288 
293 ast_concatenation * ast_new_empty_concatenation(ast_concatenation_type type);
294 
301 void ast_extend_concatenation(ast_concatenation * element,
302  ast_expression * repeat,
303  void * data);
304 
305 
307 // -------------------------------- L Value ------------------------
308 
320 typedef enum ast_lvalue_type_e
321 {
322  SPECPARAM_ID,
323  PARAM_ID,
330 
334 typedef union ast_lvalue_data_u
335 {
336  ast_identifier identifier;
337  ast_concatenation * concatenation;
338 } ast_lvalue_data ;
339 
343 typedef struct ast_lvalue_t
344 {
348 } ast_lvalue;
349 
355 ast_lvalue * ast_new_lvalue_id(ast_lvalue_type type, ast_identifier id);
356 
362 ast_lvalue * ast_new_lvalue_concat(ast_lvalue_type type, ast_concatenation*id);
363 
365 // -------------------------------- Function Calls ---------------------------
366 
383  ast_identifier function;
385  ast_node_attributes * attributes;
386 };
387 
388 
399 ast_function_call * ast_new_function_call(ast_identifier id,
400  ast_boolean constant,
401  ast_boolean system,
402  ast_node_attributes * attr,
403  ast_list * arguments);
404 
405 
407 // -------------------------------- Primaries ----------------------
408 
421 typedef enum ast_primary_type_e
422 {
423  CONSTANT_PRIMARY,
424  PRIMARY,
425  MODULE_PATH_PRIMARY
427 
428 
430 typedef enum ast_primary_value_type_e
431 {
432  PRIMARY_NUMBER,
433  PRIMARY_IDENTIFIER,
434  PRIMARY_CONCATENATION,
435  PRIMARY_FUNCTION_CALL,
436  PRIMARY_MINMAX_EXP,
437  PRIMARY_MACRO_USAGE
439 
441 typedef union ast_primary_value_e
442 {
443  ast_number * number;
444  ast_identifier identifier;
445  ast_concatenation * concatenation;
446  ast_function_call * function_call;
447  ast_expression * minmax;
448  ast_macro_use macro;
449  char * string;
451 
465 typedef struct ast_primary_t
466 {
471 } ast_primary;
472 
473 
479 char * ast_primary_tostring(
480  ast_primary * p
481 );
482 
489 
494 ast_primary * ast_new_primary_function_call(ast_function_call * call);
495 
502 
509 
511 // -------------------------------- Expressions --------------------
512 
521 typedef enum ast_expression_type_e
523 {
531  MODULE_PATH_PRIMARY_EXPRESSION,
532  MODULE_PATH_BINARY_EXPRESSION,
533  MODULE_PATH_UNARY_EXPRESSION,
534  MODULE_PATH_CONDITIONAL_EXPRESSION,
535  MODULE_PATH_MINTYPMAX_EXPRESSION,
538 
539 
542 
555 {
558  ast_node_attributes * attributes;
559  ast_expression * left;
560  ast_expression * right;
561  ast_expression * aux;
565  ast_string string;
566 };
567 
574  ast_expression * exp
575 );
576 
585 ast_expression * ast_new_expression_primary(ast_primary * p);
586 
595 ast_expression * ast_new_binary_expression(ast_expression * left,
596  ast_expression * right,
597  ast_operator operation,
598  ast_node_attributes * attr,
599  ast_boolean constant);
600 
608 ast_expression * ast_new_unary_expression(ast_primary * operand,
609  ast_operator operation,
610  ast_node_attributes * attr,
611  ast_boolean constant);
612 
626 ast_expression * ast_new_range_expression(ast_expression * left,
627  ast_expression * right);
628 
641 ast_expression * ast_new_index_expression(ast_expression * left);
642 
647 ast_expression * ast_new_string_expression(ast_string string);
648 
649 
665 ast_expression * ast_new_conditional_expression(ast_expression * condition,
666  ast_expression * if_true,
667  ast_expression * if_false,
668  ast_node_attributes * attr);
669 
678 ast_expression * ast_new_mintypmax_expression(ast_expression * min,
679  ast_expression * typ,
680  ast_expression * max);
681 
683 // -------------------------------- Specify Blocks ---------------------------
684 
692 typedef enum ast_path_declaration_type_e{
694  SIMPLE_PARALLEL_PATH,
695  SIMPLE_FULL_PATH,
696  EDGE_SENSITIVE_PARALLEL_PATH,
697  EDGE_SENSITIVE_FULL_PATH,
698  STATE_DEPENDENT_PARALLEL_PATH,
699  STATE_DEPENDENT_FULL_PATH,
700  STATE_DEPENDENT_EDGE_PARALLEL_PATH,
701  STATE_DEPENDENT_EDGE_FULL_PATH,
703 
704 
706 typedef struct ast_simple_parallel_path_declaration_t{
708  ast_identifier input_terminal;
709  ast_operator polarity;
710  ast_identifier output_terminal;
711  ast_list * delay_value;
713 
714 
716 typedef struct ast_simple_full_path_declaration_t{
718  ast_list * input_terminals;
719  ast_operator polarity;
720  ast_list * output_terminals;
721  ast_list * delay_value;
723 
724 
726 typedef struct ast_edge_sensitive_parallel_path_declaration_t {
729  ast_identifier input_terminal;
731  ast_identifier output_terminal;
732  ast_expression * data_source;
735 
737 typedef struct ast_edge_sensitive_full_path_declaration_t {
743  ast_expression * data_source;
746 
748 typedef struct ast_path_declaration_t{
751  ast_expression * state_expression;
752  union {
757  };
759 
765 
770 (
771  ast_identifier input_terminal,
772  ast_operator polarity,
773  ast_identifier output_terminal,
774  ast_list * delay_value
775 );
776 
777 
782 (
783  ast_list * input_terminals,
784  ast_operator polarity,
785  ast_list * output_terminals,
786  ast_list * delay_value
787 );
788 
794  ast_edge edge,
795  ast_identifier input_terminal,
796  ast_operator polarity,
797  ast_identifier output_terminal,
798  ast_expression * data_source,
799  ast_list * delay_value
800 );
801 
807  ast_edge edge,
808  ast_list * input_terminal,
809  ast_operator polarity,
810  ast_list * output_terminal,
811  ast_expression * data_source,
812  ast_list * delay_value
813 );
814 
815 
818 // -------------------------------- Task Enable Statements -------------------
819 
827 typedef struct ast_task_enable_statement_t{
831  ast_identifier identifier;
834 
839  ast_list * expressions,
840  ast_identifier identifier,
841  ast_boolean is_system
842 );
843 
846 // -------------------------------- Loop Statements --------------------------
847 
855 typedef enum ast_loop_type_e{
857  LOOP_FOREVER,
858  LOOP_REPEAT,
859  LOOP_WHILE,
860  LOOP_FOR,
861  LOOP_GENERATE
862 } ast_loop_type;
863 
865 typedef struct ast_loop_statement_t{
868  union{
869  ast_statement * inner_statement;
871  };
872  ast_expression * condition;
873  ast_single_assignment * initial;
874  ast_single_assignment * modify;
876 
877 
884  ast_statement * inner_statement
885 );
886 
899  ast_statement * inner_statements,
900  ast_single_assignment * initial_condition,
901  ast_single_assignment * modify_assignment,
902  ast_expression * continue_condition
903 );
904 
917  ast_list * inner_statements,
918  ast_single_assignment * initial_condition,
919  ast_single_assignment * modify_assignment,
920  ast_expression * continue_condition
921 );
922 
931  ast_statement * inner_statement,
932  ast_expression * continue_condition
933 );
934 
943  ast_statement * inner_statement,
944  ast_expression * continue_condition
945 );
946 
947 
950 // -------------------------------- Case Statements --------------------------
951 
959 typedef enum ast_case_statement_type_e{
961  CASE,
962  CASEX,
963  CASEZ
965 
967 typedef struct ast_case_item_t{
970  ast_statement * body;
972 } ast_case_item;
973 
975 typedef struct ast_case_statement_t{
977  ast_expression * expression;
979  ast_statement * default_item;
983 
990  ast_statement * body);
991 
992 
998 ast_case_statement * ast_new_case_statement(ast_expression * expression,
999  ast_list * cases,
1001 
1002 
1005 // -------------------------------- IF Else Statements -----------------------
1006 
1014 typedef struct ast_conditional_statement_t {
1017  ast_statement * statement;
1018  ast_expression * condition;
1020 
1022 typedef struct ast_if_else_t{
1025  ast_statement * else_condition;
1026 } ast_if_else;
1027 
1028 
1035  ast_statement * statement,
1036  ast_expression * condition
1037 );
1038 
1050  ast_conditional_statement * if_condition,
1051  ast_statement * else_condition
1052 );
1053 
1054 
1062 void ast_extend_if_else(
1063  ast_if_else * conditional_statements,
1064  ast_list * new_statement
1065 );
1066 
1067 
1070 // -------------------------------- Timing Control Statements ----------------
1071 
1079 typedef struct ast_wait_statement_t{
1082  ast_expression * expression;
1083  ast_statement * statement;
1085 
1086 typedef enum ast_event_expression_type_e{
1092 
1094 typedef struct ast_event_expression_t ast_event_expression;
1098  union{
1099  ast_expression * expression;
1101  };
1102 };
1103 
1105 // or triggers on anything.
1106 typedef enum ast_event_control_type_e{
1107  EVENT_CTRL_NONE,
1108  EVENT_CTRL_ANY,
1109  EVENT_CTRL_TRIGGERS
1110 
1112 
1114 typedef struct ast_event_control_t{
1117  ast_event_expression * expression;
1119 
1121 typedef enum ast_timing_control_statement_type_e{
1122  TIMING_CTRL_DELAY_CONTROL,
1123  TIMING_CTRL_EVENT_CONTROL,
1124  TIMING_CTRL_EVENT_CONTROL_REPEAT
1126 
1128 typedef enum ast_delay_ctrl_type_e{
1129  DELAY_CTRL_VALUE,
1130  DELAY_CTRL_MINTYPMAX
1132 
1134 typedef struct ast_delay_ctrl_t{
1136  ast_delay_ctrl_type type;
1137  union{
1138  ast_delay_value * value;
1139  ast_expression * mintypmax;
1140  };
1141 } ast_delay_ctrl;
1142 
1144 typedef struct ast_timing_control_statement_t{
1147  union{
1148  ast_delay_ctrl * delay;
1149  ast_event_control * event_ctrl;
1150  };
1151  ast_expression * repeat;
1152  ast_statement * statement;
1154 
1159  ast_expression * wait_for,
1160  ast_statement * statement
1161 );
1162 
1168 ast_event_expression * ast_new_event_expression(
1169  ast_edge trigger_edge,
1170  ast_expression * expression
1171 );
1172 
1177 ast_event_expression * ast_new_event_expression_sequence(
1178  ast_event_expression * left,
1179  ast_event_expression * right
1180 );
1181 
1187  ast_event_expression * expression
1188 );
1189 
1194 
1199  ast_expression * mintypmax
1200 );
1201 
1207  ast_statement * statement,
1208  ast_delay_ctrl * delay_ctrl
1209 );
1210 
1211 
1217  ast_expression * repeat,
1218  ast_statement * statement,
1219  ast_event_control * event_ctrl
1220 );
1221 
1224 // -------------------------------- Fork Join Sequential ---------------------
1225 
1233 typedef struct ast_disable_statement_t{
1236  ast_identifier id;
1238 
1241 
1242 
1244 typedef enum ast_block_type_e{
1245  BLOCK_SEQUENTIAL,
1246  BLOCK_SEQUENTIAL_INITIAL,
1247  BLOCK_SEQUENTIAL_ALWAYS,
1248  BLOCK_FUNCTION_SEQUENTIAL,
1249  BLOCK_PARALLEL,
1250 } ast_block_type;
1251 
1257 typedef struct ast_statement_block_t{
1259  ast_block_type type;
1260  ast_identifier block_identifier;
1261  ast_list * declarations;
1262  ast_list * statements;
1263  ast_timing_control_statement * trigger; //<! Use if this is an always block
1265 
1273  ast_block_type type,
1274  ast_identifier block_identifier,
1275  ast_list * declarations,
1276  ast_list * statements
1277 );
1278 
1281 // -------------------------------- Procedural Blocks and Assignments --------
1282 
1291 typedef enum ast_assignment_type_e{
1298 
1305  ast_expression * expression;
1306  ast_drive_strength * drive_strength;
1307  ast_delay3 * delay;
1308 };
1309 
1313 ast_single_assignment * ast_new_single_assignment(
1314  ast_lvalue * lval,
1315  ast_expression * expression
1316 );
1317 
1321 typedef struct ast_continuous_assignment_t{
1325 
1329 typedef struct ast_procedural_assignment_t{
1331  ast_lvalue * lval;
1332  ast_expression * expression;
1333  ast_timing_control_statement * delay_or_event;
1335 
1337 typedef enum ast_hybrid_assignment_type_e{
1338  HYBRID_ASSIGNMENT_ASSIGN,
1339  HYBRID_ASSIGNMENT_DEASSIGN,
1340  HYBRID_ASSIGNMENT_FORCE_NET,
1341  HYBRID_ASSIGNMENT_FORCE_VAR,
1342  HYBRID_ASSIGNMENT_RELEASE_VAR,
1343  HYBRID_ASSIGNMENT_RELEASE_NET,
1345 
1353 typedef struct ast_hybrid_assignment_t{
1355  union
1356  {
1357  ast_single_assignment * assignment;
1359  };
1362 
1367  union{
1371  };
1372 };
1373 
1377 ast_assignment * ast_new_hybrid_assignment(
1379  ast_single_assignment * assignment
1380 );
1381 
1385 ast_assignment * ast_new_hybrid_lval_assignment(
1387  ast_lvalue * lval
1388 );
1389 
1393 ast_assignment * ast_new_blocking_assignment(
1394  ast_lvalue * lval,
1395  ast_expression * expression,
1396  ast_timing_control_statement* delay_or_event
1397 );
1398 
1402 ast_assignment * ast_new_nonblocking_assignment(
1403  ast_lvalue * lval,
1404  ast_expression * expression,
1405  ast_timing_control_statement * delay_or_event
1406 );
1407 
1408 
1414 ast_assignment * ast_new_continuous_assignment(
1415  ast_list * assignments,
1416  ast_drive_strength * strength,
1417  ast_delay3 * delay
1418 );
1419 
1420 
1422 typedef enum ast_statement_type_e{
1423  STM_GENERATE=0,
1425  STM_CASE=2,
1427  STM_DISABLE=4,
1428  STM_EVENT_TRIGGER=5,
1433  STM_TIMING_CONTROL=10,
1434  STM_FUNCTION_CALL=11,
1436  STM_WAIT=13,
1437  STM_MODULE_ITEM=14
1439 
1440 
1451  ast_statement_type type;
1452  ast_boolean is_function_statement;
1453  ast_node_attributes * attributes;
1454  ast_boolean is_generate_statement;
1455  union{
1456  ast_wait_statement * wait;
1457  ast_task_enable_statement * task_enable;
1458  ast_function_call * function_call;
1459  ast_timing_control_statement * timing_control;
1460  ast_statement_block * block;
1461  ast_loop_statement * loop;
1462  ast_event_expression * event;
1463  ast_disable_statement * disable;
1464  ast_conditional_statement * conditional;
1465  ast_case_statement * case_statement;
1466  ast_assignment * assignment;
1467  ast_generate_block * generate_block;
1468  ast_module_item * module_item;
1469  void * data;
1470  };
1471 };
1472 
1477 ast_statement * ast_new_statement(
1478  ast_node_attributes * attr,
1479  ast_boolean is_function_statement,
1480  void * data,
1481  ast_statement_type type
1482 );
1483 
1484 
1488 typedef struct ast_pulse_control_specparam_t{
1490  ast_expression * reject_limit;
1491  ast_expression * error_limit;
1492  ast_identifier input_terminal;
1493  ast_identifier output_terminal;
1495 
1500  ast_expression * reject_limit,
1501  ast_expression * error_limit
1502 );
1503 
1508  ast_expression * upper;
1509  ast_expression * lower;
1510 };
1511 
1515 ast_range * ast_new_range(
1516  ast_expression * upper,
1517  ast_expression * lower
1518 );
1519 
1520 
1523 // -------------------------------- UDP Blocks -------------------------------
1524 
1535 typedef enum ast_udp_init_val_e{
1537  UDP_INIT_1,
1538  UDP_INIT_0,
1539  UDP_INIT_X
1541 
1543 typedef enum ast_level_symbol_e{
1544  LEVEL_0,
1545  LEVEL_1,
1546  LEVEL_B,
1547  LEVEL_X,
1550 
1552 typedef enum ast_udp_body_type_e{
1553  UDP_BODY_SEQUENTIAL,
1554  UDP_BODY_COMBINATORIAL
1556 
1557 
1559 typedef enum ast_udp_seqential_entry_prefix_e{
1560  PREFIX_EDGES,
1561  PREFIX_LEVELS
1563 
1565 typedef enum ast_udp_next_state_e{
1566  UDP_NEXT_STATE_X,
1567  UDP_NEXT_STATE_0,
1568  UDP_NEXT_STATE_1,
1572 
1574 typedef struct ast_udp_port_t{
1576  ast_port_direction direction;
1577  union{
1578  ast_identifier identifier;
1580  };
1581  ast_node_attributes * attributes;
1583  ast_expression * default_value;
1584 } ast_udp_port;
1585 
1587 typedef struct ast_udp_initial_statement_t{
1589  ast_identifier output_port;
1590  ast_number * initial_value;
1592 
1594 typedef struct ast_udp_body_t{
1596  ast_list * entries;
1598  ast_udp_body_type body_type;
1599 } ast_udp_body;
1600 
1602 typedef struct ast_udp_combinatorial_entry_t{
1604  ast_list * input_levels;
1605  ast_udp_next_state output_symbol;
1607 
1609 typedef struct ast_udp_sequential_entry_t{
1611  ast_udp_seqential_entry_prefix entry_prefix;
1612  union {
1615  };
1616  ast_level_symbol current_state;
1617  ast_udp_next_state output;
1619 
1626 typedef struct ast_udp_declaration_t{
1628  ast_identifier identifier;
1629  ast_node_attributes * attributes;
1630  ast_list * ports;
1631  ast_list * body_entries;
1633  ast_udp_body_type body_type;
1635 
1637 typedef struct ast_udp_instance_t{
1639  ast_identifier identifier;
1640  ast_range * range;
1641  ast_lvalue * output;
1642  ast_list * inputs;
1644 
1646 typedef struct ast_udp_instantiation_t{
1649  ast_identifier identifier;
1650  ast_drive_strength * drive_strength;
1651  ast_delay2 * delay;
1653 
1654 
1657  ast_identifier output_port,
1658  ast_number * initial_value
1659 );
1660 
1661 
1664  ast_udp_initial_statement * initial_statement,
1665  ast_list * sequential_entries
1666 );
1667 
1670  ast_list * combinatorial_entries
1671 );
1672 
1675  ast_list * input_levels,
1676  ast_udp_next_state output_symbol
1677 );
1678 
1681  ast_udp_seqential_entry_prefix prefix_type,
1682  ast_list * levels_or_edges,
1683  ast_level_symbol current_state,
1684  ast_udp_next_state output
1685 );
1686 
1693  ast_port_direction direction,
1694  ast_identifier identifier,
1695  ast_node_attributes * attributes,
1696  ast_boolean reg,
1697  ast_expression * default_value
1698 );
1699 
1706  ast_list * identifiers,
1707  ast_node_attributes * attributes
1708 );
1709 
1717  ast_node_attributes * attributes,
1718  ast_identifier identifier,
1719  ast_list * ports,
1720  ast_udp_body * body
1721 );
1722 
1729  ast_identifier identifier,
1730  ast_range * range,
1731  ast_lvalue * output,
1732  ast_list * inputs
1733 );
1734 
1741  ast_list * instances,
1742  ast_identifier identifier,
1743  ast_drive_strength * drive_strength,
1744  ast_delay2 * delay
1745 );
1746 
1747 
1750 // -------------------------------- Generate Statements ----------------------
1751 
1759 struct ast_generate_block_t{
1762  ast_identifier identifier;
1763  ast_list * generate_items;
1764 };
1765 
1767 ast_generate_block * ast_new_generate_block(
1768  ast_identifier identifier,
1769  ast_list * generate_items
1770 );
1771 
1778 ast_statement * ast_new_generate_item(
1779  ast_statement_type type,
1780  void * construct
1781 );
1782 
1785 // -------------------------------- Module Instantiation ---------------------
1786 
1802 typedef struct ast_module_instantiation_t {
1805  union{
1806  ast_identifier module_identifer;
1807  ast_module_declaration * declaration;
1808  };
1809  ast_list * module_parameters;
1810  ast_list * module_instances;
1812 
1818  ast_identifier module_identifer,
1819  ast_list * module_parameters,
1820  ast_list * module_instances
1821 );
1822 
1828 typedef struct ast_module_instance_t{
1830  ast_identifier instance_identifier;
1831  ast_list * port_connections;
1833 
1834 
1840  ast_identifier instance_identifier,
1841  ast_list * port_connections
1842 );
1843 
1848 typedef struct ast_port_connection_t{
1850  ast_identifier port_name;
1851  ast_expression * expression;
1853 
1861  ast_identifier port_name,
1862  ast_expression * expression
1863 );
1864 
1867 // -------------------------------- Primitives -------------------------------
1868 
1877 typedef enum ast_switchtype_e{
1879  SWITCH_CMOS,
1880  SWITCH_RCMOS,
1881  SWITCH_NMOS,
1882  SWITCH_PMOS,
1883  SWITCH_RNMOS,
1884  SWITCH_RPMOS,
1885  SWITCH_TRAN,
1886  SWITCH_RTRAN
1887 } ast_switchtype;
1888 
1890 typedef struct ast_switch_gate_t{
1892  ast_switchtype type;
1893  union {
1894  ast_delay3 * delay3;
1895  ast_delay2 * delay2;
1896  };
1897 } ast_switch_gate;
1898 
1901  ast_switchtype type,
1902  ast_delay3 * delay
1903 );
1904 
1907  ast_switchtype type,
1908  ast_delay2 * delay
1909 );
1910 
1912 typedef enum ast_primitive_strength_e{
1913  STRENGTH_HIGHZ0,
1914  STRENGTH_HIGHZ1,
1915  STRENGTH_SUPPLY0,
1916  STRENGTH_STRONG0,
1917  STRENGTH_PULL0,
1918  STRENGTH_WEAK0,
1919  STRENGTH_SUPPLY1,
1920  STRENGTH_STRONG1,
1921  STRENGTH_PULL1,
1922  STRENGTH_WEAK1,
1923  STRENGTH_NONE
1925 
1927 typedef enum ast_pull_direction_e{
1928  PULL_UP,
1929  PULL_DOWN,
1930  PULL_NONE
1932 
1934  typedef struct ast_pull_strength_t{
1936  ast_primitive_strength strength_1;
1937  ast_primitive_strength strength_2;
1939 
1942  ast_primitive_strength strength_1,
1943  ast_primitive_strength strength_2
1944 );
1945 
1947 typedef struct ast_primitive_pull_strength_t{
1949  ast_pull_direction direction;
1950  ast_primitive_strength strength_1;
1951  ast_primitive_strength strength_0;
1953 
1956  ast_pull_direction direction,
1957  ast_primitive_strength strength_1,
1958  ast_primitive_strength strength_0
1959 );
1960 
1962 typedef struct ast_pull_gate_instance_t{
1964  ast_identifier name;
1965  ast_lvalue * output_terminal;
1967 
1969 typedef struct ast_pass_switch_instance_t{
1971  ast_identifier name;
1972  ast_lvalue * terminal_1;
1973  ast_lvalue * terminal_2;
1975 
1977 typedef enum ast_gatetype_n_input_e{
1978  N_IN_AND,
1979  N_IN_NAND,
1980  N_IN_NOR,
1981  N_IN_OR ,
1982  N_IN_XOR,
1983  N_IN_XNOR
1985 
1987 typedef struct ast_n_input_gate_instances_t{
1989  ast_gatetype_n_input type;
1990  ast_delay3 * delay;
1991  ast_drive_strength * drive_strength;
1992  ast_list * instances;
1994 
1997  ast_gatetype_n_input type,
1998  ast_delay3 * delay,
1999  ast_drive_strength * drive_strength,
2000  ast_list * instances
2001 );
2002 
2004 typedef struct ast_n_input_gate_instance_t{
2006  ast_identifier name;
2007  ast_list * input_terminals;
2008  ast_lvalue * output_terminal;
2010 
2012 typedef enum ast_enable_gatetype_e{
2013  EN_BUFIF0,
2014  EN_BUFIF1,
2015  EN_NOTIF0,
2016  EN_NOTIF1
2018 
2022  ast_enable_gatetype type;
2023  ast_delay3 * delay;
2024  ast_drive_strength * drive_strength;
2025  ast_list * instances;
2027 
2030  ast_gatetype_n_input type,
2031  ast_delay3 * delay,
2032  ast_drive_strength * drive_strength,
2033  ast_list * instances
2034 );
2035 
2037 typedef struct ast_enable_gate_instance_t{
2039  ast_identifier name;
2040  ast_lvalue * output_terminal;
2041  ast_expression * enable_terminal;
2042  ast_expression * input_terminal;
2044 
2046 typedef struct ast_mos_switch_instance_t{
2048  ast_identifier name;
2049  ast_lvalue * output_terminal;
2050  ast_expression * enable_terminal;
2051  ast_expression * input_terminal;
2053 
2055 typedef struct ast_cmos_switch_instance_t{
2057  ast_identifier name;
2058  ast_lvalue * output_terminal;
2059  ast_expression * ncontrol_terminal;
2060  ast_expression * pcontrol_terminal;
2061  ast_expression * input_terminal;
2063 
2065 typedef struct ast_pass_enable_switch_t{
2067  ast_identifier name;
2068  ast_lvalue * terminal_1;
2069  ast_lvalue * terminal_2;
2070  ast_expression * enable;
2072 
2074 typedef enum ast_pass_enable_switchtype_e{
2075  PASS_EN_TRANIF0,
2076  PASS_EN_TRANIF1,
2077  PASS_EN_RTRANIF0,
2078  PASS_EN_RTRANIF1
2080 
2085 typedef struct ast_pass_enable_switches_t{
2088  ast_delay2 * delay;
2089  ast_list * switches;
2091 
2093 typedef enum ast_n_output_gatetype_e{
2094  N_OUT_BUF,
2095  N_OUT_NOT
2097 
2099 typedef struct ast_n_output_gate_instance_t{
2101  ast_identifier name;
2102  ast_list * outputs;
2103  ast_expression * input;
2105 
2106 typedef struct ast_n_output_gate_instances_t{
2108  ast_n_output_gatetype type;
2109  ast_delay2 * delay;
2110  ast_drive_strength * drive_strength;
2111  ast_list * instances;
2113 
2119  ast_identifier name,
2120  ast_list * outputs,
2121  ast_expression * input
2122 );
2123 
2128  ast_n_output_gatetype type,
2129  ast_delay2 * delay,
2130  ast_drive_strength * drive_strength,
2131  ast_list * instances
2132 );
2133 
2139  ast_delay2 * delay,
2140  ast_list * switches
2141 );
2142 
2147  ast_identifier name,
2148  ast_lvalue * terminal_1,
2149  ast_lvalue * terminal_2,
2150  ast_expression * enable
2151 );
2152 
2155  ast_identifier name,
2156  ast_lvalue * output_terminal
2157 );
2158 
2161  ast_identifier name,
2162  ast_lvalue * terminal_1,
2163  ast_lvalue * terminal_2
2164 );
2165 
2168  ast_identifier name,
2169  ast_list * input_terminals,
2170  ast_lvalue * output_terminal
2171 );
2172 
2175  ast_identifier name,
2176  ast_lvalue * output_terminal,
2177  ast_expression * enable_terminal,
2178  ast_expression * input_terminal
2179 );
2180 
2183  ast_identifier name,
2184  ast_lvalue * output_terminal,
2185  ast_expression * enable_terminal,
2186  ast_expression * input_terminal
2187 );
2188 
2191  ast_identifier name,
2192  ast_lvalue * output_terminal,
2193  ast_expression * ncontrol_terminal,
2194  ast_expression * pcontrol_terminal,
2195  ast_expression * input_terminal
2196 );
2197 
2199 typedef struct ast_switches_t{
2201  ast_switch_gate * type;
2202  ast_list * switches;
2203 } ast_switches;
2204 
2209 
2211 typedef enum ast_gate_type_e{
2221 } ast_gate_type;
2222 
2223 
2227 typedef struct ast_gate_instantiation_t{
2229  ast_gate_type type;
2230  union{
2231  ast_switches * switches;
2232  ast_pass_enable_switches * pass_en;
2233  ast_enable_gate_instances * enable;
2236  struct{
2237  ast_primitive_pull_strength * pull_strength;
2238  ast_list * pull_gates;
2239  };
2240  };
2242 
2249 
2252 // -------------------------------- Delays -----------------------------------
2253 
2261 typedef enum ast_delay_value_type_e{
2263  DELAY_VAL_PARAMETER,
2264  DELAY_VAL_SPECPARAM,
2265  DELAY_VAL_NUMBER,
2266  DELAY_VAL_MINTYPMAX
2268 
2270 typedef struct ast_delay_value_t{
2272  ast_delay_value_type type;
2273  union{
2274  ast_identifier parameter_id;
2275  ast_identifier specparam_id;
2276  ast_number * unsigned_number;
2277  ast_minmax_exp mintypmax;
2278  void * data;
2279  };
2280 } ast_delay_value;
2281 
2285  ast_delay_value * min;
2286  ast_delay_value * max;
2287  ast_delay_value * avg;
2288 };
2289 
2293  ast_delay_value * min;
2294  ast_delay_value * max;
2295 };
2296 
2301  ast_delay_value_type type,
2302  void * data
2303 );
2304 
2308 ast_delay3 * ast_new_delay3(
2309  ast_delay_value * min,
2310  ast_delay_value * avg,
2311  ast_delay_value * max
2312 );
2313 
2317 ast_delay2 * ast_new_delay2(
2318  ast_delay_value * min,
2319  ast_delay_value * max
2320 );
2321 
2322 
2325 // -------------------------------- Strengths --------------------------------
2326 
2339 typedef enum ast_charge_strength_e{
2340  CHARGE_SMALL,
2341  CHARGE_MEDIUM,
2342  CHARGE_LARGE,
2345 
2348 // -------------------------------- Nets and Variables -----------------------
2349 
2362 // -------------------------------- Port Declarations ------------------------
2363 
2371 typedef enum ast_net_type_e{
2383 } ast_net_type;
2384 
2386 typedef struct ast_port_declaration_t{
2393  ast_range * range;
2396 
2401  ast_port_direction direction,
2402  ast_net_type net_type,
2403  ast_boolean net_signed,
2404  ast_boolean is_reg,
2405  ast_boolean is_variable,
2406  ast_range * range,
2407  ast_list * port_names
2408 );
2409 
2412 // -------------------------------- Type Declarations ------------------------
2413 
2421 typedef enum ast_declaration_type_e{
2423  DECLARE_EVENT,
2424  DECLARE_GENVAR,
2425  DECLARE_INTEGER,
2426  DECLARE_TIME,
2427  DECLARE_REALTIME,
2428  DECLARE_REAL,
2429  DECLARE_NET,
2430  DECLARE_REG,
2433 
2439 typedef struct ast_type_declaration_t{
2441  ast_declaration_type type;
2442  ast_net_type net_type;
2443  ast_list * identifiers;
2444  ast_delay3 * delay;
2445  ast_drive_strength * drive_strength;
2446  ast_charge_strength charge_strength;
2447  ast_boolean vectored;
2448  ast_boolean scalared;
2449  ast_boolean is_signed;
2450  ast_range * range;
2452 
2454 typedef struct ast_net_declaration_t{
2457  ast_identifier identifier;
2458  ast_delay3 * delay;
2459  ast_drive_strength * drive;
2460  ast_range * range;
2461  ast_boolean vectored;
2462  ast_boolean scalared;
2463  ast_boolean is_signed;
2464  ast_expression * value;
2466 
2467 
2469 typedef struct ast_reg_declaration_t{
2471  ast_identifier identifier;
2472  ast_range * range;
2473  ast_boolean is_signed;
2474  ast_expression * value;
2476 
2478 typedef struct ast_var_declaration_t{
2480  ast_identifier identifier;
2483 
2492  ast_type_declaration * type_dec
2493 );
2494 
2503  ast_type_declaration * type_dec
2504 );
2505 
2514  ast_type_declaration * type_dec
2515 );
2516 
2517 
2532 
2535 // -------------------------------- Module Parameters ------------------------
2536 
2544 typedef enum ast_parameter_type_e{
2546  PARAM_INTEGER,
2547  PARAM_REAL,
2548  PARAM_REALTIME,
2549  PARAM_TIME,
2551  PARAM_SPECPARAM
2553 
2555 typedef struct ast_parameter_declarations_t{
2557  ast_list * assignments;
2560  ast_range * range;
2561  ast_parameter_type type;
2563 
2572  ast_list * assignments,
2573  ast_boolean signed_values,
2574  ast_boolean local,
2575  ast_range * range,
2576  ast_parameter_type type
2577 );
2578 
2581 // --------------------------- Block Item Declaration ------------------------
2582 
2590 typedef struct ast_block_reg_declaration_t{
2594  ast_range * range;
2597 
2602  ast_boolean is_signed,
2603  ast_range * range,
2604  ast_list * identifiers
2605 );
2606 
2608 typedef enum ast_block_item_declaration_type_e{
2613 
2618  ast_node_attributes * attributes;
2619  union{
2623  };
2624 };
2625 
2630 ast_block_item_declaration * ast_new_block_item_declaration(
2632  ast_node_attributes * attributes
2633 );
2634 
2635 
2638 // -------------------------------- Function Declaration ---------------------
2639 
2648 typedef enum ast_task_port_type_e{
2656 
2658 typedef struct ast_range_or_type_t{
2661  union{
2662  ast_range * range;
2664  };
2666 
2673 
2674 
2678 typedef struct ast_function_declaration_t{
2684  ast_identifier identifier;
2686  ast_statement *statements;
2688 
2693  ast_boolean automatic,
2694  ast_boolean is_signed,
2695  ast_boolean function_or_block,
2696  ast_range_or_type *rot,
2697  ast_identifier identifier,
2698  ast_list *item_declarations,
2699  ast_statement *statements
2700 );
2701 
2702 /*
2703 @brief Fully describes a set of task arguments with the same properties.
2704 */
2705 typedef struct ast_task_port_t{
2710  ast_range * range;
2713 } ast_task_port;
2714 
2715 
2716 /*
2717 @brief Creates and returns a new representation of a task or function
2718 argument.
2719 */
2721  ast_port_direction direction,
2722  ast_boolean reg,
2723  ast_boolean is_signed,
2724  ast_range * range,
2725  ast_task_port_type type,
2726  ast_list * identifiers
2727 );
2728 
2733 typedef struct ast_function_item_declaration_t{
2736  union{
2737  ast_block_item_declaration * block_item;
2739  };
2741 
2748 
2751 // -------------------------------- Task Declaration -------------------------
2752 
2763 typedef struct ast_task_declaration_t{
2766  ast_identifier identifier;
2769  ast_statement * statements;
2771 
2776  ast_boolean automatic,
2777  ast_identifier identifier,
2778  ast_list * ports,
2779  ast_list * declarations,
2780  ast_statement * statements
2781 );
2782 
2783 
2784 
2787 // -------------------------------- Module Items -----------------------------
2788 
2797 typedef enum ast_module_item_type_e{
2800  MOD_ITEM_GENERATED_INSTANTIATION,
2802  MOD_ITEM_SPECIFY_BLOCK,
2803  MOD_ITEM_SPECPARAM_DECLARATION,
2804  MOD_ITEM_PARAMETER_OVERRIDE,
2806  MOD_ITEM_GATE_INSTANTIATION,
2807  MOD_ITEM_UDP_INSTANTIATION,
2808  MOD_ITEM_MODULE_INSTANTIATION,
2809  MOD_ITEM_INITIAL_CONSTRUCT,
2810  MOD_ITEM_ALWAYS_CONSTRUCT,
2811  MOD_ITEM_NET_DECLARATION,
2812  MOD_ITEM_REG_DECLARATION,
2813  MOD_ITEM_INTEGER_DECLARATION,
2814  MOD_ITEM_REAL_DECLARATION,
2815  MOD_ITEM_TIME_DECLARATION,
2816  MOD_ITEM_REALTIME_DECLARATION,
2817  MOD_ITEM_EVENT_DECLARATION,
2818  MOD_ITEM_GENVAR_DECLARATION,
2819  MOD_ITEM_TASK_DECLARATION,
2820  MOD_ITEM_FUNCTION_DECLARATION
2822 
2826  ast_module_item_type type;
2827  ast_node_attributes *attributes;
2828  union{
2829  ast_port_declaration * port_declaration;
2830  ast_generate_block * generated_instantiation;
2831  ast_parameter_declarations * parameter_declaration;
2832  ast_list * specify_block;
2833  ast_parameter_declarations * specparam_declaration;
2834  ast_list * parameter_override;
2835  ast_continuous_assignment * continuous_assignment;
2836  ast_gate_instantiation * gate_instantiation;
2837  ast_udp_instantiation * udp_instantiation;
2838  ast_module_instantiation * module_instantiation;
2839  ast_statement * always_construct;
2840  ast_statement * initial_construct;
2841  ast_type_declaration * net_declaration;
2842  ast_type_declaration * reg_declaration;
2843  ast_type_declaration * integer_declaration;
2844  ast_type_declaration * real_declaration;
2845  ast_type_declaration * time_declaration;
2846  ast_type_declaration * realtime_declaration;
2847  ast_type_declaration * event_declaration;
2848  ast_type_declaration * genvar_declaration;
2849  ast_task_declaration * task_declaration;
2850  ast_function_declaration * function_declaration;
2851  };
2852 };
2853 
2860 ast_module_item * ast_new_module_item(
2861  ast_node_attributes * attributes,
2863 );
2864 
2872  ast_statement_type type,
2873  ast_statement * body
2874 );
2875 
2876 // -------------------------------- Module Declarations ----------------------
2877 
2892  ast_node_attributes * attributes;
2893  ast_identifier identifier;
2917 
2918 } ;
2919 
2929 ast_module_declaration * ast_new_module_declaration(
2930  ast_node_attributes * attributes,
2931  ast_identifier identifier,
2932  ast_list * parameters,
2933  ast_list * ports,
2934  ast_list * constructs
2935 );
2936 
2937 
2940 // -------------------------------- Identifiers ------------------------------
2941 
2953 typedef enum ast_identifier_type_e{
2954  ID_ARRAYED,
2955  ID_BLOCK,
2956  ID_CELL,
2957  ID_CONFIG,
2958  ID_ESCAPED_ARRAYED,
2959  ID_ESCAPED_HIERARCHICAL_BRANCH,
2960  ID_ESCAPED_HIERARCHICAL,
2961  ID_ESCAPED_HIERARCHICALS,
2962  ID_ESCAPED,
2963  ID_EVENT,
2964  ID_EVENT_TRIGGER,
2965  ID_FUNCTION,
2966  ID_GATE_INSTANCE,
2967  ID_GENERATE_BLOCK,
2968  ID_GENVAR,
2969  ID_HIERARCHICAL_BLOCK,
2970  ID_HIERARCHICAL_EVENT,
2971  ID_HIERARCHICAL_FUNCTION,
2972  ID_HIERARCHICAL,
2973  ID_HIERARCHICAL_NET,
2974  ID_HIERARCHICAL_TASK,
2975  ID_HIERARCHICAL_VARIABLE,
2976  ID_CSV,
2977  ID_INOUT_PORT,
2978  ID_INPUT,
2979  ID_INPUT_PORT,
2980  ID_INSTANCE,
2981  ID_LIBRARY,
2984  ID_NAME_OF_GATE_INSTANCE,
2985  ID_NAME_OF_INSTANCE,
2986  ID_NET,
2987  ID_OUTPUT,
2988  ID_OUTPUT_PORT,
2989  ID_PARAMETER,
2990  ID_PORT,
2991  ID_REAL,
2992  ID_SIMPLE_ARRAYED,
2993  ID_SIMPLE_HIERARCHICAL_BRANCH,
2994  ID_SIMPLE_HIERARCHICAL,
2995  ID_SIMPLE,
2996  ID_SPECPARAM,
2997  ID_SYSTEM_FUNCTION,
2998  ID_SYSTEM_TASK,
2999  ID_TASK,
3000  ID_TOPMODULE,
3005  ID_VARIABLE,
3007 
3009 typedef enum ast_id_range_or_index_e{
3015 
3022  char * identifier;
3023  unsigned int from_line;
3025  ast_identifier next;
3027  union{
3029  ast_range * range;
3030  ast_expression * index;
3031  };
3032 };
3033 
3045 char * ast_identifier_tostring(ast_identifier id);
3046 
3050 int ast_identifier_cmp(
3051  ast_identifier a,
3052  ast_identifier b
3053 );
3054 
3063 ast_identifier ast_new_identifier(
3064  char * identifier,
3065  unsigned int from_line
3066 );
3067 
3068 
3073 ast_identifier ast_new_system_identifier(
3074  char * identifier,
3075  unsigned int from_line
3076 );
3077 
3085 ast_identifier ast_append_identifier(
3086  ast_identifier parent,
3087  ast_identifier child
3088 );
3089 
3097  ast_identifier id,
3098  ast_range * range
3099 );
3100 
3108  ast_identifier id,
3109  ast_expression * index
3110 );
3111 
3114 // -------------------------------- Configuration Source ---------------------
3115 
3123 typedef struct ast_config_rule_statement_t{
3126  ast_boolean is_default;
3127  ast_boolean multiple_clauses; //<! IFF TRUE use clauses, else clause_2
3128  ast_identifier clause_1;
3129  union{
3130  ast_identifier clause_2;
3132  };
3134 
3135 
3141  ast_boolean is_default,
3142  ast_identifier clause_1,
3143  ast_identifier clause_2
3144 );
3145 
3147 typedef struct ast_config_declaration_t{
3149  ast_identifier identifier;
3150  ast_identifier design_statement;
3151  ast_list * rule_statements;
3153 
3158  ast_identifier identifier,
3159  ast_identifier design_statement,
3160  ast_list * rule_statements
3161 );
3162 
3165 // -------------------------------- Library Source Text ----------------------
3166 
3177 typedef struct ast_library_declaration_t{
3179  ast_identifier identifier;
3180  ast_list * file_paths;
3181  ast_list * incdirs;
3183 
3188  ast_identifier identifier,
3189  ast_list * file_paths,
3190  ast_list * incdirs
3191 );
3192 
3194 typedef enum ast_library_item_type_e{
3195  LIB_LIBRARY,
3196  LIB_INCLUDE,
3197  LIB_CONFIG
3199 
3201 typedef struct ast_library_descriptions_t{
3203  ast_library_item_type type;
3204  union{
3205  ast_library_declaration * library;
3206  ast_config_declaration * config;
3207  ast_string include;
3208  };
3210 
3214 );
3215 
3218 // -------------------------------- Compiler Directives ----------------------
3219 
3231 // -------------------------------- Grammar Top Level ------------------------
3232 
3242 typedef enum ast_source_item_type_e{
3247 
3249 typedef struct ast_source_item_t{
3252  union{
3253  ast_module_declaration * module;
3255  };
3256 } ast_source_item;
3257 
3265 
3272 typedef struct verilog_source_tree_t{
3273  ast_list * modules;
3274  ast_list * primitives;
3275  ast_list * configs;
3276  ast_list * libraries;
3278 
3279 
3282 
3283 
3290 
3298  verilog_source_tree * tofree
3299 );
3300 
3301 // --------------------------------------------------------------
3302 
3307 typedef enum ast_node_type_e
3308 {
3311  IDENTIFIER, //<! An identifier.
3312  MODULE, //<! A design module.
3314 } ast_node_type;
3315 
3321 {
3322  ast_node * parent;
3323  unsigned int child_count;
3324  ast_node * children;
3325  ast_node_attributes * attributes;
3327 };
3328 
3333 ast_node * ast_node_new();
3334 
3335 
3339 #endif
Pass Transistor.
Definition: verilog_ast.h:2214
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.
Definition: verilog_ast.c:492
char * ast_expression_tostring(ast_expression *exp)
A utility function for converting an ast expression tree back into a string representation.
Definition: verilog_ast.c:262
Use when not explicitly specified.
Definition: verilog_ast.h:2343
A collection of n-input gates with the same type and delay properties.
Definition: verilog_ast.h:1987
ast_event_control_type
Whether an event control struct contains a list of triggers, no triggers.
Definition: verilog_ast.h:1106
ast_number_representation
How is the number represented?
Definition: verilog_ast.h:156
ast_gatetype_n_input
Describes the logical function performed by a builtin n-input gate.
Definition: verilog_ast.h:1977
Definition: verilog_ast.h:1296
Input port.
Definition: verilog_ast.h:110
Fully describes a config rule statemnet. See Annex 1.2.
Definition: verilog_ast.h:3124
Procedural, blocking assignment.
Definition: verilog_ast.h:1294
Describes the declaration of a user defined primitive (UDP)
Definition: verilog_ast.h:1626
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:380
ast_list * continuous_assignments
ast_single_assignment
Definition: verilog_ast.h:2895
ast_expression * condition
Condition on which the loop runs.
Definition: verilog_ast.h:872
ast_number_representation representation
How is it expressed?
Definition: verilog_ast.h:169
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:976
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1322
ast_list * initial_blocks
ast_statement_block
Definition: verilog_ast.h:2901
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1603
ast_parameter_type
Data value types that a module parameter can take on.
Definition: verilog_ast.h:2545
ast_range * range
Width of the reg.
Definition: verilog_ast.h:2472
describes a single call to a function, constant function, or system fucntion.
Definition: verilog_ast.h:379
ast_parameter_declarations * parameters
When type==BLOCK_ITEM_PARAM.
Definition: verilog_ast.h:2622
Describes a single port for a user defined primitive.
Definition: verilog_ast.h:1574
ast_identifier identifier
Net or variable identifier.
Definition: verilog_ast.h:444
ast_list * instances
list of ast_udp_instance
Definition: verilog_ast.h:1648
ast_boolean reg
Is a register or wire?
Definition: verilog_ast.h:1582
For "Integer" typed numbers".
Definition: verilog_ast.h:158
Top level container for parsed source code.
Definition: verilog_ast.h:3272
ast_udp_sequential_entry * ast_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.
Definition: verilog_ast.c:1555
ast_identifier_type type
What construct does it identify?
Definition: verilog_ast.h:3021
ast_identifier attr_name
Name of the attribute.
Definition: verilog_ast.h:215
ast_statement_block * ast_extract_statement_block(ast_statement_type type, ast_statement *body)
Takes a body statement (type = STM_BLK) and splits it into it&#39;s event trigger and statements...
Definition: verilog_ast.c:2410
Describes the declaration of a block item.
Definition: verilog_ast.h:2615
ast_charge_strength
Describes (coloquially?!) the charge strength on a driver.
Definition: verilog_ast.h:2339
Storage type for an entire expression / subexpression tree.
Definition: verilog_ast.h:554
ast_boolean is_signed
Does it represent a signed value?
Definition: verilog_ast.h:2709
ast_drive_strength * drive_strength
Drive strength of the assignment.
Definition: verilog_ast.h:1306
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2825
ast_hybrid_assignment_type type
Type of hybrid assignment.
Definition: verilog_ast.h:1360
Blocking, non-blocking, continuous.
Definition: verilog_ast.h:1424
divide
Definition: verilog_ast.h:47
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:3202
Describes the type of event triggers.
Definition: verilog_ast.h:1114
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2228
ast_identifier identifier
The task name.
Definition: verilog_ast.h:2766
ast_boolean is_default
This is the default item.
Definition: verilog_ast.h:971
ast_list * sequence
Used for CSV lists of events.
Definition: verilog_ast.h:1100
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2284
greater than or equal to
Definition: verilog_ast.h:50
ast_list * event_declarations
ast_var_declaration
Definition: verilog_ast.h:2896
char * identifier
The identifier value.
Definition: verilog_ast.h:3022
ast_number_base base
Hex, octal, binary, decimal.
Definition: verilog_ast.h:168
ast_list * port_names
The names of the ports.
Definition: verilog_ast.h:2394
ast_boolean automatic
Is automatic?
Definition: verilog_ast.h:2680
ast_list * specparams
ast_parameter_declaration
Definition: verilog_ast.h:2913
ast_list * ports
Arguments to the task.
Definition: verilog_ast.h:2767
ast_boolean is_signed
Do they represent signed values?
Definition: verilog_ast.h:2593
Stores "meta" information and other tagging stuff about nodes.
Definition: verilog_ast.h:131
Parameters.
Definition: verilog_ast.h:2610
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1849
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1803
ast_task_port_type type
Data type (if any)
Definition: verilog_ast.h:2711
ast_udp_declaration * udp
IFF type == SOURCE_UDP.
Definition: verilog_ast.h:3254
ast_disable_statement * ast_new_disable_statement(ast_identifier id)
Creates and returns a pointer to a new disable statement.
Definition: verilog_ast.c:1349
Contains the identifier from a disable statement.
Definition: verilog_ast.h:1234
ast_range * range
Width of the net.
Definition: verilog_ast.h:2460
ast_lvalue_type
Identifies the kind of LValue the ast_lvalue structure holds.
Definition: verilog_ast.h:320
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1575
Describes a single UDP body sequentially or combinatorially.
Definition: verilog_ast.h:1594
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2271
ast_enable_gatetype
Describes a variety of enable gate type.
Definition: verilog_ast.h:2012
ast_list * delay_value
path_delay_value
Definition: verilog_ast.h:744
ast_node * children
Linked list of children.
Definition: verilog_ast.h:3324
used when no type keywork is used in the declaration.
Definition: verilog_ast.h:2550
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1761
ast_primary * ast_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 valu...
Definition: verilog_ast.c:130
ast_switch_gate * ast_new_switch_gate_d3(ast_switchtype type, ast_delay3 *delay)
Instances a new switch type with a delay3.
Definition: verilog_ast.c:1673
ast_block_item_declaration * block_item
Standard body statements.
Definition: verilog_ast.h:2737
ast_net_type net_type
Wire/reg etc.
Definition: verilog_ast.h:2389
Describes the pull strength and direction of a primitive.
Definition: verilog_ast.h:1947
char * ast_operator_tostring(ast_operator op)
Returns the string representation of an operator;.
Definition: verilog_ast.c:217
Describes a single module item, its type and data structure.
Definition: verilog_ast.h:2824
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1588
ast_list * identifiers
IFF direction != input.
Definition: verilog_ast.h:1579
Describes a single combinatorial entry in the UDP ast tree.
Definition: verilog_ast.h:1602
ast_expression * state_expression
Used iff type == state_dependent_*.
Definition: verilog_ast.h:751
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:265
ast_expression * ast_new_index_expression(ast_expression *left)
Creates a new range index expression with the supplied operands.
Definition: verilog_ast.c:415
ast_node * parent
Parent node in the tree.
Definition: verilog_ast.h:3322
ast_task_port_type
Return value type for a task.
Definition: verilog_ast.h:2649
ast_expression * expression
The value it takes on.
Definition: verilog_ast.h:1305
Stores the base, value and width (in bits) of a number.
Definition: verilog_ast.h:165
ast_statement_type
Describes the kind of statement in a statement struct.
Definition: verilog_ast.h:1422
ast_module_declaration * declaration
The module instanced.
Definition: verilog_ast.h:1807
ast_concatenation_type
Describes the type of concatenation being dealt with.
Definition: verilog_ast.h:254
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:968
ast_number * ast_new_number(ast_number_base base, ast_number_representation representation, char *digits)
Creates a new number representation object.
Definition: verilog_ast.c:2833
if/if-else/if-elseif-else
Definition: verilog_ast.h:1426
ast_identifier ast_new_system_identifier(char *identifier, unsigned int from_line)
Creates and returns a new node representing an identifier.
Definition: verilog_ast.c:2726
Holds either a range or a type data item.
Definition: verilog_ast.h:2658
ast_node_attributes * attributes
Tool specific attributes.
Definition: verilog_ast.h:2892
Goes to a single expression.
Definition: verilog_ast.h:1087
ast_switchtype
describes the type of a single MOS switch.
Definition: verilog_ast.h:1878
Instantiation.
Definition: verilog_ast.h:2983
ast_node_attributes * next
Next one in a linked list.
Definition: verilog_ast.h:218
ast_lvalue_type type
The type of the L Value assignment.
Definition: verilog_ast.h:347
ast_module_item * ast_new_module_item(ast_node_attributes *attributes, ast_module_item_type type)
Creates and returns a new module item descriptor.
Definition: verilog_ast.c:2393
ast_number_base
Base value of a number representation.
Definition: verilog_ast.h:148
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2659
ast_expression * data_source
data_source_expression
Definition: verilog_ast.h:732
ast_range * range
Are these vectors of registers?
Definition: verilog_ast.h:2594
Identifies a wire/reg.
Definition: verilog_ast.h:324
Output port.
Definition: verilog_ast.h:111
ast_udp_instantiation * ast_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.
Definition: verilog_ast.c:1479
ast_assignment * ast_new_continuous_assignment(ast_list *assignments, ast_drive_strength *strength, ast_delay3 *delay)
Creates and returns a new continuous assignment object.
Definition: verilog_ast.c:1298
ast_list * udp_instantiations
ast_udp_instantiation
Definition: verilog_ast.h:2916
Fully describes a concatenation in terms of type and data.
Definition: verilog_ast.h:264
ast_boolean is_function
Is this a function_case_statement?
Definition: verilog_ast.h:981
ast_list * integer_declarations
ast_var_declaration
Definition: verilog_ast.h:2902
ast_assignment * ast_new_hybrid_lval_assignment(ast_hybrid_assignment_type type, ast_lvalue *lval)
Creates a new hybrid assignment of the specified type.
Definition: verilog_ast.c:1236
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2706
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:707
ast_case_item * ast_new_case_item(ast_list *conditions, ast_statement *body)
Create and return a new item in a cast statement.
Definition: verilog_ast.c:903
N input gates - AND,NAND,OR etc.
Definition: verilog_ast.h:2217
ast_list * module_instantiations
ast_module_instantiation
Definition: verilog_ast.h:2904
unsigned int width
Width of the number in bits.
Definition: verilog_ast.h:167
ast_parameter_declarations * ast_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
Definition: verilog_ast.c:1996
ast_path_declaration * ast_new_path_declaration(ast_path_declaration_type type)
Creates and returns a new path declaration type. Expects that the data be filled in manually;...
Definition: verilog_ast.c:631
ast_boolean local
Local parameter or global.
Definition: verilog_ast.h:2559
While, for, repeat.
Definition: verilog_ast.h:1429
Identifies a variable.
Definition: verilog_ast.h:325
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:556
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1970
ast_boolean is_reg
Is explicitly a "reg".
Definition: verilog_ast.h:2391
Negative edge.
Definition: verilog_ast.h:104
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2470
ast_delay_ctrl * ast_new_delay_ctrl_value(ast_delay_value *value)
creates and returns a new delay control statement.
Definition: verilog_ast.c:1120
ast_boolean automatic
Automatic iff TRUE.
Definition: verilog_ast.h:2765
ast_identifier identifier
Identifier value.
Definition: verilog_ast.h:336
For when the pre-processor hasn&#39;t run.
Definition: verilog_ast.h:3002
ast_expression * data_source
data_source_expression
Definition: verilog_ast.h:743
ast_list * always_blocks
ast_statement_block
Definition: verilog_ast.h:2894
ast_gate_type
Describes a kind of gate primitive.
Definition: verilog_ast.h:2211
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2107
N output gates - buffers & Inverters.
Definition: verilog_ast.h:2216
mod
Definition: verilog_ast.h:49
ast_block_reg_declaration * ast_new_block_reg_declaration(ast_boolean is_signed, ast_range *range, ast_list *identifiers)
Creates and returns a new block register declaration descriptor.
Definition: verilog_ast.c:2355
Has a range selector.
Definition: verilog_ast.h:3010
event, integer,real,time,realtime
Definition: verilog_ast.h:2611
Positive edge.
Definition: verilog_ast.h:103
Stores the type and value of an AST primary expression.
Definition: verilog_ast.h:465
ast_identifier identifier
What is the net called?
Definition: verilog_ast.h:2457
ast_single_assignment * ast_new_single_assignment(ast_lvalue *lval, ast_expression *expression)
Creates and returns a new continuous assignment.
Definition: verilog_ast.c:1199
An N-input gate instance. e.g. 3-to-1 NAND.
Definition: verilog_ast.h:2004
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.
Definition: verilog_ast.c:1081
ast_module_instance * ast_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...
Definition: verilog_ast.c:1640
Tri-state AND.
Definition: verilog_ast.h:2376
ast_range * range
Bus width.
Definition: verilog_ast.h:2393
ast_node_attributes * ast_new_attributes(ast_identifier name, ast_expression *value)
Creates and returns as a pointer a new attribute descriptor.
Definition: verilog_ast.c:27
Time value.
Definition: verilog_ast.h:2650
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1023
ast_udp_port * ast_new_udp_input_port(ast_list *identifiers, ast_node_attributes *attributes)
Creates a new UDP input port AST node.
Definition: verilog_ast.c:1412
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1365
Enable Gate.
Definition: verilog_ast.h:2215
A single enable gate.
Definition: verilog_ast.h:2037
ast_block_reg_declaration * reg
When type == BLOCK_ITEM_REG.
Definition: verilog_ast.h:2620
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2292
ast_statement_block * ast_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.
Definition: verilog_ast.c:1330
void ast_extend_concatenation(ast_concatenation *element, ast_expression *repeat, void *data)
Adds a new data element on to the front of a concatenation.
Definition: verilog_ast.c:618
Fully describes a single block of statements.
Definition: verilog_ast.h:1257
Bi-directional port.
Definition: verilog_ast.h:112
Describes a range or dimension.
Definition: verilog_ast.h:1507
Declaration.
Definition: verilog_ast.h:2982
ast_list * arguments
Linked list of arguments.
Definition: verilog_ast.h:384
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:829
Structure containing all information on an identifier.
Definition: verilog_ast.h:3019
ast_expression * repeat
NULL unless part of repeat statement.
Definition: verilog_ast.h:1151
ast_primary_value_type value_type
Definition: verilog_ast.h:469
ast_boolean is_system
Is this a system task?
Definition: verilog_ast.h:832
ast_delay_ctrl_type
Denotes whether a delay control expression is a single value or a range.
Definition: verilog_ast.h:1128
Node type that forms the tree.
Definition: verilog_ast.h:3320
Describes a single edge sensitive path declaration.
Definition: verilog_ast.h:726
ast_boolean constant
Constant function call?
Definition: verilog_ast.h:381
Describes an a list of instances of a particular kind of UDP.
Definition: verilog_ast.h:1646
unsigned int from_line
The line number of the file.
Definition: verilog_ast.h:3023
ast_list * ast_new_net_declaration(ast_type_declaration *type_dec)
Creates a new net declaration object.
Definition: verilog_ast.c:2084
ast_loop_type
Describes the different syntactic methods of looping.
Definition: verilog_ast.h:856
void verilog_free_source_tree(verilog_source_tree *tofree)
Releases a source tree object from memory.
Definition: verilog_ast.c:2914
ast_list * generate_items
IFF type == LOOP_GENERATE;.
Definition: verilog_ast.h:870
Use only when not specified!
Definition: verilog_ast.h:2382
Refers to a module definition.
Definition: verilog_ast.h:3244
Minimum typical maximum.
Definition: verilog_ast.h:529
int ast_line
Refers to a source code file line number.
Definition: verilog_ast.h:124
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1115
A unary op: "~bits" for example.
Definition: verilog_ast.h:525
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1988
ast_generate_block * ast_new_generate_block(ast_identifier identifier, ast_list *generate_items)
Creates and returns a new block of generate items.
Definition: verilog_ast.c:1601
ast_level_symbol
Describes a single logic level symbol.
Definition: verilog_ast.h:1543
ast_type_declaration * event_or_var
When type == BLOCK_ITEM_TYPE.
Definition: verilog_ast.h:2621
ast_port_direction direction
Input or output to the port.
Definition: verilog_ast.h:2707
ast_net_type
Describes the type of a net in Verilog.
Definition: verilog_ast.h:2372
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:866
ast_enable_gate_instance * ast_new_enable_gate_instance(ast_identifier name, ast_lvalue *output_terminal, ast_expression *enable_terminal, ast_expression *input_terminal)
A single Enable gate instance.
Definition: verilog_ast.c:1767
ast_source_item * ast_new_source_item(ast_source_item_type type)
Creates and returns a new source item representation.
Definition: verilog_ast.c:2658
ast_pull_strength * ast_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.
Definition: verilog_ast.c:1963
ast_boolean system
System function call?
Definition: verilog_ast.h:382
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1963
For numbers specified per digit.
Definition: verilog_ast.h:157
ast_boolean net_signed
Signed value?
Definition: verilog_ast.h:2390
ast_drive_strength * drive
Drive strength.
Definition: verilog_ast.h:2459
ast_operator polarity
polarity_operator
Definition: verilog_ast.h:730
A straight value.
Definition: verilog_ast.h:524
Module path concatenation.
Definition: verilog_ast.h:260
ast_case_statement_type
Records the three different types of case statement Verilog has.
Definition: verilog_ast.h:960
The "normal" expression.
Definition: verilog_ast.h:526
ast_list * items
sequence of items.
Definition: verilog_ast.h:268
ast_single_assignment * initial
Initial condition for for loops.
Definition: verilog_ast.h:873
ast_expression * attr_value
Value of the attribute.
Definition: verilog_ast.h:216
ast_list * time_declarations
ast_var_declaration
Definition: verilog_ast.h:2915
ast_source_item_type
Describes the type of a item in the list of source entries.
Definition: verilog_ast.h:3243
ast_declaration_type type
What sort of variable is this?
Definition: verilog_ast.h:2481
ast_edge edge
edge_identifier
Definition: verilog_ast.h:728
ast_udp_body * ast_new_udp_combinatoral_body(ast_list *combinatorial_entries)
Creates and returns a new combinatorial UDP body representation.
Definition: verilog_ast.c:1527
Definition: verilog_ast.h:2106
ast_switch_gate * ast_new_switch_gate_d2(ast_switchtype type, ast_delay2 *delay)
Instances a new switch type with a delay2.
Definition: verilog_ast.c:1688
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2038
logical shift right
Definition: verilog_ast.h:46
ast_n_input_gate_instances * ast_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.
Definition: verilog_ast.c:1870
ast_config_declaration * ast_new_config_declaration(ast_identifier identifier, ast_identifier design_statement, ast_list *rule_statements)
Creates and returns a new config declaration node.
Definition: verilog_ast.c:2782
ast_range_or_type * rot
Range or type.
Definition: verilog_ast.h:2683
ast_switches * ast_new_switches(ast_switch_gate *type, ast_list *switches)
creates and returns a new collection of AST switches.
Definition: verilog_ast.c:1951
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1450
Describes a set of assignments with the same drive strength and delay.
Definition: verilog_ast.h:1321
ast_udp_initial_statement * ast_new_udp_initial_statement(ast_identifier output_port, ast_number *initial_value)
Creates a new initial statement node.
Definition: verilog_ast.c:1498
ast_list * function_declarations
ast_task_declaration
Definition: verilog_ast.h:2897
ast_expression * index
Iff range_or_idx == ID_HAS_INDEX.
Definition: verilog_ast.h:3030
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1258
ast_pass_enable_switches * ast_new_pass_enable_switches(ast_pass_enable_switchtype type, ast_delay2 *delay, ast_list *switches)
Creates and returns a collection of pass enable switches.
Definition: verilog_ast.c:1850
ast_continuous_assignment * continuous
The continuous assignment.
Definition: verilog_ast.h:1368
ast_case_statement_type type
CASE, CASEX or CASEZ.
Definition: verilog_ast.h:980
Storage for the data describing an assignment L Value.
Definition: verilog_ast.h:334
ast_net_type type
What sort of net is this?
Definition: verilog_ast.h:2456
ast_edge_sensitive_full_path_declaration * ast_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.
Definition: verilog_ast.c:724
ast_list * generate_blocks
ast_generate_block
Definition: verilog_ast.h:2900
ast_declaration_type
Describes the datatype of the construct being declared.
Definition: verilog_ast.h:2422
ast_task_enable_statement * ast_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.
Definition: verilog_ast.c:751
No specified type.
Definition: verilog_ast.h:2654
ast_boolean is_signed
Is the returned value signed?
Definition: verilog_ast.h:2681
ast_primary_type primary_type
Definition: verilog_ast.h:468
Concatenation of variable identifiers.
Definition: verilog_ast.h:328
Bit range expression.
Definition: verilog_ast.h:527
Describes a single gate type along with it&#39;s delay properties.
Definition: verilog_ast.h:1890
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:467
Fully describes a single port declaration.
Definition: verilog_ast.h:2386
ast_concatenation * concatenation
Concatenation list.
Definition: verilog_ast.h:337
ast_assignment * ast_new_hybrid_assignment(ast_hybrid_assignment_type type, ast_single_assignment *assignment)
Creates a new hybrid assignment of the specified type.
Definition: verilog_ast.c:1216
Variable name concatenation (lvalue)
Definition: verilog_ast.h:259
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:3020
Instantiation.
Definition: verilog_ast.h:3004
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.
Definition: verilog_ast.c:43
ast_assignment_type type
Which element of the internal union to use.
Definition: verilog_ast.h:1366
Metal oxide Semiconductor.
Definition: verilog_ast.h:2213
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2086
ast_source_item_type type
Which member of the union to access.
Definition: verilog_ast.h:3251
ast_delay_value_type
Describes the union member of an ast_delay_value structure to be accessed.
Definition: verilog_ast.h:2262
ast_identifier input_terminal
specify_input_terminal_descriptor
Definition: verilog_ast.h:729
Describes a parallel edge sensitive path declaration.
Definition: verilog_ast.h:737
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:3148
Describes the pulse characteristics in signal transmission?
Definition: verilog_ast.h:1488
ast_list * specify_blocks
Not Supported.
Definition: verilog_ast.h:2912
ast_udp_port * ast_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.
Definition: verilog_ast.c:1387
ast_udp_body_type
Is the body of the UDP specified combinatorially or sequentially.
Definition: verilog_ast.h:1552
A collection of CMOS, MOS or PASS switches of the same type.
Definition: verilog_ast.h:2199
ast_concatenation * ast_new_empty_concatenation(ast_concatenation_type type)
Creates and returns a new empty concatenation of the specified type.
Definition: verilog_ast.c:599
ast_range_or_type * ast_new_range_or_type(ast_boolean is_range)
Creates and returns a new object storing either a range or a type.
Definition: verilog_ast.c:2259
ast_expression * aux
Optional auxiliary/predicate.
Definition: verilog_ast.h:561
ast_list * ranges
For multi-dimensional arrays.
Definition: verilog_ast.h:3028
ast_statement * statement
What should be executed.
Definition: verilog_ast.h:1017
Used when we don&#39;t know the type.
Definition: verilog_ast.h:3001
Describes the declaration of a set of registers within a block.
Definition: verilog_ast.h:2591
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2200
A single instance of a defined module.
Definition: verilog_ast.h:1828
ast_expression * ast_new_mintypmax_expression(ast_expression *min, ast_expression *typ, ast_expression *max)
Creates a new (min,typical,maximum) expression.
Definition: verilog_ast.c:514
ast_udp_combinatorial_entry * ast_new_udp_combinatoral_entry(ast_list *input_levels, ast_udp_next_state output_symbol)
Creates a new combinatorial entry for a UDP node.
Definition: verilog_ast.c:1540
ast_timing_control_statement_type
What sort of procedural timing control statement is this?
Definition: verilog_ast.h:1121
ast_expression * ast_new_string_expression(ast_string string)
Creates a new string expression.
Definition: verilog_ast.c:466
ast_udp_seqential_entry_prefix
Whether a sequential body entry starts with level or edge symbols.
Definition: verilog_ast.h:1559
ast_boolean is_port_declaration
True IFF an argument to the function.
Definition: verilog_ast.h:2735
ast_identifier output_terminal
specify_output_terminal_descriptor
Definition: verilog_ast.h:731
ast_primary * primary
Valid IFF type == PRIMARY_EXPRESSION.
Definition: verilog_ast.h:562
Describes a single gate with one input and several outputs.
Definition: verilog_ast.h:2099
ast_statement * ast_new_generate_item(ast_statement_type type, void *construct)
Creates and returns a new item which exists inside a generate statement.
Definition: verilog_ast.c:1587
ast_list * declarations
Internal variable declarations.
Definition: verilog_ast.h:2768
ast_statement * statements
The body of the task.
Definition: verilog_ast.h:2769
Net name concatenation (lvalue)
Definition: verilog_ast.h:258
Has an index selector.
Definition: verilog_ast.h:3012
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.
Definition: verilog_ast.c:2494
ast_statement * statement
What to execute after waiting.
Definition: verilog_ast.h:1083
ast_pull_gate_instance * ast_new_pull_gate_instance(ast_identifier name, ast_lvalue *output_terminal)
Describes a single pull gate instance.
Definition: verilog_ast.c:1720
Describes a single wait statement.
Definition: verilog_ast.h:1080
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:345
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2734
ast_loop_statement * ast_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.
Definition: verilog_ast.c:801
ast_config_rule_statement * ast_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.
Definition: verilog_ast.c:2767
Describes a single config declaration in it&#39;s entirety.
Definition: verilog_ast.h:3147
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2440
ast_range * range
Valid IFF type==PARAM_GENERIC.
Definition: verilog_ast.h:2560
ast_identifier clause_2
The second grammar clause.
Definition: verilog_ast.h:3130
ast_boolean function_or_block
IFF true statements is list of function_item_declaration else list of block_item_declaration.
Definition: verilog_ast.h:2682
ast_library_declaration * ast_new_library_declaration(ast_identifier identifier, ast_list *file_paths, ast_list *incdirs)
Creates a new library declaration node.
Definition: verilog_ast.c:2800
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.
Definition: verilog_ast.c:438
Decribes a single port connection in a module instance.
Definition: verilog_ast.h:1848
ast_pass_enable_switch * ast_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.
Definition: verilog_ast.c:1828
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.
Definition: verilog_ast.c:1276
Tri-state reg wire.
Definition: verilog_ast.h:2378
ast_range * range
The range strucure.
Definition: verilog_ast.h:2662
Initial blocks.
Definition: verilog_ast.h:1432
Describes a collection of pass enable switches withe the same type and delay characteristics.
Definition: verilog_ast.h:2085
ast_if_else * ast_new_if_else(ast_conditional_statement *if_condition, ast_statement *else_condition)
Creates a new if-then-else-then statement.
Definition: verilog_ast.c:989
ast_range * ast_new_range(ast_expression *upper, ast_expression *lower)
Creates and returns a new range or dimension representation node.
Definition: verilog_ast.c:2241
ast_list * conditions
A list of condtions, one must be met.
Definition: verilog_ast.h:969
Refers to &#39;?&#39;.
Definition: verilog_ast.h:1548
Describes a single statement, and can contain sequential statement blocks.
Definition: verilog_ast.h:1449
Describes the declaration of a path.
Definition: verilog_ast.h:716
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...
Definition: verilog_ast.c:581
ast_loop_statement * ast_new_forever_loop_statement(ast_statement *inner_statement)
Creates and returns a new forever loop statement.
Definition: verilog_ast.c:774
ast_list * input_terminal
list_of_path_inputs
Definition: verilog_ast.h:740
ast_identifier module_identifer
The module being instanced.
Definition: verilog_ast.h:1806
ast_edge_sensitive_parallel_path_declaration * ast_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.
Definition: verilog_ast.c:696
Local or global.
Definition: verilog_ast.h:2801
ast_boolean constant
True iff constant_expression.
Definition: verilog_ast.h:564
Fully describes the pull&#39;s of a net going up and down.
Definition: verilog_ast.h:1934
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2592
Describes a procedural assignment, can be blocking or nonblocking.
Definition: verilog_ast.h:1329
ast_expression * expression
How long to wait for.
Definition: verilog_ast.h:1082
Fully describes the declaration of elements one might find inside a module.
Definition: verilog_ast.h:2439
ast_identifier clause_1
The first grammar clause.
Definition: verilog_ast.h:3128
ast_list * expressions
Arguments to the task.
Definition: verilog_ast.h:830
ast_assignment_type
Describes the type (and implicitly, the location) of an assignment.
Definition: verilog_ast.h:1292
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2005
Pull up resistor.
Definition: verilog_ast.h:2219
Tri-state OR.
Definition: verilog_ast.h:2377
ast_expression_type type
What sort of expression is this?
Definition: verilog_ast.h:557
ast_range * range
Iff range_or_idx == ID_HAS_RANGE.
Definition: verilog_ast.h:3029
ast_identifier ast_append_identifier(ast_identifier parent, ast_identifier child)
Used to construct linked lists of hierarchical identifiers.
Definition: verilog_ast.c:2738
A single pass transistor instance.
Definition: verilog_ast.h:1969
on posedge
Definition: verilog_ast.h:1088
ast_primary_value value
Definition: verilog_ast.h:470
ast_expression * repeat
The number of repetitions. Normally 1.
Definition: verilog_ast.h:267
ast_delay_ctrl * ast_new_delay_ctrl_mintypmax(ast_expression *mintypmax)
creates and returns a new delay control statement.
Definition: verilog_ast.c:1134
ast_identifier_type
Describes the type of contruct that the identifier corresponds to.
Definition: verilog_ast.h:2953
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:3125
ast_udp_instance * ast_new_udp_instance(ast_identifier identifier, ast_range *range, ast_lvalue *output, ast_list *inputs)
Creates a new instance of a UDP.
Definition: verilog_ast.c:1457
For "real" typed numbers.
Definition: verilog_ast.h:159
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2455
Real valued number.
Definition: verilog_ast.h:2651
Describes a single instance of a UDP.
Definition: verilog_ast.h:1637
ast_timing_control_statement * ast_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.
Definition: verilog_ast.c:1150
Super structure for different library construct types.
Definition: verilog_ast.h:3201
The node has no stored data type.
Definition: verilog_ast.h:3313
ast_expression * ast_new_expression_primary(ast_primary *p)
Creates and returns a new expression primary.
Definition: verilog_ast.c:197
ast_case_statement * ast_new_case_statement(ast_expression *expression, ast_list *cases, ast_case_statement_type type)
Creates and returns a new case statement.
Definition: verilog_ast.c:922
Don&#39;t care.
Definition: verilog_ast.h:1569
ast_primary_value_type
The kind of production the expression primary holds.
Definition: verilog_ast.h:430
ast_edge
Describes a rising or falling edge, or where none is specified.
Definition: verilog_ast.h:101
ast_delay3 * delay
Delay characteristics.
Definition: verilog_ast.h:2458
Tri-state.
Definition: verilog_ast.h:2375
Logic 0 supply rail.
Definition: verilog_ast.h:2373
ast_list * gate_instantiations
ast_gate_instantiation
Definition: verilog_ast.h:2898
char * ast_identifier_tostring(ast_identifier id)
Simply returns the fully qualified representation of an identifier as a string.
Definition: verilog_ast.c:2679
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1595
Just a normal string. No operations.
Definition: verilog_ast.h:536
ast_expression * right
RHS of operation.
Definition: verilog_ast.h:560
ast_list * module_ports
ast_port_declaration
Definition: verilog_ast.h:2906
ast_lvalue * lval
The thing being assigned to.
Definition: verilog_ast.h:1304
ast_simple_parallel_path_declaration * ast_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.
Definition: verilog_ast.c:646
ast_list * cases
Statements, conditionally run.
Definition: verilog_ast.h:978
ast_list * ast_new_var_declaration(ast_type_declaration *type_dec)
Creates a new variable declaration object.
Definition: verilog_ast.c:2150
ast_type_declaration * ast_new_type_declaration(ast_declaration_type type)
Creates and returns a node to represent the declaration of a new module item construct.
Definition: verilog_ast.c:2058
int ast_identifier_cmp(ast_identifier a, ast_identifier b)
Acts like strcmp but works on ast identifiers.
Definition: verilog_ast.c:2698
ast_loop_statement * ast_new_repeat_loop_statement(ast_statement *inner_statement, ast_expression *continue_condition)
Creates and returns a repeat loop statement.
Definition: verilog_ast.c:880
ast_block_item_declaration_type
Describes what sort of block item is being declared.
Definition: verilog_ast.h:2608
ast_identifier identifier
Function name.
Definition: verilog_ast.h:2684
ast_identifier identifier
What is the reg called?
Definition: verilog_ast.h:2471
ast_node * ast_node_new()
Creates a new empty ast_node and returns it.
Describes a single event expression.
Definition: verilog_ast.h:1096
ast_udp_next_state
Describes the possible output values for a UDP element.
Definition: verilog_ast.h:1565
ast_boolean resolved
Is the name resolved to a declaration?
Definition: verilog_ast.h:1804
ast_edge edge
edge_identifier
Definition: verilog_ast.h:739
ast_primary_type
Describes the kind of expression primary being represented, and hence the sort of expression we are d...
Definition: verilog_ast.h:421
ast_expression * expression
The thing to be evaluated.
Definition: verilog_ast.h:977
ast_delay_value * ast_new_delay_value(ast_delay_value_type type, void *data)
Create a new delay value.
Definition: verilog_ast.c:2173
ast_delay2 * delay2
IFF type == TRAN or RTRAN.
Definition: verilog_ast.h:1895
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2616
Generateor variable.
Definition: verilog_ast.h:326
ast_library_item_type
Describes a library item.
Definition: verilog_ast.h:3194
Fully describes the declaration of a verilog function.
Definition: verilog_ast.h:2678
unsigned int child_count
Number of children the node has.
Definition: verilog_ast.h:3323
ast_string string
The string constant. Valid IFF type == STRING_EXPRESSION.
Definition: verilog_ast.h:565
Describes a function item declaration, which is either a block item or port declaration.
Definition: verilog_ast.h:2733
Real valued time.
Definition: verilog_ast.h:2652
ast_id_range_or_index range_or_idx
Is it indexed or ranged?
Definition: verilog_ast.h:3026
ast_list * output_terminal
list_of_path_outputs
Definition: verilog_ast.h:742
Stores the type and characteristics of one or more parameter declarations.
Definition: verilog_ast.h:2555
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1935
ast_module_instantiation * ast_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.
Definition: verilog_ast.c:1619
Describes a single exeuctable item in a case statement.
Definition: verilog_ast.h:967
Arithmetic shift left.
Definition: verilog_ast.h:43
ast_list * realtime_declarations
ast_var_declaration
Definition: verilog_ast.h:2910
ast_task_port * ast_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)
Definition: verilog_ast.c:2309
ast_procedural_assignment * procedural
The procedural assignment.
Definition: verilog_ast.h:1369
ast_single_assignment * assignment
The assignment being made.
Definition: verilog_ast.h:1357
ast_statement * inner_statement
Loop body.
Definition: verilog_ast.h:869
char * ast_file
Refers to a source code file name.
Definition: verilog_ast.h:126
Container struct for the linked list data structure.
Definition: verilog_ast_common.h:41
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2891
ast_cmos_switch_instance * ast_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.
Definition: verilog_ast.c:1805
ast_expression * left
LHS of operation.
Definition: verilog_ast.h:559
A design attribute. ast_node_attributes_t.
Definition: verilog_ast.h:3309
port_declaration
Definition: verilog_ast.h:2799
ast_metadata meta
Metadata.
Definition: verilog_ast.h:2479
ast_conditional_statement * ast_new_conditional_statement(ast_statement *statement, ast_expression *condition)
Creates and returns a new conditional statement.
Definition: verilog_ast.c:963
ast_delay2 * ast_new_delay2(ast_delay_value *min, ast_delay_value *max)
Create a new delay2 instance.
Definition: verilog_ast.c:2207
void ast_identifier_set_index(ast_identifier id, ast_expression *index)
Used to set the index field of an identifier.
Definition: verilog_ast.c:2755
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1303
verilog_source_tree * verilog_new_source_tree()
Creates and returns a new, empty source tree.
Definition: verilog_ast.c:2898
A single MOS switch (transistor) instance.
Definition: verilog_ast.h:2046
ast_statement * statement
What to execute after the control.
Definition: verilog_ast.h:1152
Complementary metal oxide semiconductor.
Definition: verilog_ast.h:2212
Concatenation of net identifiers.
Definition: verilog_ast.h:327
Node data describing an attribute.
Definition: verilog_ast.h:212
ast_udp_body * ast_new_udp_sequential_body(ast_udp_initial_statement *initial_statement, ast_list *sequential_entries)
Creates and returns a new sequential UDP body representation.
Definition: verilog_ast.c:1512
Fully describes a task enable statement.
Definition: verilog_ast.h:828
ast_task_declaration * ast_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.
Definition: verilog_ast.c:2333
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2056
ast_n_output_gate_instances * ast_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.
Definition: verilog_ast.c:1930
ast_port_declaration * ast_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.
Definition: verilog_ast.c:2025
ast_boolean is_system
Is this a system identifier?
Definition: verilog_ast.h:3024
Question mark.
Definition: verilog_ast.h:1570
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1948
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1330
ast_task_port_type type
The type structure (an enum)
Definition: verilog_ast.h:2663
access continuous_assignment
Definition: verilog_ast.h:2805
ast_id_range_or_index
Used to tell if an identifier has a bit vector or index attatched to it.
Definition: verilog_ast.h:3009
ast_primary * ast_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 valu...
Definition: verilog_ast.c:178
ast_primary * ast_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...
Definition: verilog_ast.c:163
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2066
Contains Declarations of value-independent data structures like linked lists which are used in the as...
ast_primitive_pull_strength * ast_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.
Definition: verilog_ast.c:1703
ast_boolean
Stores the values of booleans.
Definition: verilog_ast.h:94
encodes a single assignment.
Definition: verilog_ast.h:1302
ast_udp_init_val
Describes the initial value of a UDP output.
Definition: verilog_ast.h:1536
ast_list * identifiers
The list of port names.
Definition: verilog_ast.h:2712
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1829
verilog_source_tree * yy_verilog_source_tree
This is where we put all of the parsed constructs.
Definition: verilog_ast.c:2891
ast_delay3 * ast_new_delay3(ast_delay_value *min, ast_delay_value *avg, ast_delay_value *max)
Create a new delay3 instance.
Definition: verilog_ast.c:2189
ast_primary * ast_new_primary_function_call(ast_function_call *call)
Creates a new AST primary wrapper around a function call.
Definition: verilog_ast.c:145
char * ast_primary_tostring(ast_primary *p)
A utility function for converting an ast expression primaries back into a string representation.
Definition: verilog_ast.c:96
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2387
ast_list * item_declarations
Internal variable declarations.
Definition: verilog_ast.h:2685
Reg declaration.
Definition: verilog_ast.h:2609
Simple wrapper and placeholder for generate associated meta-data.
Definition: verilog_ast.h:1760
ast_list * delay_value
path_delay_value
Definition: verilog_ast.h:733
Contains a source item and it&#39;s type.
Definition: verilog_ast.h:3249
ast_list * local_parameters
ast_parameter_declaration
Definition: verilog_ast.h:2903
ast_event_expression_type
Definition: verilog_ast.h:1086
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2021
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:3178
ast_identifier next
Represents a hierarchical id.
Definition: verilog_ast.h:3025
Describes a single procedural timing control statement.
Definition: verilog_ast.h:1144
ast_wait_statement * ast_new_wait_statement(ast_expression *wait_for, ast_statement *statement)
Creates and returns a new wait statement.
Definition: verilog_ast.c:1029
Describes the instantiation of one or more modules of the same type with the same parameters...
Definition: verilog_ast.h:1802
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2679
ast_list * clauses
List of ast_identifier.
Definition: verilog_ast.h:3131
A collection of enable gates with the same type and delay properties.
Definition: verilog_ast.h:2020
ast_concatenation * concatenation
Concatenation of expressions.
Definition: verilog_ast.h:445
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.
Definition: verilog_ast.c:1013
ast_pull_direction
Describes pull direction.
Definition: verilog_ast.h:1927
char * ast_number_tostring(ast_number *n)
A utility function for converting an ast number into a string.
Definition: verilog_ast.c:2852
ast_node_type
Enum type describing the data value that an AST node holds.
Definition: verilog_ast.h:3307
ast_operator operation
What are we doing?
Definition: verilog_ast.h:563
ast_node_attributes * attributes
Additional expression attributes.
Definition: verilog_ast.h:558
Wire.
Definition: verilog_ast.h:2379
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:749
Fully describes the instantiation of one or more gate level primitives.
Definition: verilog_ast.h:2227
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1627
ast_node_type type
Datatype of the value stored in the node.
Definition: verilog_ast.h:3326
ast_statement * body
What to execute if the condition is met.
Definition: verilog_ast.h:970
ast_path_declaration_type
Describes the type of path being declared.
Definition: verilog_ast.h:693
Describes the declaration of a path.
Definition: verilog_ast.h:706
Procedural, non-blocking assignment.
Definition: verilog_ast.h:1295
Describes a 3 point delay distribution.
Definition: verilog_ast.h:2283
For when we don&#39;t know the type when instancing.
Definition: verilog_ast.h:2431
pow
Definition: verilog_ast.h:48
ast_expression * ast_new_range_expression(ast_expression *left, ast_expression *right)
Creates a new range expression with the supplied operands.
Definition: verilog_ast.c:393
ast_enable_gate_instances * ast_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.
Definition: verilog_ast.c:1889
System, user.
Definition: verilog_ast.h:1435
ast_list * real_declarations
ast_var_declaration
Definition: verilog_ast.h:2909
Conditional expression.
Definition: verilog_ast.h:530
Describes a single net declaration.
Definition: verilog_ast.h:2454
Pull down resistor.
Definition: verilog_ast.h:2220
Describes a single if-then-do statement.
Definition: verilog_ast.h:1015
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:717
Describes a 2 point delay distribution.
Definition: verilog_ast.h:2291
ast_lvalue * ast_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 eith...
Definition: verilog_ast.c:79
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1638
A set of expressions concatenated.
Definition: verilog_ast.h:256
Declaration.
Definition: verilog_ast.h:3003
ast_port_direction direction
Input / output / inout etc.
Definition: verilog_ast.h:2388
ast_lvalue * lval
lvalue being assigned / deassigned.
Definition: verilog_ast.h:1358
ast_list * parameter_overrides
ast_single_assignment
Definition: verilog_ast.h:2908
ast_range * range
Bit or item range for arrays.
Definition: verilog_ast.h:2710
ast_gate_instantiation * ast_new_gate_instantiation(ast_gate_type type)
Creates and returns a new gate instantiation descriptor.
Definition: verilog_ast.c:1981
ast_n_output_gatetype
Describes the type of an n_output gate.
Definition: verilog_ast.h:2093
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:738
ast_udp_initial_statement * initial
IFF body_type = sequential.
Definition: verilog_ast.h:1632
ast_lvalue * ast_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 ...
Definition: verilog_ast.c:60
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1235
ast_list * conditional_statements
Ordered list of if-elseifs.
Definition: verilog_ast.h:1024
ast_identifier ast_new_identifier(char *identifier, unsigned int from_line)
Creates and returns a new node representing an identifier.
Definition: verilog_ast.c:2710
ast_list * ast_new_reg_declaration(ast_type_declaration *type_dec)
Creates a new reg declaration object.
Definition: verilog_ast.c:2121
ast_timing_control_statement * ast_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.
Definition: verilog_ast.c:1174
Covers event_expression COMMA event_expression.
Definition: verilog_ast.h:1090
ast_module_item_type
Describes the type of data structure representing a module item.
Definition: verilog_ast.h:2798
ast_module_declaration * module
IFF type == SOURCE_MODULE.
Definition: verilog_ast.h:3253
always @ blocks
Definition: verilog_ast.h:1431
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1610
Pass transistor enable gate.
Definition: verilog_ast.h:2218
Describes a library declaration of file and include paths.
Definition: verilog_ast.h:3177
Top level descriptor for an assignment.
Definition: verilog_ast.h:1364
ast_task_port * port_declaration
IFF is_port_declaration == AST_TRUE.
Definition: verilog_ast.h:2738
ast_mos_switch_instance * ast_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.
Definition: verilog_ast.c:1786
logical shift left
Definition: verilog_ast.h:45
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1647
ast_function_item_declaration * ast_new_function_item_declaration()
Creates and returns a new function item declaration.
Definition: verilog_ast.c:2301
ast_port_connection * ast_new_named_port_connection(ast_identifier port_name, ast_expression *expression)
Creates and returns a new port connection representation.
Definition: verilog_ast.c:1658
ast_list * assignments
A list of ast_single_assignment.
Definition: verilog_ast.h:1323
ast_boolean is_variable
Variable or net?
Definition: verilog_ast.h:2392
ast_operator polarity
polarity_operator
Definition: verilog_ast.h:741
void ast_identifier_set_range(ast_identifier id, ast_range *range)
Used to set the range field of an identifier.
Definition: verilog_ast.c:2747
Describes the initial statement of a sequential udp body.
Definition: verilog_ast.h:1587
The expression primary can produce several different sub-expressions:
Definition: verilog_ast.h:441
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:214
Logic 1 supply rail.
Definition: verilog_ast.h:2374
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:3250
ast_delay3 * delay
Signal propagation delay.
Definition: verilog_ast.h:1307
?
Definition: verilog_ast.h:2380
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1135
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.
Definition: verilog_ast.c:1362
Describes a simple set of declarations of a particular type.
Definition: verilog_ast.h:2478
ast_simple_full_path_declaration * ast_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.
Definition: verilog_ast.c:671
Has neither a range or index selector.
Definition: verilog_ast.h:3013
ast_line line
The line number the construct came from.
Definition: verilog_ast.h:132
Creates and returns a new task declaration statement.
Definition: verilog_ast.h:2763
Struct which holds the type and data of a path declaration.
Definition: verilog_ast.h:748
ast_statement * default_item
Default IFF no item matches.
Definition: verilog_ast.h:979
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2764
ast_single_assignment * modify
Modification assignment for for loop.
Definition: verilog_ast.h:874
ast_list * edges
iff entry_prefix == PREFIX_EDGES
Definition: verilog_ast.h:1613
ast_list * levels
iff entry_prefix == PREFIX_LEVELS
Definition: verilog_ast.h:1614
describes a sequential entry in a udp body.
Definition: verilog_ast.h:1609
Integer type.
Definition: verilog_ast.h:2653
ast_loop_statement * ast_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.
Definition: verilog_ast.c:831
Constant expressions.
Definition: verilog_ast.h:257
ast_number * number
A single constant number.
Definition: verilog_ast.h:443
?
Definition: verilog_ast.h:2381
Describes a single reg declaration.
Definition: verilog_ast.h:2469
ast_boolean signed_values
Valid IFF type==PARAM_GENERIC.
Definition: verilog_ast.h:2558
ast_pulse_control_specparam * ast_new_pulse_control_specparam(ast_expression *reject_limit, ast_expression *error_limit)
Creates and returns a new pulse control data structure.
Definition: verilog_ast.c:2224
ast_identifier identifier
The variable identifier.
Definition: verilog_ast.h:2480
ast_n_input_gate_instance * ast_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.
Definition: verilog_ast.c:1751
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.
Definition: verilog_ast.c:2375
ast_function_call * function_call
Call to a function.
Definition: verilog_ast.h:446
Not edge triggered.
Definition: verilog_ast.h:105
ast_list * genvar_declarations
ast_var_declaration
Definition: verilog_ast.h:2899
ast_expression * value
Default assigned value.
Definition: verilog_ast.h:2464
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:727
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.
Definition: verilog_ast.c:1255
ast_statement * else_condition
Execute iff no conditonals are met.
Definition: verilog_ast.h:1025
ast_library_descriptions * ast_new_library_description(ast_library_item_type type)
Creates and returns a new library description object.
Definition: verilog_ast.c:2816
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1489
ast_lvalue_data data
The identifier or concattenation being assigned.
Definition: verilog_ast.h:346
ast_statement * statements
Executable statements.
Definition: verilog_ast.h:2686
ast_list * module_parameters
ast_parameter_declaration
Definition: verilog_ast.h:2905
Describes the top level of a case statement in terms of its items.
Definition: verilog_ast.h:975
ast_macro_use macro
A MACRO expansion.
Definition: verilog_ast.h:448
on negedge
Definition: verilog_ast.h:1089
Bit index expression.
Definition: verilog_ast.h:528
ast_hybrid_assignment_type
Describes the different types of procedural continuous assignments.
Definition: verilog_ast.h:1337
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2047
Continuous (combinatorial) assignment.
Definition: verilog_ast.h:1293
Stores and describes an expression l value.
Definition: verilog_ast.h:343
ast_hybrid_assignment * hybrid
The hybrid special assignment.
Definition: verilog_ast.h:1370
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1891
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1095
ast_event_expression * ast_new_event_expression(ast_edge trigger_edge, ast_expression *expression)
Creates a new event expression node.
Definition: verilog_ast.c:1049
Used for when we don&#39;t know at declaration time.
Definition: verilog_ast.h:113
Definition: verilog_ast.h:2705
ast_expression * value
Default assigned value.
Definition: verilog_ast.h:2474
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1016
ast_event_control * ast_new_event_control(ast_event_control_type type, ast_event_expression *expression)
Creates and returns a new event control specifier.
Definition: verilog_ast.c:1100
A constant or variable expression.
Definition: verilog_ast.h:3310
ast_port_direction
Describes the direction of a port.
Definition: verilog_ast.h:109
ast_boolean reg
Is is a registered value?
Definition: verilog_ast.h:2708
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2100
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1354
ast_file file
The file the construct came from.
Definition: verilog_ast.h:133
Describes a complete set of if-elseif-else statements.
Definition: verilog_ast.h:1022
ast_concatenation_type type
The type of concatenation.
Definition: verilog_ast.h:266
Fully describes a single module declaration in terms of parameters ports and internal constructs...
Definition: verilog_ast.h:2890
ast_primitive_strength
Describes the drive strength of a single primitive.
Definition: verilog_ast.h:1912
ast_udp_initial_statement * initial
IFF body_type = sequential.
Definition: verilog_ast.h:1597
ast_expression_type
Describes the kind of expression a node contains.
Definition: verilog_ast.h:522
ast_udp_declaration * ast_new_udp_declaration(ast_node_attributes *attributes, ast_identifier identifier, ast_list *ports, ast_udp_body *body)
Creates a new UDP declaration node.
Definition: verilog_ast.c:1432
A User Defined Primitive (UDP) Declaration.
Definition: verilog_ast.h:3245
ast_identifier identifier
The name of the module.
Definition: verilog_ast.h:2893
Has >1 range selector.
Definition: verilog_ast.h:3011
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:166
ast_expression * condition
Execute iff true.
Definition: verilog_ast.h:1018
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.
Definition: verilog_ast.c:366
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1145
Par, sequential.
Definition: verilog_ast.h:1430
Fully describes a single loop statement.
Definition: verilog_ast.h:865
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:1081
ast_list * task_declarations
ast_task_declaration
Definition: verilog_ast.h:2914
ast_operator
Stores different Operators.
Definition: verilog_ast.h:39
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.
Definition: verilog_ast.c:542
Describes a single delay control statement.
Definition: verilog_ast.h:1134
Describes a single pull gate instance.
Definition: verilog_ast.h:1962
ast_list * identifiers
list of reg names with same properties.
Definition: verilog_ast.h:2595
ast_block_type
Describes the type of a block of statements.
Definition: verilog_ast.h:1244
ast_list * net_declarations
ast_net_declaration
Definition: verilog_ast.h:2907
ast_function_declaration * ast_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.
Definition: verilog_ast.c:2272
ast_n_output_gate_instance * ast_new_n_output_gate_instance(ast_identifier name, ast_list *outputs, ast_expression *input)
Creates and returns a new n_output gate instance.
Definition: verilog_ast.c:1912
ast_loop_statement * ast_new_while_loop_statement(ast_statement *inner_statement, ast_expression *continue_condition)
Creates and returns a while loop statement.
Definition: verilog_ast.c:856
ast_list * reg_declarations
ast_reg_declaration
Definition: verilog_ast.h:2911
ast_pass_enable_switchtype
Describes a particular type of pass enable switch.
Definition: verilog_ast.h:2074
Describes the type and value of a delay specifier.
Definition: verilog_ast.h:2270
ast_identifier identifier
Task identifier.
Definition: verilog_ast.h:831
ast_pass_switch_instance * ast_new_pass_switch_instance(ast_identifier name, ast_lvalue *terminal_1, ast_lvalue *terminal_2)
A single pass transistor instance.
Definition: verilog_ast.c:1734
A single CMOS switch (transistor) instance.
Definition: verilog_ast.h:2055
Arithmetic shift right.
Definition: verilog_ast.h:44
ast_metadata meta
Node metadata.
Definition: verilog_ast.h:2556
ast_boolean is_range
iff true use range, else type.
Definition: verilog_ast.h:2660
ast_loop_type type
The type of loop.
Definition: verilog_ast.h:867
ast_expression * expression
Single event expressions.
Definition: verilog_ast.h:1099
caters for procedural_continuous_assignments in Annex A.6.2 of spec.
Definition: verilog_ast.h:1353
A single pass enable switch with pass and enable terminals.
Definition: verilog_ast.h:2065