From: Tobias Platen Date: Thu, 23 Jan 2020 14:08:02 +0000 (+0100) Subject: wire declarations X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc5639a123bbebea72067db60fc8111e4e88c987;p=sv2nmigen.git wire declarations --- diff --git a/parse_sv.py b/parse_sv.py index 2f70c59..08c2925 100644 --- a/parse_sv.py +++ b/parse_sv.py @@ -25,8 +25,8 @@ from lib2to3.pytree import Node, Leaf from lib2to3.pgen2 import token from lib2to3.pygram import python_symbols as syms -yacc1_debug = 1 -yacc2_debug = 1 +yacc1_debug = 0 +yacc2_debug = 0 parse_debug = 1 @@ -5541,7 +5541,10 @@ def p_expression_25(p): # FILE_NAME(tmp, @2); # p[0] = tmp; # } - p[0] = Node(syms.atom, [p[1], Leaf(token.MINUS, '-'), p[4]]) + try: + p[0] = Node(syms.atom, [p[1], Leaf(token.MINUS, '-'), p[4]]) + except: + p[0] = "bad input in p_expression_25" () @@ -8043,6 +8046,8 @@ def p_module_item_2(p): '''module_item : attribute_list_opt net_type data_type_or_implicit delay3_opt net_variable_list ';' ''' if(parse_debug): print('module_item_2', list(p)) + + p[0] = ["module_item_2"]+list(p) # { data_type_t*data_type = p[3]; # if (data_type == 0) { @@ -9169,10 +9174,10 @@ def p_bit_logic_opt_2(p): def p_net_type_1(p): '''net_type : K_wire ''' - if(parse_debug): + if(parse_debug>2): print('net_type_1', list(p)) - # { p[0] = NetNet::WIRE; } + p[0] = "wire" () @@ -10078,22 +10083,25 @@ def p_register_variable_list_2(p): def p_net_variable_1(p): '''net_variable : IDENTIFIER dimensions_opt ''' - if(parse_debug): + if(parse_debug>2): print('net_variable_1', list(p)) - + + p[0]= ('net_variable_1', list(p)) + # { perm_string name = lex_strings.make(p[1]); # pform_makewire(@1, name, NetNet::IMPLICIT, # NetNet::NOT_A_PORT, IVL_VT_NO_TYPE, 0); # pform_set_reg_idx(name, p[2]); - # p[0] = p[1]; + #p[0] = [p[1],p[2]] # } () def p_net_variable_list_1(p): '''net_variable_list : net_variable ''' - if(parse_debug): + if(parse_debug>2): print('net_variable_list_1', list(p)) + p[0] = ('net_variable_list_1', list(p)) # { list*tmp = new list; # tmp->push_back(lex_strings.make(p[1])); @@ -10105,8 +10113,9 @@ def p_net_variable_list_1(p): def p_net_variable_list_2(p): '''net_variable_list : net_variable_list ',' net_variable ''' - if(parse_debug): + if(parse_debug>2): print('net_variable_list_2', list(p)) + p[0] = ('net_variable_list_2', list(p)) # { list*tmp = p[1]; # tmp->push_back(lex_strings.make(p[3]));