Skip to content

Instantly share code, notes, and snippets.

@KaanErgun
Last active August 23, 2023 12:00
Show Gist options
  • Save KaanErgun/ce89b0f270cffe08a3f33e1dd90240e0 to your computer and use it in GitHub Desktop.
Save KaanErgun/ce89b0f270cffe08a3f33e1dd90240e0 to your computer and use it in GitHub Desktop.
import os
def create_directory_structure(project_name):
# Base directories
base_dirs = [
'docs',
'hdl/src',
'hdl/tb',
'ipcores/src',
'ipcores/tb',
'constraints',
'scripts',
'sim/modelsim/work',
'sim/modelsim/wave',
'sim/logs',
'synthesis/vivado/runs',
'synthesis/vivado/logs',
'synthesis/vivado/checkpoints',
'synthesis/reports',
'output'
]
# Check if main project directory exists
if os.path.exists(project_name):
print(f"Directory '{project_name}' already exists!")
return
# Create directories
for dir in base_dirs:
os.makedirs(os.path.join(project_name, dir))
print(f"Directory structure for '{project_name}' created successfully!")
if __name__ == "__main__":
import sys
if len(sys.argv) != 2:
print("Usage: python init_xilinx_project.py <ProjectName>")
sys.exit(1)
project_name = sys.argv[1]
create_directory_structure(project_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment