Oooops, sorry, I've unintentionally clicked "publish" before my message was ready :-( Here it is again in a complete form.
I'm working at a big project with multiple developers and we also want to b e able to share sources in a version controlled friendly. The project mainly uses X... FPGAs and V... tools.
One of possible approaches was to use IP packager, however it seems that it is not possible, or at least discouraged to use IP cores with port defined as VHDL records (just imagine a few AXI ports as bits and bit vectors, and compare it to the clean design of IPbus with record based ports -
formatting link
) The another approach I've proposed is based on extension of the old good PR J files. The file may contain lines of following types: - type library file (Line defining the source file Possible types: vhdl, verilog, system, header. xci, xdc File name (path in fact) is defined relatively to the location of the PRJ file) - include file (Line defining the include file File name (path in fact) is defined relatively to the location of the PRJ file)
Use of relative paths allows easy reuse of so defined blocks. Use of simple text files makes such solution SVN/GIT friendly
I've prepared a simple routine, which translates PRJ file (with included files) to the list of files, based on the "prj_add" routine from UG946 tutorial.
Here it is:
# Procedure below reads the source files from PRJ files, extended with # the "include file" statement
#Important thing - path to the source files should be given relatively #to the location of the PRJ file. proc read_prj { prj } { #initialize results to an empty list set res [] if {[file exists $prj]} { puts "\tReading PRJ file: $prj" set source [open $prj r] set source_data [read $source] close $source #Extract the directory of the PRJ file, as all paths to the #source files must be given relatively to that directory set prj_dir [ file dirname $prj ] regsub -all {\"} $source_data {} source_data set prj_lines [split $source_data "\n" ] set line_count 0 foreach line $prj_lines { incr line_count #Ignore empty and commented lines if {[llength $line] > 0 && ![string match -nocase "#*" $line]} { #Detect the inlude line lassign $line type file if {[string match -nocase $type "include"]} { puts "\tIncluding PRJ file: $prj_dir/$file" set inc [ read_prj $prj_dir/$file ] foreach l $inc { lappend res $l } } else { lappend res [linsert $line 0 $prj_dir] } } } } return $res }
Of course the above procedure is a quick&dirty solution lacking the full er ror detection.
Anyway it is possible to define each IP block as a tree of directories cont aining sources and associated extended PRJ files.
The main disadvantage is that this approach is not supported by the tool ve ndor, so it is unclear whether it will work with the future versions...
Maybe this idea may be somehow improved?
With best regards, Wojtek