Esempio n. 1
0
def main():
  parser = argparse.ArgumentParser(parents=[git.commands()], description='Helper to create designs')
  parser.add_argument('-doc', action='store_true', help='extended documentation in browser')
  parser.add_argument('-n', '--name', dest='name', default='', help='set design name and create structure (default name - current directory)')
  parser.add_argument('-v', '--version', dest='version', action='store_true', help='display package version')
  parser.add_argument('-tb', action = 'store_true', help = 'export project to active-hdl')
  parser.add_argument('-prog', action = 'store_true', help = 'run programmator')
  parser.add_argument('-edit', choices = ['default_build', 'toolchain'], help = 'edit default build.yaml file')
  args = parser.parse_args()

  if args.prog:
    if os.path.basename(os.getcwd()) == 'script':
      if not os.path.exists('../programmator'):
        os.mkdir('../programmator')
      os.chdir('../programmator')
    subprocess.Popen('python {}/Lib/site-packages/autohdl/programmator/programmator.py'.format(sys.prefix))
    sys.exit()

  if args.version:
    print 'autohdl version: ' + pkg_info.getVersion()
  elif args.doc:
    doc.handler('index')
  elif args.tb:
    hdlManager.kungfu()
  elif args.git:
    config = build.load()
    if not config:
      alog.info('Using default build.yaml (to see content: hdl.py -edit default_build)')
      config = build.default()
    config.update({'git':args.git})
    git.handle(config)
  elif args.edit:
    if args.edit == 'default_build':
      subprocess.Popen('notepad {}/Lib/site-packages/autohdl/data/build.yaml'.format(sys.prefix))
    elif args.edit == 'toolchain':
      subprocess.Popen('notepad {}/Lib/site-packages/autohdl_cfg/toolchain.yaml'.format(sys.prefix))
  else:
#    dsn = structure.Design(iName = args.name)
    dsn = structure.generate(path = args.name)
    git.initialize(args.name if args.name else '.')
    print dsn
Esempio n. 2
0
from autohdl import hdlManager
# There are 3 scopes while setting design configuration.
# Priority: 1 - argument list, 2 - this script, 3 - build.yaml

hdlManager.kungfu(
  # Set top module name.
  # top = '',

  # Set constraint file.
  # Could be a valid relative path (keep in mind repo)
  # or just a name, if it locates in the current design folder.
  # ucf = '',

  # Set flash size (e.g. 256, 512)
  # size = '',

  # Uncomment to upload firmware on WebDAV server.
  # upload = True
)
Esempio n. 3
0
from autohdl import hdlManager
# There are 3 scopes while setting design configuration.
# Priority: 1 - argument list, 2 - this script, 3 - build.yaml

hdlManager.kungfu(
	# Set top module name.
	# iTop = '',

  # Set constraint file.
  # Could be a valid relative path (keep in mind repo)
  # or just a name, if it locates in the current design folder.
	# iUcf = '',

  # Set flash size (*examples*)
	# iSize = '',

  # Uncomment to upload firmware on WebDAV server.
  # iUpload = 'True'
)