projects
/
sv2nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e09f8b2
)
wire declarations
author
Tobias Platen
<tplaten@posteo.de>
Thu, 23 Jan 2020 14:08:02 +0000
(15:08 +0100)
committer
Tobias Platen
<tplaten@posteo.de>
Thu, 23 Jan 2020 14:08:02 +0000
(15:08 +0100)
parse_sv.py
patch
|
blob
|
history
diff --git
a/parse_sv.py
b/parse_sv.py
index 2f70c5945ba6caf90c792ad8e7339776e46526f6..08c2925c93fbb75b52f89fcc5a60ae389629523b 100644
(file)
--- 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
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
parse_debug = 1
@@
-5541,7
+5541,10
@@
def p_expression_25(p):
# FILE_NAME(tmp, @2);
# p[0] = tmp;
# }
# 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))
'''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) {
# { 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 '''
def p_net_type_1(p):
'''net_type : K_wire '''
- if(parse_debug):
+ if(parse_debug
>2
):
print('net_type_1', list(p))
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 '''
def p_net_variable_1(p):
'''net_variable : IDENTIFIER dimensions_opt '''
- if(parse_debug):
+ if(parse_debug
>2
):
print('net_variable_1', list(p))
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]);
# { 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 '''
# }
()
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))
print('net_variable_list_1', list(p))
+ p[0] = ('net_variable_list_1', list(p))
# { list<perm_string>*tmp = new list<perm_string>;
# tmp->push_back(lex_strings.make(p[1]));
# { list<perm_string>*tmp = new list<perm_string>;
# 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 '''
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))
print('net_variable_list_2', list(p))
+ p[0] = ('net_variable_list_2', list(p))
# { list<perm_string>*tmp = p[1];
# tmp->push_back(lex_strings.make(p[3]));
# { list<perm_string>*tmp = p[1];
# tmp->push_back(lex_strings.make(p[3]));