Skip to content

Commit 5724967

Browse files
committed
lib_fsm and lib_bundle are updated for path search problem
1 parent 7ff3b47 commit 5724967

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

veriloggen/lib/bundle.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import os
22
import sys
33
import re
4-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
54

6-
import vtypes
7-
import module
5+
if sys.version_info[0] >= 3:
6+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
7+
import vtypes
8+
import module
9+
else:
10+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
11+
import veriloggen.vtypes as vtypes
12+
import veriloggen.module as module
813

914
class Bundle(vtypes.VeriloggenNode):
1015
def __init__(self, m, prefix='', postfix=''):

veriloggen/lib/fsm.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
import sys
33
import collections
44

5-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
6-
import vtypes
5+
if sys.version_info[0] >= 3:
6+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
7+
import vtypes
8+
else:
9+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
10+
import veriloggen.vtypes as vtypes
711

812
class FSM(vtypes.VeriloggenNode):
913
""" Finite State Machine Generator """

veriloggen/vtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def type_check_condition(self, *args):
509509
if a is None:
510510
raise ValueError("None condition must not mixed in When() statement.")
511511
if isinstance(a, (_Numeric, int, float, str)): continue
512-
raise TypeError("Condition shuold be Numeric value.")
512+
raise TypeError("Condition must be _Numeric object, not '%s'" % str(type(a)))
513513

514514
def type_check_statement(self, *args):
515515
pass

0 commit comments

Comments
 (0)