OpenCores
URL https://opencores.org/ocsvn/ssbcc/ssbcc/trunk

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [ssbccUtil.py] - Diff between revs 9 and 11

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 9 Rev 11
Line 112... Line 112...
  """
  """
  Test the string to see if it is a well-formatted integer or multiplication of
  Test the string to see if it is a well-formatted integer or multiplication of
  two integers.
  two integers.
  Allow underscores as per Verilog.
  Allow underscores as per Verilog.
  """
  """
  if re.match(r'-?[1-9][0-9_]*',value):
  if re.match(r'(0|-?[1-9][0-9_]*)$',value):
    return True;
    return True;
  elif re.match(r'\(-?[1-9][0-9_]*(\*[1-9][0-9_]*)+\)',value):
  elif re.match(r'(-?[1-9][0-9_]*\(\*[1-9][0-9_]*\)+)$',value):
    return True;
    return True;
  else:
  else:
    return False;
    return False;
 
 
def IsPosInt(v):
def IsPosInt(v):

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.