Skip to content
Snippets Groups Projects
Commit 37fbe789 authored by Daniel van der Schuur's avatar Daniel van der Schuur
Browse files

-Added more instructions to readme.txt;

-Added [library] argument to Python scripts.
parent 55d0e029
Branches
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
import os import os
from shutil import copyfile from shutil import copyfile
import sys
""" """
Recursively find occurences of fname in dirname, returns them as list. Recursively find occurences of fname in dirname, returns them as list.
...@@ -30,8 +31,16 @@ def find_files(fname, dirname): ...@@ -30,8 +31,16 @@ def find_files(fname, dirname):
############################################################################### ###############################################################################
if __name__== '__main__': if __name__== '__main__':
arg_lib = None
if len(sys.argv)>1:
arg_lib = sys.argv[0]
for hdllib_file in find_files('hdllib.cfg', '.') : for hdllib_file in find_files('hdllib.cfg', '.') :
core_lib = os.path.dirname(hdllib_file).split('/')[-1]+'_lib'
if core_lib==arg_lib or arg_lib==None:
# Set the current target path (hdllib.cfg dir) # Set the current target path (hdllib.cfg dir)
target_path = os.path.abspath(os.path.dirname(hdllib_file))+'/' target_path = os.path.abspath(os.path.dirname(hdllib_file))+'/'
...@@ -59,5 +68,3 @@ if __name__== '__main__': ...@@ -59,5 +68,3 @@ if __name__== '__main__':
print 'Warning: could not copy', vhd_file, found_files, 'to', target_path print 'Warning: could not copy', vhd_file, found_files, 'to', target_path
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
from copy_source_files import find_files from copy_source_files import find_files
import os import os
import sys
REPLACE_LIST = [ REPLACE_LIST = [
...@@ -74,6 +75,14 @@ REPLACE_LIST = [ ...@@ -74,6 +75,14 @@ REPLACE_LIST = [
for vhd_file in find_files('*.vhd', '.'): for vhd_file in find_files('*.vhd', '.'):
core_lib = os.path.dirname(vhd_file).split('/')[-1]+'_lib' core_lib = os.path.dirname(vhd_file).split('/')[-1]+'_lib'
arg_lib = None
if len(sys.argv)>1:
arg_lib = sys.argv[0]
if core_lib==arg_lib or arg_lib==None:
print 'Editing', vhd_file print 'Editing', vhd_file
# Read the VHDL file into a list # Read the VHDL file into a list
...@@ -131,4 +140,3 @@ for vhd_file in find_files('*.vhd', '.'): ...@@ -131,4 +140,3 @@ for vhd_file in find_files('*.vhd', '.'):
f.close() f.close()
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
Summary Summary
======= =======
This directory contains vertically grouped versions of the horizontal RadioHDL This directory contains vertically grouped versions of the horizontal RadioHDL
HDL libraries, intended to be uploaded to OpenCores. It cannot harm the current HDL libraries, stored on an external OpenCores repository. It cannot harm the
horizontal libraries, yet it syncs the vertical libs with the horizontal ones, current horizontal libraries, yet it syncs our vertical RadioHDL libs with
and provides a clean migration possibility. the vertical 'cores':
$RADIOHDL/libraries : untouched
$RADIOHDL/cores : Cores from Opencores repo = modified copies of
$RADIOHDL/libraries source files.
Introduction Introduction
============ ============
...@@ -23,19 +27,53 @@ organized differently: ...@@ -23,19 +27,53 @@ organized differently:
The original horizontal organization is however still maintained as directory The original horizontal organization is however still maintained as directory
structure; e.g. all vertical 'dp' cores are in the 'dp' directory. structure; e.g. all vertical 'dp' cores are in the 'dp' directory.
copy_source_files.py copy_source_files.py [library]
==================== ==============================
This script copies the source files from the horizontal RadioHDL repository, This script copies the source files from the horizontal RadioHDL repository,
with the purpose of: with the purpose of:
1) Keeping this 'cores' library in sync with our 'official' RadioHDL library, 1) Keeping this 'cores' library in sync with our 'official' RadioHDL library,
without risk of doing damage to it. without risk of doing damage to it.
2) Provide option to migrate to this vertical for by calling 'svn move' 2) Provide option to migrate to this vertical for by calling 'svn move'
If no argument is passed, it will copy/overwrite ALL source files listed in the
hdllib.cfg files.
Pass a library name to copy only the source files for a specific library (e.g.
common_pkg).
edit_source_files.py edit_source_files.py [library]
==================== ==============================
This script edits the copied files such that: This script edits the copied files such that:
1) the included horizontal libraries at the top are replaced by vertical ones; 1) the included horizontal libraries at the top are replaced by vertical ones;
2) the horizontal libraries named in the instantiations are replaced with 2) the horizontal libraries named in the instantiations are replaced with
vertical ones. vertical ones.
If no argument is passed, it will edit/overwrite ALL source files listed in the
hdllib.cfg files.
Pass a library name to edit only the source files for a specific library (e.g.
common_pkg).
How this is organized in SVN
============================
The actual 'core' directories (such as base/common/common_pkg) don't exist on
our own RADIOHDL SVN server. They are pulled in from the OpenCores repository.
An example command to set this up in SVN is shown below (svn propset).
How to add a new 'core'
=======================
1) Go to OpenCores.org, log in, create new project with name 'my_project'.
2) After it is approved, include it in our RADIOHDL repository by defining
an external repo by running the following command in the desired parent
directory:
$ svn propset svn:externals -F svn_propset_file .
For this project, add the following line to svn_propset_file:
my_project https://opencores.org/ocsvn/my_project/my_project/trunk/
The svn_propset_files are in SVN in their respective folders.
3) Commit this SVN folder setting
4) SVN update; you will now get the project folder from the OpenCore repo.
5) Add an hdllib.cfg file to the project dir, add source files (without path).
6) Run: $ copy_source_files my_project
7) Run: $ edit_source_files my_project
8) Try the project in simulation, if it works: SVN commit to to OpenCores.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment