What is phdl_utils?
phdl_utils is a java utility that generates PHDL device declarations from three different possible input files. Within the phdl_utils package there are three different utilities:
CSV2PHDL is a utility that converts a Comma Seperated Value file to a PHDL device declaration.
In the csv file the first column should be the pin number (physical-pin name) and the second column should be the signal name or (logical-pin name).
Repeated signal names are converted into bus pins.
Signal names that end in a number are converted into bus pins.
FPGA design generally involves port declarations and user-constraints that make it easier to read and understand what and where each IO port is. To propogate this benefit, Xilinx2PHDL generates a PHDL FPGA device declaration with the RTL port declaration names as pin names in PHDL, with their respective pin mappings as defined in a .csv file outputted by Xilinx tools.
The csv file is generated by Xilinx on synthesis and defines what internal signals in the FPGA design go to which physical pins, as well as which physical pins should be used externally for power and gnd pins.
The needed csv file can be found in the ISE Project folder after synthesis and will be called <foo>_PAD.csv where <foo> is the name of your top level ISE Project design.
Xilinx2PHDL takes this .csv file and generates a representative PHDL FPGA device declaration that can be included in the user's PHDL design.
Actel2PHDL does the same as the Xilinx2PHDL utility but runs on the files generated by Actel's development software.
phdl_utils can be installed by using a JAR file. It can be downloaded here.
Then you can optionally extract the jar, using the command:
jar xf phdl_utils.jar
How to Use phdl_utils
If you decided to extract the jar file, first navigate to the
folder where you extracted it, and the utility can be executed
by typing the following onto the command line:
java phdl_utils.CSV2PHDL filename.csv > filename.phdl
If you decided to not extract the jar file, navigate to the
folder where the jar is located and execute the utility by
typing the following:
java -cp phdl_utils.jar phdl_utils.CSV2PHDL filename.csv > filename.phdl
Where CSV2PHDL can be replaced by either Xilinx2PHDL or Actel2PHDL.
(The above assumes that "." is on your classpath variable.)
This utility was contributed by Pete Dudley.