'K_MOD_EQ', 'K_AND_EQ', 'K_OR_EQ'),
('right', 'K_XOR_EQ', 'K_LS_EQ', 'K_RS_EQ', 'K_RSS_EQ'),
('right', '?', ':', 'K_inside'),
'K_MOD_EQ', 'K_AND_EQ', 'K_OR_EQ'),
('right', 'K_XOR_EQ', 'K_LS_EQ', 'K_RS_EQ', 'K_RSS_EQ'),
('right', '?', ':', 'K_inside'),
- ('left', 'K_LOR'),
- ('left', 'K_LAND'),
- ('left', '|'),
- ('left', '^', 'K_NXOR', 'K_NOR'),
- ('left', '&', 'K_NAND'),
- ('left', 'K_EQ', 'K_NE', 'K_CEQ', 'K_CNE', 'K_WEQ', 'K_WNE'),
- ('left', 'K_GE', 'K_LE', '<', '>'),
- ('left', 'K_LS', 'K_RS', 'K_RSS'),
- ('left', '+', '-'),
- ('left', '*', '/', '%'),
- ('left', 'K_POW'),
- ('left', 'UNARY_PREC'),
- ('nonassoc', 'less_than_K_else'),
- ('nonassoc', 'K_else'),
- ('nonassoc', '('),
- ('nonassoc', 'K_exclude'),
- ('nonassoc', 'no_timeunits_declaration'),
- ('nonassoc', 'one_timeunits_declaration'),
+ ('left', 'K_LOR'),
+ ('left', 'K_LAND'),
+ ('left', '|'),
+ ('left', '^', 'K_NXOR', 'K_NOR'),
+ ('left', '&', 'K_NAND'),
+ ('left', 'K_EQ', 'K_NE', 'K_CEQ', 'K_CNE', 'K_WEQ', 'K_WNE'),
+ ('left', 'K_GE', 'K_LE', '<', '>'),
+ ('left', 'K_LS', 'K_RS', 'K_RSS'),
+ ('left', '+', '-'),
+ ('left', '*', '/', '%'),
+ ('left', 'K_POW'),
+ ('left', 'UNARY_PREC'),
+ ('nonassoc', 'less_than_K_else'),
+ ('nonassoc', 'K_else'),
+ ('nonassoc', '('),
+ ('nonassoc', 'K_exclude'),
+ ('nonassoc', 'no_timeunits_declaration'),
+ ('nonassoc', 'one_timeunits_declaration'),
+
+
+IVL_VT_NO_TYPE = 'VT_NO_TYPE'
+IVL_VT_BOOL = 'VT_BOOL'
+IVL_VT_LOGIC = 'VT_LOGIC'
+"""
+ IVL_VT_VOID = 0, /* Not used */
+ IVL_VT_NO_TYPE = 1, /* Place holder for missing/unknown type. */
+ IVL_VT_REAL = 2,
+ IVL_VT_BOOL = 3,
+ IVL_VT_LOGIC = 4,
+ IVL_VT_STRING = 5,
+ IVL_VT_DARRAY = 6, /* Array (esp. dynamic array) */
+ IVL_VT_CLASS = 7, /* SystemVerilog class instances */
+ IVL_VT_QUEUE = 8, /* SystemVerilog queue instances */
+ IVL_VT_VECTOR = IVL_VT_LOGIC /* For compatibility */
+"""
+
+NN_NONE = 'NONE'
+NN_IMPLICIT = 'IMPLICIT'
+NN_IMPLICIT_REG = 'IMPLICIT_REG'
+NN_INTEGER = 'INTEGER'
+NN_WIRE = 'WIRE'
+NN_TRI = 'TRI'
+NN_TRI1 = 'TRI1'
+NN_SUPPLY0 = 'SUPPLY0'
+NN_SUPPLY1 = 'SUPPLY1'
+NN_WAND = 'WAND'
+NN_TRIAND = 'TRIAND'
+NN_TRI0 = 'TRI0'
+NN_WOR = 'WOR'
+NN_TRIOR = 'TRIOR'
+NN_REG = 'REG'
+NN_UNRESOLVED_WIRE = 'UNRESOLVED_WIRE'
+
+NP_NOT_A_PORT = 'NOT_A_PORT'
+NP_PIMPLICIT = 'PIMPLICIT'
+NP_PINPUT = 'PINPUT'
+NP_POUTPUT = 'POUTPUT'
+NP_PINOUT = 'PINOUT'
+NP_PREF = 'PREF'
+
+def indent(s, i=4):
+ st = ''
+ for x in s:
+ st += str(x)
+ res = []
+ for p in st.split('\n'):
+ res.append(' ' * i + p)
+ return '\n'.join(res)
+
+
+class DataType:
+ def __init__(self, typ, signed):
+ self.typ = typ
+ self.signed = signed
+
+def port_decl(comment, dt, name):
+ if dt.dims is None:
+ width = '' # width: 1
+ else:
+ width = dt.dims
+ # XXX TODO, better checking, should be using data structure... *sigh*
+ width = width[1:-1] # strip brackets
+ width = width.split(':')
+ assert width[0] == '0'
+ width = width[1]
+ return 'self.%s = Signal(%s) # %s' % (name, width, comment)
+
'''class_declaration : K_virtual_opt K_class lifetime_opt class_identifier class_declaration_extends_opt ';' _embed0_class_declaration class_items_opt K_endclass _embed1_class_declaration class_declaration_endlabel_opt '''
print('class_declaration_1', list(p))
# { // Wrap up the class.
'''class_declaration : K_virtual_opt K_class lifetime_opt class_identifier class_declaration_extends_opt ';' _embed0_class_declaration class_items_opt K_endclass _embed1_class_declaration class_declaration_endlabel_opt '''
print('class_declaration_1', list(p))
# { // Wrap up the class.
'''class_item : K_extern method_qualifier_opt K_function data_type_or_implicit_or_void IDENTIFIER ';' '''
print('class_item_8', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
'''class_item : K_extern method_qualifier_opt K_function data_type_or_implicit_or_void IDENTIFIER ';' '''
print('class_item_8', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
# }
()
def p_class_item_9(p):
'''class_item : K_extern method_qualifier_opt K_function data_type_or_implicit_or_void IDENTIFIER '(' tf_port_list_opt ')' ';' '''
print('class_item_9', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
# }
()
def p_class_item_9(p):
'''class_item : K_extern method_qualifier_opt K_function data_type_or_implicit_or_void IDENTIFIER '(' tf_port_list_opt ')' ';' '''
print('class_item_9', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
# }
()
def p_class_item_10(p):
'''class_item : K_extern method_qualifier_opt K_task IDENTIFIER ';' '''
print('class_item_10', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
# }
()
def p_class_item_10(p):
'''class_item : K_extern method_qualifier_opt K_task IDENTIFIER ';' '''
print('class_item_10', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
# }
()
def p_class_item_11(p):
'''class_item : K_extern method_qualifier_opt K_task IDENTIFIER '(' tf_port_list_opt ')' ';' '''
print('class_item_11', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
# }
()
def p_class_item_11(p):
'''class_item : K_extern method_qualifier_opt K_task IDENTIFIER '(' tf_port_list_opt ')' ';' '''
print('class_item_11', list(p))
# { yyerror(@1, "sorry: External methods are not yet supported.");
# { list<pform_range_t>*pd = make_range_from_width(64);
# vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, pd);
# tmp->reg_flag = !gn_system_verilog();
# { list<pform_range_t>*pd = make_range_from_width(64);
# vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, pd);
# tmp->reg_flag = !gn_system_verilog();
()
def p_data_type_or_implicit_or_void_2(p):
'''data_type_or_implicit_or_void : K_void '''
print('data_type_or_implicit_or_void_2', list(p))
# { void_type_t*tmp = new void_type_t;
# FILE_NAME(tmp, @1);
()
def p_data_type_or_implicit_or_void_2(p):
'''data_type_or_implicit_or_void : K_void '''
print('data_type_or_implicit_or_void_2', list(p))
# { void_type_t*tmp = new void_type_t;
# FILE_NAME(tmp, @1);
()
def p_function_declaration_1(p):
'''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER ';' _embed0_function_declaration function_item_list statement_or_null_list_opt K_endfunction _embed1_function_declaration endlabel_opt '''
print('function_declaration_1', list(p))
# { // Last step: check any closing name.
()
def p_function_declaration_1(p):
'''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER ';' _embed0_function_declaration function_item_list statement_or_null_list_opt K_endfunction _embed1_function_declaration endlabel_opt '''
print('function_declaration_1', list(p))
# { // Last step: check any closing name.
# }
()
def p_function_declaration_2(p):
'''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER _embed2_function_declaration '(' tf_port_list_opt ')' ';' block_item_decls_opt statement_or_null_list_opt K_endfunction _embed3_function_declaration endlabel_opt '''
print('function_declaration_2', list(p))
# { // Last step: check any closing name.
# }
()
def p_function_declaration_2(p):
'''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER _embed2_function_declaration '(' tf_port_list_opt ')' ';' block_item_decls_opt statement_or_null_list_opt K_endfunction _embed3_function_declaration endlabel_opt '''
print('function_declaration_2', list(p))
# { // Last step: check any closing name.
# }
()
def p_function_declaration_3(p):
'''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER error K_endfunction _embed4_function_declaration endlabel_opt '''
print('function_declaration_3', list(p))
# { // Last step: check any closing name.
# }
()
def p_function_declaration_3(p):
'''function_declaration : K_function lifetime_opt data_type_or_implicit_or_void IDENTIFIER error K_endfunction _embed4_function_declaration endlabel_opt '''
print('function_declaration_3', list(p))
# { // Last step: check any closing name.
# }
()
def p_inside_expression_1(p):
'''inside_expression : expression K_inside '{' open_range_list '}' '''
print('inside_expression_1', list(p))
# { yyerror(@2, "sorry: \"inside\" expressions not supported yet.");
# }
()
def p_inside_expression_1(p):
'''inside_expression : expression K_inside '{' open_range_list '}' '''
print('inside_expression_1', list(p))
# { yyerror(@2, "sorry: \"inside\" expressions not supported yet.");
()
def p_jump_statement_1(p):
'''jump_statement : K_break ';' '''
print('jump_statement_1', list(p))
# { yyerror(@1, "sorry: break statements not supported.");
()
def p_jump_statement_1(p):
'''jump_statement : K_break ';' '''
print('jump_statement_1', list(p))
# { yyerror(@1, "sorry: break statements not supported.");
# }
()
def p_loop_statement_2(p):
'''loop_statement : K_for '(' data_type IDENTIFIER '=' expression ';' expression ';' for_step ')' _embed0_loop_statement statement_or_null '''
print('loop_statement_2', list(p))
# { pform_name_t tmp_hident;
# }
()
def p_loop_statement_2(p):
'''loop_statement : K_for '(' data_type IDENTIFIER '=' expression ';' expression ';' for_step ')' _embed0_loop_statement statement_or_null '''
print('loop_statement_2', list(p))
# { pform_name_t tmp_hident;
# pform_pop_scope();
# vector<Statement*>tmp_for_list (1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
# pform_pop_scope();
# vector<Statement*>tmp_for_list (1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
# pform_pop_scope();
# vector<Statement*>tmp_for_list(1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
# pform_pop_scope();
# vector<Statement*>tmp_for_list(1);
# tmp_for_list[0] = tmp_for;
# PBlock*tmp_blk = current_block_stack.top();
# current_block_stack.pop();
# tmp_blk->set_statement(tmp_for_list);
# yyerror(@1, "error: Error in for loop step assignment.");
# }
()
def p_loop_statement_9(p):
'''loop_statement : K_for '(' lpvalue '=' expression ';' error ';' for_step ')' statement_or_null '''
print('loop_statement_9', list(p))
# yyerror(@1, "error: Error in for loop step assignment.");
# }
()
def p_loop_statement_9(p):
'''loop_statement : K_for '(' lpvalue '=' expression ';' error ';' for_step ')' statement_or_null '''
print('loop_statement_9', list(p))
# yyerror(@1, "error: Error in for loop condition expression.");
# }
()
def p_loop_statement_10(p):
'''loop_statement : K_for '(' error ')' statement_or_null '''
print('loop_statement_10', list(p))
# yyerror(@1, "error: Error in for loop condition expression.");
# }
()
def p_loop_statement_10(p):
'''loop_statement : K_for '(' error ')' statement_or_null '''
print('loop_statement_10', list(p))
# yyerror(@1, "error: Incomprehensible for loop.");
# }
()
def p_loop_statement_11(p):
'''loop_statement : K_while '(' error ')' statement_or_null '''
print('loop_statement_11', list(p))
# yyerror(@1, "error: Incomprehensible for loop.");
# }
()
def p_loop_statement_11(p):
'''loop_statement : K_while '(' error ')' statement_or_null '''
print('loop_statement_11', list(p))
# yyerror(@1, "error: Error in while loop condition.");
# }
()
def p_loop_statement_12(p):
'''loop_statement : K_do statement_or_null K_while '(' error ')' ';' '''
print('loop_statement_12', list(p))
# yyerror(@1, "error: Error in while loop condition.");
# }
()
def p_loop_statement_12(p):
'''loop_statement : K_do statement_or_null K_while '(' error ')' ';' '''
print('loop_statement_12', list(p))
# yyerror(@1, "error: Error in do/while loop condition.");
# }
()
def p_loop_statement_13(p):
'''loop_statement : K_foreach '(' IDENTIFIER '[' error ']' ')' statement_or_null '''
print('loop_statement_13', list(p))
# yyerror(@1, "error: Error in do/while loop condition.");
# }
()
def p_loop_statement_13(p):
'''loop_statement : K_foreach '(' IDENTIFIER '[' error ']' ')' statement_or_null '''
print('loop_statement_13', list(p))
# }
()
def p_list_of_variable_decl_assignments_1(p):
'''list_of_variable_decl_assignments : variable_decl_assignment '''
print('list_of_variable_decl_assignments_1', list(p))
# { list<decl_assignment_t*>*tmp = new list<decl_assignment_t*>;
# }
()
def p_list_of_variable_decl_assignments_1(p):
'''list_of_variable_decl_assignments : variable_decl_assignment '''
print('list_of_variable_decl_assignments_1', list(p))
# { list<decl_assignment_t*>*tmp = new list<decl_assignment_t*>;
# }
()
def p_list_of_variable_decl_assignments_2(p):
'''list_of_variable_decl_assignments : list_of_variable_decl_assignments ',' variable_decl_assignment '''
print('list_of_variable_decl_assignments_2', list(p))
# }
()
def p_list_of_variable_decl_assignments_2(p):
'''list_of_variable_decl_assignments : list_of_variable_decl_assignments ',' variable_decl_assignment '''
print('list_of_variable_decl_assignments_2', list(p))
# }
()
def p_variable_decl_assignment_1(p):
'''variable_decl_assignment : IDENTIFIER dimensions_opt '''
print('variable_decl_assignment_1', list(p))
# { decl_assignment_t*tmp = new decl_assignment_t;
# }
()
def p_variable_decl_assignment_1(p):
'''variable_decl_assignment : IDENTIFIER dimensions_opt '''
print('variable_decl_assignment_1', list(p))
# { decl_assignment_t*tmp = new decl_assignment_t;
# }
()
def p_variable_decl_assignment_2(p):
'''variable_decl_assignment : IDENTIFIER '=' expression '''
print('variable_decl_assignment_2', list(p))
# { decl_assignment_t*tmp = new decl_assignment_t;
# }
()
def p_variable_decl_assignment_2(p):
'''variable_decl_assignment : IDENTIFIER '=' expression '''
print('variable_decl_assignment_2', list(p))
# { decl_assignment_t*tmp = new decl_assignment_t;
# }
()
def p_variable_decl_assignment_3(p):
'''variable_decl_assignment : IDENTIFIER '=' K_new '(' ')' '''
print('variable_decl_assignment_3', list(p))
# { decl_assignment_t*tmp = new decl_assignment_t;
# }
()
def p_variable_decl_assignment_3(p):
'''variable_decl_assignment : IDENTIFIER '=' K_new '(' ')' '''
print('variable_decl_assignment_3', list(p))
# { decl_assignment_t*tmp = new decl_assignment_t;
# }
()
def p_loop_variables_2(p):
'''loop_variables : IDENTIFIER '''
print('loop_variables_2', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
# }
()
def p_loop_variables_2(p):
'''loop_variables : IDENTIFIER '''
print('loop_variables_2', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
print('modport_ports_list_3', list(p))
# { if (last_modport_port.type == MP_SIMPLE) {
# pform_add_modport_port(@3, last_modport_port.direction,
print('modport_ports_list_3', list(p))
# { if (last_modport_port.type == MP_SIMPLE) {
# pform_add_modport_port(@3, last_modport_port.direction,
print('modport_ports_list_5', list(p))
# { if (last_modport_port.type == MP_SIMPLE) {
# pform_add_modport_port(@3, last_modport_port.direction,
print('modport_ports_list_5', list(p))
# { if (last_modport_port.type == MP_SIMPLE) {
# pform_add_modport_port(@3, last_modport_port.direction,
# }
()
def p_modport_ports_declaration_2(p):
'''modport_ports_declaration : attribute_list_opt port_direction modport_simple_port '''
print('modport_ports_declaration_2', list(p))
# { last_modport_port.type = MP_SIMPLE;
# }
()
def p_modport_ports_declaration_2(p):
'''modport_ports_declaration : attribute_list_opt port_direction modport_simple_port '''
print('modport_ports_declaration_2', list(p))
# { last_modport_port.type = MP_SIMPLE;
# }
()
def p_modport_ports_declaration_3(p):
'''modport_ports_declaration : attribute_list_opt import_export IDENTIFIER '''
print('modport_ports_declaration_3', list(p))
# { last_modport_port.type = MP_TF;
# }
()
def p_modport_ports_declaration_3(p):
'''modport_ports_declaration : attribute_list_opt import_export IDENTIFIER '''
print('modport_ports_declaration_3', list(p))
# { last_modport_port.type = MP_TF;
# }
()
def p_modport_ports_declaration_4(p):
'''modport_ports_declaration : attribute_list_opt import_export modport_tf_port '''
print('modport_ports_declaration_4', list(p))
# { last_modport_port.type = MP_TF;
# }
()
def p_modport_ports_declaration_4(p):
'''modport_ports_declaration : attribute_list_opt import_export modport_tf_port '''
print('modport_ports_declaration_4', list(p))
# { last_modport_port.type = MP_TF;
# }
()
def p_modport_simple_port_1(p):
'''modport_simple_port : '.' IDENTIFIER '(' expression ')' '''
print('modport_simple_port_1', list(p))
# { named_pexpr_t*tmp = new named_pexpr_t;
# }
()
def p_modport_simple_port_1(p):
'''modport_simple_port : '.' IDENTIFIER '(' expression ')' '''
print('modport_simple_port_1', list(p))
# { named_pexpr_t*tmp = new named_pexpr_t;
()
def p_number_3(p):
'''number : DEC_NUMBER BASED_NUMBER '''
print('number_3', list(p))
num = Leaf(token.NUMBER, "%s:%s" % (p[1], p[2]))
p[0] = num
()
def p_number_3(p):
'''number : DEC_NUMBER BASED_NUMBER '''
print('number_3', list(p))
num = Leaf(token.NUMBER, "%s:%s" % (p[1], p[2]))
p[0] = num
'''procedural_assertion_statement : K_assert '(' expression ')' statement %prec less_than_K_else '''
print('procedural_assertion_statement_1', list(p))
# { yyerror(@1, "sorry: Simple immediate assertion statements not implemented.");
'''procedural_assertion_statement : K_assert '(' expression ')' statement %prec less_than_K_else '''
print('procedural_assertion_statement_1', list(p))
# { yyerror(@1, "sorry: Simple immediate assertion statements not implemented.");
# }
()
def p_procedural_assertion_statement_2(p):
'''procedural_assertion_statement : K_assert '(' expression ')' K_else statement '''
print('procedural_assertion_statement_2', list(p))
# { yyerror(@1, "sorry: Simple immediate assertion statements not implemented.");
# }
()
def p_procedural_assertion_statement_2(p):
'''procedural_assertion_statement : K_assert '(' expression ')' K_else statement '''
print('procedural_assertion_statement_2', list(p))
# { yyerror(@1, "sorry: Simple immediate assertion statements not implemented.");
# }
()
def p_procedural_assertion_statement_3(p):
'''procedural_assertion_statement : K_assert '(' expression ')' statement K_else statement '''
print('procedural_assertion_statement_3', list(p))
# { yyerror(@1, "sorry: Simple immediate assertion statements not implemented.");
# }
()
def p_procedural_assertion_statement_3(p):
'''procedural_assertion_statement : K_assert '(' expression ')' statement K_else statement '''
print('procedural_assertion_statement_3', list(p))
# { yyerror(@1, "sorry: Simple immediate assertion statements not implemented.");
# { list<pform_range_t>*pd = make_range_from_width(64);
# vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, pd);
# tmp->reg_flag = !gn_system_verilog();
# { list<pform_range_t>*pd = make_range_from_width(64);
# vector_type_t*tmp = new vector_type_t(IVL_VT_LOGIC, false, pd);
# tmp->reg_flag = !gn_system_verilog();
# }
()
def p_simple_type_or_string_7(p):
'''simple_type_or_string : PACKAGE_IDENTIFIER K_SCOPE_RES _embed0_simple_type_or_string TYPE_IDENTIFIER '''
print('simple_type_or_string_7', list(p))
# { lex_in_package_scope(0);
# }
()
def p_simple_type_or_string_7(p):
'''simple_type_or_string : PACKAGE_IDENTIFIER K_SCOPE_RES _embed0_simple_type_or_string TYPE_IDENTIFIER '''
print('simple_type_or_string_7', list(p))
# { lex_in_package_scope(0);
# }
()
def p_tf_port_declaration_2(p):
'''tf_port_declaration : port_direction K_integer list_of_identifiers ';' '''
print('tf_port_declaration_2', list(p))
# { list<pform_range_t>*range_stub = make_range_from_width(integer_width);
# }
()
def p_tf_port_declaration_2(p):
'''tf_port_declaration : port_direction K_integer list_of_identifiers ';' '''
print('tf_port_declaration_2', list(p))
# { list<pform_range_t>*range_stub = make_range_from_width(integer_width);
- # vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, $1, IVL_VT_LOGIC, true,
- # range_stub, $3, true);
- # $$ = tmp;
+ # vector<pform_tf_port_t>*tmp = pform_make_task_ports(@1, p[1], IVL_VT_LOGIC, true,
+ # range_stub, p[3], true);
+ # p[0] = tmp;
# }
()
def p_tf_port_declaration_3(p):
'''tf_port_declaration : port_direction K_time list_of_identifiers ';' '''
print('tf_port_declaration_3', list(p))
# { list<pform_range_t>*range_stub = make_range_from_width(64);
# }
()
def p_tf_port_declaration_3(p):
'''tf_port_declaration : port_direction K_time list_of_identifiers ';' '''
print('tf_port_declaration_3', list(p))
# { list<pform_range_t>*range_stub = make_range_from_width(64);
# yyerror(@4, "internal error: How can there be an unpacked range here?\n");
# }
# tmp = pform_make_task_ports(@3, use_port_type,
# port_declaration_context.data_type,
# ilist);
# yyerror(@4, "internal error: How can there be an unpacked range here?\n");
# }
# tmp = pform_make_task_ports(@3, use_port_type,
# port_declaration_context.data_type,
# ilist);
# } else {
# // Otherwise, the decorations for this identifier
# // indicate the type. Save the type for any right
# // context that may come later.
# port_declaration_context.port_type = use_port_type;
# } else {
# // Otherwise, the decorations for this identifier
# // indicate the type. Save the type for any right
# // context that may come later.
# port_declaration_context.port_type = use_port_type;
- # if ($1 && $3) {
- # size_t s1 = $1->size();
- # tmp = $1;
- # tmp->resize(tmp->size()+$3->size());
- # for (size_t idx = 0 ; idx < $3->size() ; idx += 1)
- # tmp->at(s1+idx) = $3->at(idx);
- # delete $3;
- # } else if ($1) {
- # tmp = $1;
+ # if (p[1] && p[3]) {
+ # size_t s1 = p[1]->size();
+ # tmp = p[1];
+ # tmp->resize(tmp->size()+p[3]->size());
+ # for (size_t idx = 0 ; idx < p[3]->size() ; idx += 1)
+ # tmp->at(s1+idx) = p[3]->at(idx);
+ # delete p[3];
+ # } else if (p[1]) {
+ # tmp = p[1];
()
def p_tf_port_item_list_3(p):
'''tf_port_item_list : error ',' tf_port_item '''
print('tf_port_item_list_3', list(p))
# { yyerror(@2, "error: Syntax error in task/function port declaration.");
()
def p_tf_port_item_list_3(p):
'''tf_port_item_list : error ',' tf_port_item '''
print('tf_port_item_list_3', list(p))
# { yyerror(@2, "error: Syntax error in task/function port declaration.");
# }
()
def p_tf_port_item_list_4(p):
'''tf_port_item_list : tf_port_item_list ',' '''
print('tf_port_item_list_4', list(p))
# { yyerror(@2, "error: NULL port declarations are not allowed.");
# }
()
def p_tf_port_item_list_4(p):
'''tf_port_item_list : tf_port_item_list ',' '''
print('tf_port_item_list_4', list(p))
# { yyerror(@2, "error: NULL port declarations are not allowed.");
# }
()
def p_tf_port_item_list_5(p):
'''tf_port_item_list : tf_port_item_list ';' '''
print('tf_port_item_list_5', list(p))
# { yyerror(@2, "error: ';' is an invalid port declaration separator.");
# }
()
def p_tf_port_item_list_5(p):
'''tf_port_item_list : tf_port_item_list ';' '''
print('tf_port_item_list_5', list(p))
# { yyerror(@2, "error: ';' is an invalid port declaration separator.");
()
def p_timeunits_declaration_2(p):
'''timeunits_declaration : K_timeunit TIME_LITERAL '/' TIME_LITERAL ';' '''
print('timeunits_declaration_2', list(p))
# { bool initial_decl = allow_timeunit_decl && allow_timeprec_decl;
()
def p_timeunits_declaration_2(p):
'''timeunits_declaration : K_timeunit TIME_LITERAL '/' TIME_LITERAL ';' '''
print('timeunits_declaration_2', list(p))
# { bool initial_decl = allow_timeunit_decl && allow_timeprec_decl;
# }
()
def p_attribute_list_2(p):
'''attribute_list : attribute '''
print('attribute_list_2', list(p))
# { list<named_pexpr_t>*tmp = new list<named_pexpr_t>;
# }
()
def p_attribute_list_2(p):
'''attribute_list : attribute '''
print('attribute_list_2', list(p))
# { list<named_pexpr_t>*tmp = new list<named_pexpr_t>;
# var_lifetime = LexicalScope::INHERITED;
# }
()
def p_block_item_decl_3(p):
'''block_item_decl : K_reg data_type register_variable_list ';' '''
print('block_item_decl_3', list(p))
# var_lifetime = LexicalScope::INHERITED;
# }
()
def p_block_item_decl_3(p):
'''block_item_decl : K_reg data_type register_variable_list ';' '''
print('block_item_decl_3', list(p))
# var_lifetime = LexicalScope::INHERITED;
# }
()
def p_block_item_decl_5(p):
'''block_item_decl : K_event event_variable_list ';' '''
print('block_item_decl_5', list(p))
# var_lifetime = LexicalScope::INHERITED;
# }
()
def p_block_item_decl_5(p):
'''block_item_decl : K_event event_variable_list ';' '''
print('block_item_decl_5', list(p))
# enum_type->base_type = IVL_VT_BOOL;
# enum_type->signed_flag = true;
# enum_type->integer_flag = false;
# enum_type->range.reset(make_range_from_width(32));
# enum_type->base_type = IVL_VT_BOOL;
# enum_type->signed_flag = true;
# enum_type->integer_flag = false;
# enum_type->range.reset(make_range_from_width(32));
- # { perm_string name = lex_strings.make($1);
- # long count = check_enum_seq_value(@1, $3, false);
- # delete[]$1;
- # $$ = make_named_numbers(name, 0, count-1);
- # delete $3;
+ # { perm_string name = lex_strings.make(p[1]);
+ # long count = check_enum_seq_value(@1, p[3], false);
+ # delete[]p[1];
+ # p[0] = make_named_numbers(name, 0, count-1);
+ # delete p[3];
- # { perm_string name = lex_strings.make($1);
- # $$ = make_named_numbers(name, check_enum_seq_value(@1, $3, true),
- # check_enum_seq_value(@1, $5, true));
- # delete[]$1;
- # delete $3;
- # delete $5;
+ # { perm_string name = lex_strings.make(p[1]);
+ # p[0] = make_named_numbers(name, check_enum_seq_value(@1, p[3], true),
+ # check_enum_seq_value(@1, p[5], true));
+ # delete[]p[1];
+ # delete p[3];
+ # delete p[5];
- # { perm_string name = lex_strings.make($1);
- # long count = check_enum_seq_value(@1, $3, false);
- # $$ = make_named_numbers(name, 0, count-1, $6);
- # delete[]$1;
- # delete $3;
+ # { perm_string name = lex_strings.make(p[1]);
+ # long count = check_enum_seq_value(@1, p[3], false);
+ # p[0] = make_named_numbers(name, 0, count-1, p[6]);
+ # delete[]p[1];
+ # delete p[3];
- # { perm_string name = lex_strings.make($1);
- # $$ = make_named_numbers(name, check_enum_seq_value(@1, $3, true),
- # check_enum_seq_value(@1, $5, true), $8);
- # delete[]$1;
- # delete $3;
- # delete $5;
+ # { perm_string name = lex_strings.make(p[1]);
+ # p[0] = make_named_numbers(name, check_enum_seq_value(@1, p[3], true),
+ # check_enum_seq_value(@1, p[5], true), p[8]);
+ # delete[]p[1];
+ # delete p[3];
+ # delete p[5];
# }
()
def p_struct_union_member_list_2(p):
'''struct_union_member_list : struct_union_member '''
print('struct_union_member_list_2', list(p))
# { list<struct_member_t*>*tmp = new list<struct_member_t*>;
# }
()
def p_struct_union_member_list_2(p):
'''struct_union_member_list : struct_union_member '''
print('struct_union_member_list_2', list(p))
# { list<struct_member_t*>*tmp = new list<struct_member_t*>;
'''defparam_assign_list : dimensions defparam_assign '''
print('defparam_assign_list_2', list(p))
# { yyerror(@1, "error: defparam may not include a range.");
'''defparam_assign_list : dimensions defparam_assign '''
print('defparam_assign_list_2', list(p))
# { yyerror(@1, "error: defparam may not include a range.");
# }
()
def p_delay3_4(p):
'''delay3 : '#' '(' delay_value ',' delay_value ',' delay_value ')' '''
print('delay3_4', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
# }
()
def p_delay3_4(p):
'''delay3 : '#' '(' delay_value ',' delay_value ',' delay_value ')' '''
print('delay3_4', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
()
def p_delay_value_list_1(p):
'''delay_value_list : delay_value '''
print('delay_value_list_1', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
()
def p_delay_value_list_1(p):
'''delay_value_list : delay_value '''
print('delay_value_list_1', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
()
def p_config_declaration_1(p):
'''config_declaration : K_config IDENTIFIER ';' K_design lib_cell_identifiers ';' list_of_config_rule_statements K_endconfig '''
print('config_declaration_1', list(p))
# { cerr << @1 << ": sorry: config declarations are not supported and "
# "will be skipped." << endl;
()
def p_config_declaration_1(p):
'''config_declaration : K_config IDENTIFIER ';' K_design lib_cell_identifiers ';' list_of_config_rule_statements K_endconfig '''
print('config_declaration_1', list(p))
# { cerr << @1 << ": sorry: config declarations are not supported and "
# "will be skipped." << endl;
# }
()
def p_event_control_3(p):
'''event_control : '@' '(' error ')' '''
print('event_control_3', list(p))
# { yyerror(@1, "error: Malformed event control expression.");
# }
()
def p_event_control_3(p):
'''event_control : '@' '(' error ')' '''
print('event_control_3', list(p))
# { yyerror(@1, "error: Malformed event control expression.");
# }
()
def p_event_expression_list_3(p):
'''event_expression_list : event_expression_list ',' event_expression '''
print('event_expression_list_3', list(p))
# }
()
def p_event_expression_list_3(p):
'''event_expression_list : event_expression_list ',' event_expression '''
print('event_expression_list_3', list(p))
# }
()
def p_branch_probe_expression_1(p):
'''branch_probe_expression : IDENTIFIER '(' IDENTIFIER ',' IDENTIFIER ')' '''
print('branch_probe_expression_1', list(p))
# }
()
def p_branch_probe_expression_1(p):
'''branch_probe_expression : IDENTIFIER '(' IDENTIFIER ',' IDENTIFIER ')' '''
print('branch_probe_expression_1', list(p))
()
def p_expr_mintypmax_2(p):
'''expr_mintypmax : expression ':' expression ':' expression '''
print('expr_mintypmax_2', list(p))
# { switch (min_typ_max_flag) {
# case MIN:
()
def p_expr_mintypmax_2(p):
'''expr_mintypmax : expression ':' expression ':' expression '''
print('expr_mintypmax_2', list(p))
# { switch (min_typ_max_flag) {
# case MIN:
def p_expression_list_with_nuls_1(p):
'''expression_list_with_nuls : expression_list_with_nuls ',' expression '''
print('expression_list_with_nuls_1', list(p))
def p_expression_list_with_nuls_1(p):
'''expression_list_with_nuls : expression_list_with_nuls ',' expression '''
print('expression_list_with_nuls_1', list(p))
# }
()
def p_expression_list_with_nuls_2(p):
'''expression_list_with_nuls : expression '''
print('expression_list_with_nuls_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
# }
()
def p_expression_list_with_nuls_2(p):
'''expression_list_with_nuls : expression '''
print('expression_list_with_nuls_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
# }
()
def p_expression_list_with_nuls_4(p):
'''expression_list_with_nuls : expression_list_with_nuls ',' '''
print('expression_list_with_nuls_4', list(p))
# }
()
def p_expression_list_with_nuls_4(p):
'''expression_list_with_nuls : expression_list_with_nuls ',' '''
print('expression_list_with_nuls_4', list(p))
# }
()
def p_expression_list_proper_1(p):
'''expression_list_proper : expression_list_proper ',' expression '''
print('expression_list_proper_1', list(p))
# }
()
def p_expression_list_proper_1(p):
'''expression_list_proper : expression_list_proper ',' expression '''
print('expression_list_proper_1', list(p))
# }
()
def p_expression_list_proper_2(p):
'''expression_list_proper : expression '''
print('expression_list_proper_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
# }
()
def p_expression_list_proper_2(p):
'''expression_list_proper : expression '''
print('expression_list_proper_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
# }
()
def p_expr_primary_15(p):
'''expr_primary : K_acos '(' expression ')' '''
print('expr_primary_15', list(p))
# { perm_string tn = perm_string::literal("$acos");
# }
()
def p_expr_primary_15(p):
'''expr_primary : K_acos '(' expression ')' '''
print('expr_primary_15', list(p))
# { perm_string tn = perm_string::literal("$acos");
# }
()
def p_expr_primary_16(p):
'''expr_primary : K_acosh '(' expression ')' '''
print('expr_primary_16', list(p))
# { perm_string tn = perm_string::literal("$acosh");
# }
()
def p_expr_primary_16(p):
'''expr_primary : K_acosh '(' expression ')' '''
print('expr_primary_16', list(p))
# { perm_string tn = perm_string::literal("$acosh");
# }
()
def p_expr_primary_17(p):
'''expr_primary : K_asin '(' expression ')' '''
print('expr_primary_17', list(p))
# { perm_string tn = perm_string::literal("$asin");
# }
()
def p_expr_primary_17(p):
'''expr_primary : K_asin '(' expression ')' '''
print('expr_primary_17', list(p))
# { perm_string tn = perm_string::literal("$asin");
# }
()
def p_expr_primary_18(p):
'''expr_primary : K_asinh '(' expression ')' '''
print('expr_primary_18', list(p))
# { perm_string tn = perm_string::literal("$asinh");
# }
()
def p_expr_primary_18(p):
'''expr_primary : K_asinh '(' expression ')' '''
print('expr_primary_18', list(p))
# { perm_string tn = perm_string::literal("$asinh");
# }
()
def p_expr_primary_19(p):
'''expr_primary : K_atan '(' expression ')' '''
print('expr_primary_19', list(p))
# { perm_string tn = perm_string::literal("$atan");
# }
()
def p_expr_primary_19(p):
'''expr_primary : K_atan '(' expression ')' '''
print('expr_primary_19', list(p))
# { perm_string tn = perm_string::literal("$atan");
# }
()
def p_expr_primary_20(p):
'''expr_primary : K_atanh '(' expression ')' '''
print('expr_primary_20', list(p))
# { perm_string tn = perm_string::literal("$atanh");
# }
()
def p_expr_primary_20(p):
'''expr_primary : K_atanh '(' expression ')' '''
print('expr_primary_20', list(p))
# { perm_string tn = perm_string::literal("$atanh");
# }
()
def p_expr_primary_21(p):
'''expr_primary : K_atan2 '(' expression ',' expression ')' '''
print('expr_primary_21', list(p))
# { perm_string tn = perm_string::literal("$atan2");
# }
()
def p_expr_primary_21(p):
'''expr_primary : K_atan2 '(' expression ',' expression ')' '''
print('expr_primary_21', list(p))
# { perm_string tn = perm_string::literal("$atan2");
# }
()
def p_expr_primary_22(p):
'''expr_primary : K_ceil '(' expression ')' '''
print('expr_primary_22', list(p))
# { perm_string tn = perm_string::literal("$ceil");
# }
()
def p_expr_primary_22(p):
'''expr_primary : K_ceil '(' expression ')' '''
print('expr_primary_22', list(p))
# { perm_string tn = perm_string::literal("$ceil");
# }
()
def p_expr_primary_23(p):
'''expr_primary : K_cos '(' expression ')' '''
print('expr_primary_23', list(p))
# { perm_string tn = perm_string::literal("$cos");
# }
()
def p_expr_primary_23(p):
'''expr_primary : K_cos '(' expression ')' '''
print('expr_primary_23', list(p))
# { perm_string tn = perm_string::literal("$cos");
# }
()
def p_expr_primary_24(p):
'''expr_primary : K_cosh '(' expression ')' '''
print('expr_primary_24', list(p))
# { perm_string tn = perm_string::literal("$cosh");
# }
()
def p_expr_primary_24(p):
'''expr_primary : K_cosh '(' expression ')' '''
print('expr_primary_24', list(p))
# { perm_string tn = perm_string::literal("$cosh");
# }
()
def p_expr_primary_25(p):
'''expr_primary : K_exp '(' expression ')' '''
print('expr_primary_25', list(p))
# { perm_string tn = perm_string::literal("$exp");
# }
()
def p_expr_primary_25(p):
'''expr_primary : K_exp '(' expression ')' '''
print('expr_primary_25', list(p))
# { perm_string tn = perm_string::literal("$exp");
# }
()
def p_expr_primary_26(p):
'''expr_primary : K_floor '(' expression ')' '''
print('expr_primary_26', list(p))
# { perm_string tn = perm_string::literal("$floor");
# }
()
def p_expr_primary_26(p):
'''expr_primary : K_floor '(' expression ')' '''
print('expr_primary_26', list(p))
# { perm_string tn = perm_string::literal("$floor");
# }
()
def p_expr_primary_27(p):
'''expr_primary : K_hypot '(' expression ',' expression ')' '''
print('expr_primary_27', list(p))
# { perm_string tn = perm_string::literal("$hypot");
# }
()
def p_expr_primary_27(p):
'''expr_primary : K_hypot '(' expression ',' expression ')' '''
print('expr_primary_27', list(p))
# { perm_string tn = perm_string::literal("$hypot");
# }
()
def p_expr_primary_28(p):
'''expr_primary : K_ln '(' expression ')' '''
print('expr_primary_28', list(p))
# { perm_string tn = perm_string::literal("$ln");
# }
()
def p_expr_primary_28(p):
'''expr_primary : K_ln '(' expression ')' '''
print('expr_primary_28', list(p))
# { perm_string tn = perm_string::literal("$ln");
# }
()
def p_expr_primary_29(p):
'''expr_primary : K_log '(' expression ')' '''
print('expr_primary_29', list(p))
# { perm_string tn = perm_string::literal("$log10");
# }
()
def p_expr_primary_29(p):
'''expr_primary : K_log '(' expression ')' '''
print('expr_primary_29', list(p))
# { perm_string tn = perm_string::literal("$log10");
# }
()
def p_expr_primary_30(p):
'''expr_primary : K_pow '(' expression ',' expression ')' '''
print('expr_primary_30', list(p))
# { perm_string tn = perm_string::literal("$pow");
# }
()
def p_expr_primary_30(p):
'''expr_primary : K_pow '(' expression ',' expression ')' '''
print('expr_primary_30', list(p))
# { perm_string tn = perm_string::literal("$pow");
# }
()
def p_expr_primary_31(p):
'''expr_primary : K_sin '(' expression ')' '''
print('expr_primary_31', list(p))
# { perm_string tn = perm_string::literal("$sin");
# }
()
def p_expr_primary_31(p):
'''expr_primary : K_sin '(' expression ')' '''
print('expr_primary_31', list(p))
# { perm_string tn = perm_string::literal("$sin");
# }
()
def p_expr_primary_32(p):
'''expr_primary : K_sinh '(' expression ')' '''
print('expr_primary_32', list(p))
# { perm_string tn = perm_string::literal("$sinh");
# }
()
def p_expr_primary_32(p):
'''expr_primary : K_sinh '(' expression ')' '''
print('expr_primary_32', list(p))
# { perm_string tn = perm_string::literal("$sinh");
# }
()
def p_expr_primary_33(p):
'''expr_primary : K_sqrt '(' expression ')' '''
print('expr_primary_33', list(p))
# { perm_string tn = perm_string::literal("$sqrt");
# }
()
def p_expr_primary_33(p):
'''expr_primary : K_sqrt '(' expression ')' '''
print('expr_primary_33', list(p))
# { perm_string tn = perm_string::literal("$sqrt");
# }
()
def p_expr_primary_34(p):
'''expr_primary : K_tan '(' expression ')' '''
print('expr_primary_34', list(p))
# { perm_string tn = perm_string::literal("$tan");
# }
()
def p_expr_primary_34(p):
'''expr_primary : K_tan '(' expression ')' '''
print('expr_primary_34', list(p))
# { perm_string tn = perm_string::literal("$tan");
# }
()
def p_expr_primary_35(p):
'''expr_primary : K_tanh '(' expression ')' '''
print('expr_primary_35', list(p))
# { perm_string tn = perm_string::literal("$tanh");
# }
()
def p_expr_primary_35(p):
'''expr_primary : K_tanh '(' expression ')' '''
print('expr_primary_35', list(p))
# { perm_string tn = perm_string::literal("$tanh");
()
def p_expr_primary_48(p):
'''expr_primary : K_null '''
print('expr_primary_48', list(p))
# { PENull*tmp = new PENull;
# FILE_NAME(tmp, @1);
()
def p_expr_primary_48(p):
'''expr_primary : K_null '''
print('expr_primary_48', list(p))
# { PENull*tmp = new PENull;
# FILE_NAME(tmp, @1);
()
def p_gate_instance_1(p):
'''gate_instance : IDENTIFIER '(' expression_list_with_nuls ')' '''
print('gate_instance_1', list(p))
# { lgate*tmp = new lgate;
()
def p_gate_instance_1(p):
'''gate_instance : IDENTIFIER '(' expression_list_with_nuls ')' '''
print('gate_instance_1', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_2(p):
'''gate_instance : IDENTIFIER dimensions '(' expression_list_with_nuls ')' '''
print('gate_instance_2', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_2(p):
'''gate_instance : IDENTIFIER dimensions '(' expression_list_with_nuls ')' '''
print('gate_instance_2', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_4(p):
'''gate_instance : IDENTIFIER dimensions '''
print('gate_instance_4', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_4(p):
'''gate_instance : IDENTIFIER dimensions '''
print('gate_instance_4', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_5(p):
'''gate_instance : IDENTIFIER '(' port_name_list ')' '''
print('gate_instance_5', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_5(p):
'''gate_instance : IDENTIFIER '(' port_name_list ')' '''
print('gate_instance_5', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_6(p):
'''gate_instance : IDENTIFIER dimensions '(' port_name_list ')' '''
print('gate_instance_6', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_6(p):
'''gate_instance : IDENTIFIER dimensions '(' port_name_list ')' '''
print('gate_instance_6', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_7(p):
'''gate_instance : IDENTIFIER '(' error ')' '''
print('gate_instance_7', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_7(p):
'''gate_instance : IDENTIFIER '(' error ')' '''
print('gate_instance_7', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_8(p):
'''gate_instance : IDENTIFIER dimensions '(' error ')' '''
print('gate_instance_8', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_8(p):
'''gate_instance : IDENTIFIER dimensions '(' error ')' '''
print('gate_instance_8', list(p))
# { lgate*tmp = new lgate;
# }
()
def p_gate_instance_list_2(p):
'''gate_instance_list : gate_instance '''
print('gate_instance_list_2', list(p))
# { svector<lgate>*tmp = new svector<lgate>(1);
# }
()
def p_gate_instance_list_2(p):
'''gate_instance_list : gate_instance '''
print('gate_instance_list_2', list(p))
# { svector<lgate>*tmp = new svector<lgate>(1);
()
def p_hierarchy_identifier_1(p):
'''hierarchy_identifier : IDENTIFIER '''
print('hierarchy_identifier_1', list(p))
lpvalue = Leaf(token.NAME, p[1])
p[0] = lpvalue
()
def p_hierarchy_identifier_1(p):
'''hierarchy_identifier : IDENTIFIER '''
print('hierarchy_identifier_1', list(p))
lpvalue = Leaf(token.NAME, p[1])
p[0] = lpvalue
()
def p_list_of_port_identifiers_2(p):
'''list_of_port_identifiers : list_of_port_identifiers ',' IDENTIFIER dimensions_opt '''
print('list_of_port_identifiers_2', list(p))
()
def p_list_of_port_identifiers_2(p):
'''list_of_port_identifiers : list_of_port_identifiers ',' IDENTIFIER dimensions_opt '''
print('list_of_port_identifiers_2', list(p))
()
def p_list_of_variable_port_identifiers_3(p):
'''list_of_variable_port_identifiers : list_of_variable_port_identifiers ',' IDENTIFIER dimensions_opt '''
print('list_of_variable_port_identifiers_3', list(p))
()
def p_list_of_variable_port_identifiers_3(p):
'''list_of_variable_port_identifiers : list_of_variable_port_identifiers ',' IDENTIFIER dimensions_opt '''
print('list_of_variable_port_identifiers_3', list(p))
()
def p_list_of_variable_port_identifiers_4(p):
'''list_of_variable_port_identifiers : list_of_variable_port_identifiers ',' IDENTIFIER dimensions_opt '=' expression '''
print('list_of_variable_port_identifiers_4', list(p))
()
def p_list_of_variable_port_identifiers_4(p):
'''list_of_variable_port_identifiers : list_of_variable_port_identifiers ',' IDENTIFIER dimensions_opt '=' expression '''
print('list_of_variable_port_identifiers_4', list(p))
()
def p_list_of_ports_1(p):
'''list_of_ports : port_opt '''
print('list_of_ports_1', list(p))
# { vector<Module::port_t*>*tmp
# = new vector<Module::port_t*>(1);
()
def p_list_of_ports_1(p):
'''list_of_ports : port_opt '''
print('list_of_ports_1', list(p))
# { vector<Module::port_t*>*tmp
# = new vector<Module::port_t*>(1);
# }
()
def p_list_of_port_declarations_2(p):
'''list_of_port_declarations : list_of_port_declarations ',' port_declaration '''
print('list_of_port_declarations_2', list(p))
# }
()
def p_list_of_port_declarations_2(p):
'''list_of_port_declarations : list_of_port_declarations ',' port_declaration '''
print('list_of_port_declarations_2', list(p))
# }
()
def p_list_of_port_declarations_3(p):
'''list_of_port_declarations : list_of_port_declarations ',' IDENTIFIER '''
print('list_of_port_declarations_3', list(p))
# { Module::port_t*ptmp;
# }
()
def p_list_of_port_declarations_3(p):
'''list_of_port_declarations : list_of_port_declarations ',' IDENTIFIER '''
print('list_of_port_declarations_3', list(p))
# { Module::port_t*ptmp;
# port_declaration_context.port_type,
# port_declaration_context.port_net_type,
# port_declaration_context.data_type, 0);
# port_declaration_context.port_type,
# port_declaration_context.port_net_type,
# port_declaration_context.data_type, 0);
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINPUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINPUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINOUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::PINOUT,
- # perm_string name = lex_strings.make($5);
- # data_type_t*use_dtype = $4;
- # if ($6) use_dtype = new uarray_type_t(use_dtype, $6);
- # NetNet::Type use_type = $3;
+ # perm_string name = lex_strings.make(p[5]);
+ # data_type_t*use_dtype = p[4];
+ # if (p[6]) use_dtype = new uarray_type_t(use_dtype, p[6]);
+ # NetNet::Type use_type = p[3];
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::POUTPUT,
# ptmp = pform_module_port_reference(name, @2.text,
# @2.first_line);
# real_type_t*real_type = new real_type_t(real_type_t::REAL);
# FILE_NAME(real_type, @3);
# pform_module_define_port(@2, name, NetNet::POUTPUT,
clsname = [Leaf(token.NAME, 'class'),
Leaf(token.NAME, p[4], prefix=' '),
Leaf(token.COLON, ':')]
clsname = [Leaf(token.NAME, 'class'),
Leaf(token.NAME, p[4], prefix=' '),
Leaf(token.COLON, ':')]
- stmt = Node(syms.pass_stmt, [Leaf(token.NAME, "pass"),])
- stmts = Node(syms.small_stmt, [stmt, Leaf(token.NEWLINE, '\n')])
- stmts = Node(syms.stmt, [stmts])
+ pass_stmt = Node(syms.pass_stmt, [Leaf(token.NAME, "pass"),])
+ if params:
+ params = [Leaf(token.LPAR, '(')] + params + [Leaf(token.RPAR, ')')]
+ fn = [Leaf(token.NAME, 'def'),
+ Leaf(token.NAME, '__init__', prefix=' '),
+ Node(syms.parameters, params),
+ Leaf(token.COLON, ':')]
+ fndef = Node(syms.funcdef, fn)
+ stmts = Node(syms.stmt, [fndef])
+ else:
+ stmts = Node(syms.small_stmt, [pass_stmt, Leaf(token.NEWLINE, '\n')])
+ stmts = Node(syms.stmt, [stmts])
+
+ # XXX TODO ports as py nodes
+ ports = p[8]
+ stmts.children.append(Leaf(token.STRING, '\n' + indent(ports, 8)))
()
def p_module_port_list_opt_4(p):
'''module_port_list_opt : '(' error ')' '''
print('module_port_list_opt_4', list(p))
# { yyerror(@2, "Errors in port declarations.");
# yyerrok;
()
def p_module_port_list_opt_4(p):
'''module_port_list_opt : '(' error ')' '''
print('module_port_list_opt_4', list(p))
# { yyerror(@2, "Errors in port declarations.");
# yyerrok;
()
def p_module_parameter_port_list_2(p):
'''module_parameter_port_list : module_parameter_port_list ',' parameter_assign '''
print('module_parameter_port_list_2', list(p))
()
def p_module_parameter_port_list_2(p):
'''module_parameter_port_list : module_parameter_port_list ',' parameter_assign '''
print('module_parameter_port_list_2', list(p))
()
def p_module_parameter_port_list_3(p):
'''module_parameter_port_list : module_parameter_port_list ',' K_parameter param_type parameter_assign '''
print('module_parameter_port_list_3', list(p))
()
def p_module_parameter_port_list_3(p):
'''module_parameter_port_list : module_parameter_port_list ',' K_parameter param_type parameter_assign '''
print('module_parameter_port_list_3', list(p))
'''module_item : K_trireg charge_strength_opt dimensions_opt delay3_opt list_of_identifiers ';' '''
print('module_item_8', list(p))
# { yyerror(@1, "sorry: trireg nets not supported.");
'''module_item : K_trireg charge_strength_opt dimensions_opt delay3_opt list_of_identifiers ';' '''
print('module_item_8', list(p))
# { yyerror(@1, "sorry: trireg nets not supported.");
# if (dtype->implicit_flag)
# use_type = NetNet::NONE;
# else if (dtype->reg_flag)
# use_type = NetNet::REG;
# else
# use_type = NetNet::IMPLICIT_REG;
# if (dtype->implicit_flag)
# use_type = NetNet::NONE;
# else if (dtype->reg_flag)
# use_type = NetNet::REG;
# else
# use_type = NetNet::IMPLICIT_REG;
# }
()
def p_module_item_14(p):
'''module_item : attribute_list_opt port_direction net_type data_type_or_implicit error ';' '''
print('module_item_14', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
# }
()
def p_module_item_14(p):
'''module_item : attribute_list_opt port_direction net_type data_type_or_implicit error ';' '''
print('module_item_14', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
'''module_item : attribute_list_opt K_inout data_type_or_implicit error ';' '''
print('module_item_15', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
'''module_item : attribute_list_opt K_inout data_type_or_implicit error ';' '''
print('module_item_15', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
'''module_item : attribute_list_opt K_input data_type_or_implicit error ';' '''
print('module_item_16', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
'''module_item : attribute_list_opt K_input data_type_or_implicit error ';' '''
print('module_item_16', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
'''module_item : attribute_list_opt K_output data_type_or_implicit error ';' '''
print('module_item_17', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
'''module_item : attribute_list_opt K_output data_type_or_implicit error ';' '''
print('module_item_17', list(p))
# { yyerror(@2, "error: Invalid variable list in port declaration.");
# }
()
def p_module_item_36(p):
'''module_item : attribute_list_opt IDENTIFIER parameter_value_opt error ';' '''
print('module_item_36', list(p))
# { yyerror(@2, "error: Invalid module instantiation");
# }
()
def p_module_item_36(p):
'''module_item : attribute_list_opt IDENTIFIER parameter_value_opt error ';' '''
print('module_item_36', list(p))
# { yyerror(@2, "error: Invalid module instantiation");
- # { PExpr*tmp = $3;
- # pform_set_parameter(@1, lex_strings.make($1), param_active_type,
- # param_active_signed, param_active_range, tmp, $4);
- # delete[]$1;
+ tpname = Node(syms.tname, [Leaf(token.NAME, p[1])])
+ expr = Node(syms.tfpdef, [tpname, Leaf(token.EQUAL, p[2]), p[3] ])
+ p[0] = expr
+ # { PExpr*tmp = p[3];
+ # pform_set_parameter(@1, lex_strings.make(p[1]), param_active_type,
+ # param_active_signed, param_active_range, tmp, p[4]);
+ # delete[]p[1];
()
def p_parameter_value_opt_1(p):
'''parameter_value_opt : '#' '(' expression_list_with_nuls ')' '''
print('parameter_value_opt_1', list(p))
# { struct parmvalue_t*tmp = new struct parmvalue_t;
()
def p_parameter_value_opt_1(p):
'''parameter_value_opt : '#' '(' expression_list_with_nuls ')' '''
print('parameter_value_opt_1', list(p))
# { struct parmvalue_t*tmp = new struct parmvalue_t;
()
def p_parameter_value_byname_1(p):
'''parameter_value_byname : '.' IDENTIFIER '(' expression ')' '''
print('parameter_value_byname_1', list(p))
# { named_pexpr_t*tmp = new named_pexpr_t;
()
def p_parameter_value_byname_1(p):
'''parameter_value_byname : '.' IDENTIFIER '(' expression ')' '''
print('parameter_value_byname_1', list(p))
# { named_pexpr_t*tmp = new named_pexpr_t;
# }
()
def p_parameter_value_byname_2(p):
'''parameter_value_byname : '.' IDENTIFIER '(' ')' '''
print('parameter_value_byname_2', list(p))
# { named_pexpr_t*tmp = new named_pexpr_t;
# }
()
def p_parameter_value_byname_2(p):
'''parameter_value_byname : '.' IDENTIFIER '(' ')' '''
print('parameter_value_byname_2', list(p))
# { named_pexpr_t*tmp = new named_pexpr_t;
# }
()
def p_parameter_value_byname_list_1(p):
'''parameter_value_byname_list : parameter_value_byname '''
print('parameter_value_byname_list_1', list(p))
# { list<named_pexpr_t>*tmp = new list<named_pexpr_t>;
# }
()
def p_parameter_value_byname_list_1(p):
'''parameter_value_byname_list : parameter_value_byname '''
print('parameter_value_byname_list_1', list(p))
# { list<named_pexpr_t>*tmp = new list<named_pexpr_t>;
# }
()
def p_parameter_value_byname_list_2(p):
'''parameter_value_byname_list : parameter_value_byname_list ',' parameter_value_byname '''
print('parameter_value_byname_list_2', list(p))
# }
()
def p_parameter_value_byname_list_2(p):
'''parameter_value_byname_list : parameter_value_byname_list ',' parameter_value_byname '''
print('parameter_value_byname_list_2', list(p))
# }
()
def p_port_name_list_2(p):
'''port_name_list : port_name '''
print('port_name_list_2', list(p))
# { list<named_pexpr_t>*tmp = new list<named_pexpr_t>;
# }
()
def p_port_name_list_2(p):
'''port_name_list : port_name '''
print('port_name_list_2', list(p))
# { list<named_pexpr_t>*tmp = new list<named_pexpr_t>;
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::REG,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# }
()
def p_register_variable_list_1(p):
'''register_variable_list : register_variable '''
print('register_variable_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
# }
()
def p_register_variable_list_1(p):
'''register_variable_list : register_variable '''
print('register_variable_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
# }
()
def p_register_variable_list_2(p):
'''register_variable_list : register_variable_list ',' register_variable '''
print('register_variable_list_2', list(p))
# }
()
def p_register_variable_list_2(p):
'''register_variable_list : register_variable_list ',' register_variable '''
print('register_variable_list_2', list(p))
# pform_makewire(@1, name, NetNet::IMPLICIT,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# pform_makewire(@1, name, NetNet::IMPLICIT,
# NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0);
# }
()
def p_net_variable_list_1(p):
'''net_variable_list : net_variable '''
print('net_variable_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
# }
()
def p_net_variable_list_1(p):
'''net_variable_list : net_variable '''
print('net_variable_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
def p_specify_item_8(p):
'''specify_item : K_Sfullskew '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_8', list(p))
def p_specify_item_8(p):
'''specify_item : K_Sfullskew '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_8', list(p))
# }
()
def p_specify_item_10(p):
'''specify_item : K_Snochange '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_10', list(p))
# }
()
def p_specify_item_10(p):
'''specify_item : K_Snochange '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_10', list(p))
# }
()
def p_specify_item_11(p):
'''specify_item : K_Speriod '(' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_11', list(p))
# }
()
def p_specify_item_11(p):
'''specify_item : K_Speriod '(' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_11', list(p))
# }
()
def p_specify_item_12(p):
'''specify_item : K_Srecovery '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_12', list(p))
# }
()
def p_specify_item_12(p):
'''specify_item : K_Srecovery '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_12', list(p))
# }
()
def p_specify_item_13(p):
'''specify_item : K_Srecrem '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_13', list(p))
# }
()
def p_specify_item_13(p):
'''specify_item : K_Srecrem '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_13', list(p))
# }
()
def p_specify_item_14(p):
'''specify_item : K_Sremoval '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_14', list(p))
# }
()
def p_specify_item_14(p):
'''specify_item : K_Sremoval '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_14', list(p))
# }
()
def p_specify_item_15(p):
'''specify_item : K_Ssetup '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_15', list(p))
# }
()
def p_specify_item_15(p):
'''specify_item : K_Ssetup '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_15', list(p))
# }
()
def p_specify_item_16(p):
'''specify_item : K_Ssetuphold '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_16', list(p))
# }
()
def p_specify_item_16(p):
'''specify_item : K_Ssetuphold '(' spec_reference_event ',' spec_reference_event ',' delay_value ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_16', list(p))
# }
()
def p_specify_item_17(p):
'''specify_item : K_Sskew '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_17', list(p))
# }
()
def p_specify_item_17(p):
'''specify_item : K_Sskew '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_17', list(p))
# }
()
def p_specify_item_18(p):
'''specify_item : K_Stimeskew '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_18', list(p))
# }
()
def p_specify_item_18(p):
'''specify_item : K_Stimeskew '(' spec_reference_event ',' spec_reference_event ',' delay_value spec_notifier_opt ')' ';' '''
print('specify_item_18', list(p))
# }
()
def p_specify_item_19(p):
'''specify_item : K_Swidth '(' spec_reference_event ',' delay_value ',' expression spec_notifier_opt ')' ';' '''
print('specify_item_19', list(p))
# }
()
def p_specify_item_19(p):
'''specify_item : K_Swidth '(' spec_reference_event ',' delay_value ',' expression spec_notifier_opt ')' ';' '''
print('specify_item_19', list(p))
()
def p_specify_edge_path_decl_2(p):
'''specify_edge_path_decl : specify_edge_path '=' delay_value_simple '''
print('specify_edge_path_decl_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
()
def p_specify_edge_path_decl_2(p):
'''specify_edge_path_decl : specify_edge_path '=' delay_value_simple '''
print('specify_edge_path_decl_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
- # { int edge_flag = $2? 1 : -1;
- # $$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, false, $7, $9);}
+ # { int edge_flag = p[2]? 1 : -1;
+ # p[0] = pform_make_specify_edge_path(@1, edge_flag, p[3], p[4], false, p[7], p[9]);}
- # { int edge_flag = $2? 1 : -1;
- # $$ = pform_make_specify_edge_path(@1, edge_flag, $3, $4, true, $7, $9); }
+ # { int edge_flag = p[2]? 1 : -1;
+ # p[0] = pform_make_specify_edge_path(@1, edge_flag, p[3], p[4], true, p[7], p[9]); }
()
def p_specify_simple_path_decl_2(p):
'''specify_simple_path_decl : specify_simple_path '=' delay_value_simple '''
print('specify_simple_path_decl_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
()
def p_specify_simple_path_decl_2(p):
'''specify_simple_path_decl : specify_simple_path '=' delay_value_simple '''
print('specify_simple_path_decl_2', list(p))
# { list<PExpr*>*tmp = new list<PExpr*>;
# }
()
def p_specify_path_identifiers_4(p):
'''specify_path_identifiers : specify_path_identifiers ',' IDENTIFIER '''
print('specify_path_identifiers_4', list(p))
# }
()
def p_specify_path_identifiers_4(p):
'''specify_path_identifiers : specify_path_identifiers ',' IDENTIFIER '''
print('specify_path_identifiers_4', list(p))
# }
()
def p_statement_item_25(p):
'''statement_item : K_if '(' error ')' statement_or_null %prec less_than_K_else '''
print('statement_item_25', list(p))
# { yyerror(@1, "error: Malformed conditional expression.");
# }
()
def p_statement_item_25(p):
'''statement_item : K_if '(' error ')' statement_or_null %prec less_than_K_else '''
print('statement_item_25', list(p))
# { yyerror(@1, "error: Malformed conditional expression.");
# }
()
def p_statement_item_26(p):
'''statement_item : K_if '(' error ')' statement_or_null K_else statement_or_null '''
print('statement_item_26', list(p))
# { yyerror(@1, "error: Malformed conditional expression.");
# }
()
def p_statement_item_26(p):
'''statement_item : K_if '(' error ')' statement_or_null K_else statement_or_null '''
print('statement_item_26', list(p))
# { yyerror(@1, "error: Malformed conditional expression.");
# }
()
def p_statement_item_50(p):
'''statement_item : hierarchy_identifier K_with '{' constraint_block_item_list_opt '}' ';' '''
print('statement_item_50', list(p))
# { /* ....randomize with { <constraints> } */
# }
()
def p_statement_item_50(p):
'''statement_item : hierarchy_identifier K_with '{' constraint_block_item_list_opt '}' ';' '''
print('statement_item_50', list(p))
# { /* ....randomize with { <constraints> } */
# }
()
def p_statement_or_null_list_2(p):
'''statement_or_null_list : statement_or_null '''
print('statement_or_null_list_2', list(p))
# { vector<Statement*>*tmp = new vector<Statement*>(0);
# }
()
def p_statement_or_null_list_2(p):
'''statement_or_null_list : statement_or_null '''
print('statement_or_null_list_2', list(p))
# { vector<Statement*>*tmp = new vector<Statement*>(0);
# }
()
def p_udp_comb_entry_list_1(p):
'''udp_comb_entry_list : udp_comb_entry '''
print('udp_comb_entry_list_1', list(p))
# { list<string>*tmp = new list<string>;
# }
()
def p_udp_comb_entry_list_1(p):
'''udp_comb_entry_list : udp_comb_entry '''
print('udp_comb_entry_list_1', list(p))
# { list<string>*tmp = new list<string>;
# }
()
def p_udp_sequ_entry_list_1(p):
'''udp_sequ_entry_list : udp_sequ_entry '''
print('udp_sequ_entry_list_1', list(p))
# { list<string>*tmp = new list<string>;
# }
()
def p_udp_sequ_entry_list_1(p):
'''udp_sequ_entry_list : udp_sequ_entry '''
print('udp_sequ_entry_list_1', list(p))
# { list<string>*tmp = new list<string>;
()
def p_udp_input_list_1(p):
'''udp_input_list : udp_input_sym '''
print('udp_input_list_1', list(p))
# { char*tmp = new char[2];
()
def p_udp_input_list_1(p):
'''udp_input_list : udp_input_sym '''
print('udp_input_list_1', list(p))
# { char*tmp = new char[2];
- # { vector<PWire*>*tmp = $1;
- # size_t s1 = $1->size();
- # tmp->resize(s1+$2->size());
- # for (size_t idx = 0 ; idx < $2->size() ; idx += 1)
- # tmp->at(s1+idx) = $2->at(idx);
- # $$ = tmp;
- # delete $2;
+ # { vector<PWire*>*tmp = p[1];
+ # size_t s1 = p[1]->size();
+ # tmp->resize(s1+p[2]->size());
+ # for (size_t idx = 0 ; idx < p[2]->size() ; idx += 1)
+ # tmp->at(s1+idx) = p[2]->at(idx);
+ # p[0] = tmp;
+ # delete p[2];
# }
()
def p_udp_port_list_1(p):
'''udp_port_list : IDENTIFIER '''
print('udp_port_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
# }
()
def p_udp_port_list_1(p):
'''udp_port_list : IDENTIFIER '''
print('udp_port_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
()
def p_udp_input_declaration_list_1(p):
'''udp_input_declaration_list : K_input IDENTIFIER '''
print('udp_input_declaration_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
()
def p_udp_input_declaration_list_1(p):
'''udp_input_declaration_list : K_input IDENTIFIER '''
print('udp_input_declaration_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
# }
()
def p_udp_input_declaration_list_2(p):
'''udp_input_declaration_list : udp_input_declaration_list ',' K_input IDENTIFIER '''
print('udp_input_declaration_list_2', list(p))
# }
()
def p_udp_input_declaration_list_2(p):
'''udp_input_declaration_list : udp_input_declaration_list ',' K_input IDENTIFIER '''
print('udp_input_declaration_list_2', list(p))
- # { perm_string tmp2 = lex_strings.make($2);
- # pform_make_udp(tmp2, $4, $7, $9, $8,
+ # { perm_string tmp2 = lex_strings.make(p[2]);
+ # pform_make_udp(tmp2, p[4], p[7], p[9], p[8],
# }
()
def p_udp_primitive_2(p):
'''udp_primitive : K_primitive IDENTIFIER '(' K_output udp_reg_opt IDENTIFIER udp_initial_expr_opt ',' udp_input_declaration_list ')' ';' udp_body K_endprimitive endlabel_opt '''
print('udp_primitive_2', list(p))
# }
()
def p_udp_primitive_2(p):
'''udp_primitive : K_primitive IDENTIFIER '(' K_output udp_reg_opt IDENTIFIER udp_initial_expr_opt ',' udp_input_declaration_list ')' ';' udp_body K_endprimitive endlabel_opt '''
print('udp_primitive_2', list(p))
- # { perm_string tmp2 = lex_strings.make($2);
- # perm_string tmp6 = lex_strings.make($6);
- # pform_make_udp(tmp2, $5, tmp6, $7, $9, $12,
+ # { perm_string tmp2 = lex_strings.make(p[2]);
+ # perm_string tmp6 = lex_strings.make(p[6]);
+ # pform_make_udp(tmp2, p[5], tmp6, p[7], p[9], p[12],