Tutorial: Creating a Custom Bitfile: Difference between revisions

From Cpre584
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:


== Building a Bitfile ==
== Building a Bitfile ==
Copy rev 2011_11_22 of the [[Running the Vector Adder Example Application#Compiling the Project|example project]] and set your [[Convey environment setup|environment variables]] if you have not done so already.  You can make a small modification to the verilog code if you wish.
Copy rev 2011_11_22 of the [[Running the Vector Adder Example Application#Compiling the Project|example project]] and set your [[Convey environment setup|environment variables]] if you have not done so already.  You can make a small modification to the verilog code if you wish, such as making it a vector subtractor instead of a vector adder.
 
Next, compile your bitfile:


  cd ~/pdk_sample/cae_vadd/phys
  cd ~/pdk_sample/cae_vadd/phys
  make
  make


The bitfile will take a long time to create (while the Reference Manual states 2 to 4 hours; mine took 18 hours to finish).  Be patient.
The bitfile will take a long time to create (while the Reference Manual states 2 to 4 hours; it will take much longer).  Be patient.
 
== Packaging the Bitfile ==
 
cd ~/pdk_sample/cae_vadd/phys
make release


This will create a new directory (~/pdk_sample/cae_vadd.release/).  The important file that is created is named cae_fpga.tgz.
== Choose a New Signature ==
Custom personalities should not use the default pdk signature (4.1.1.1.0).  Choose a new signature above 65000.  In this example, we will use 65123.1.1.1.0.


== Installing the Bitfile ==
You will need to create a new directory and copy the pertinent files to this directory:


Follow the instructions for packaging your bitfiles:
cd /opt/convey/personalities
* [[Media:ConveyPDKReferenceManual.pdf | Convey PDK Reference Manual (.pdf)]] - Appendix D
mkdir 65123.1.1.1.0
cd 65123.1.1.1.0
cp /home/PROJECT_PATH/phys/cae_fpga.bit  ./ae_fpga.bit


== Choosing a Signature ==
Copy some files from the default PDK folder to your new folder.  You may wish to edit PersDesc.dat and uncomment additional custom instructions you have used.


The documentation (Section 10.1.2.1 of PDK Ref) also mentions doing the following:
cp /opt/convey/personalities/4.1.1.1.0/PersDesc.dat ./
cp /opt/convey/personalities/4.1.1.1.0/init.txt    ./
cp /opt/convey/personalities/4.1.1.1.0/rest.o      ./
cp /opt/convey/personalities/4.1.1.1.0/save.o      ./
cp /opt/convey/personalities/4.1.1.1.0/zero.o      ./


cp  –r /opt/convey/personalities/4.1.1.1.0  ~/'''#number=>65000#'''.1.1.1.0
Instead of altering Convey's personality folder, you may set the CNY_PERSONALITY_PATH environment variable to the directory just created, i.e.


Edit readme and PersDesc.dat.
export CNY_PERSONALITY_PATH=/home/PROJECT_PATH/
  or
setenv CNY_PERSONALITY_PATH /home/PROJECT_PATH/


You will also need to update the ''customdb'' file in /opt/convey/personalities (or create your own customdb file in your user defined personalities folder). 


Finally, you need to always set the CNY_PERSONALITY_PATH environment variable to
echo 65123.1.1.1.0,subtractor >> customdb
the directory just created, i.e.


    export CNY_PERSONALITY_PATH=/home/my_dir/
Finally, there are certain places in the code where you should ensure that the signature has been updated.
    or
    setenv CNY_PERSONALITY_PATH  /home/my_dir/


where /home/my_dir is your home directory or the directory '''#number=>65000#'''.1.1.1.0 was created
* In the simulator (/sim/CaeIsaVadd.cpp), update: #define PERS_SIGN_CAE 0xfe63001000101000LL, where 0xfe63 is the hex value for your signature (65123).
in.
* In the C code, (SampleAppVadd/UserApp.c) update: cny_get_signature("subtractor", &sig, &sig2, &stat);, where "subtractor" is the pseudo name of your CAE given in the customdb file.
* In the assembly code, (SampleAppVadd/cpVadd.s) update the signature directive: .signature pdk=65165


After implementing the AE software model, copy the AE software model executable into
Additional details are available in Appendix D of the [[Media:ConveyPDKReferenceManual.pdf | Convey PDK Reference Manual (.pdf)]].
the '''#number=>65000#'''.1.1.1.0/ directory with the file name caeemulator.  This allows the model to be
automatically executed when the personality is dispatched by an application. 
Alternatively, the CNY_CAE_EMULATOR can be used to define the full pathname of the
AE software model executable


== See Also ==
== See Also ==

Revision as of 20:55, 23 May 2012

This page covers the creation and installation of a custom personality/bitfile (a modification of the vector adder sample project).

Building a Bitfile

Copy rev 2011_11_22 of the example project and set your environment variables if you have not done so already. You can make a small modification to the verilog code if you wish, such as making it a vector subtractor instead of a vector adder.

Next, compile your bitfile:

cd ~/pdk_sample/cae_vadd/phys
make

The bitfile will take a long time to create (while the Reference Manual states 2 to 4 hours; it will take much longer). Be patient.

Choose a New Signature

Custom personalities should not use the default pdk signature (4.1.1.1.0). Choose a new signature above 65000. In this example, we will use 65123.1.1.1.0.

You will need to create a new directory and copy the pertinent files to this directory:

cd /opt/convey/personalities
mkdir 65123.1.1.1.0
cd 65123.1.1.1.0

cp /home/PROJECT_PATH/phys/cae_fpga.bit  ./ae_fpga.bit

Copy some files from the default PDK folder to your new folder. You may wish to edit PersDesc.dat and uncomment additional custom instructions you have used.

cp /opt/convey/personalities/4.1.1.1.0/PersDesc.dat ./
cp /opt/convey/personalities/4.1.1.1.0/init.txt     ./
cp /opt/convey/personalities/4.1.1.1.0/rest.o       ./
cp /opt/convey/personalities/4.1.1.1.0/save.o       ./
cp /opt/convey/personalities/4.1.1.1.0/zero.o       ./

Instead of altering Convey's personality folder, you may set the CNY_PERSONALITY_PATH environment variable to the directory just created, i.e.

export CNY_PERSONALITY_PATH=/home/PROJECT_PATH/
  or
setenv CNY_PERSONALITY_PATH /home/PROJECT_PATH/

You will also need to update the customdb file in /opt/convey/personalities (or create your own customdb file in your user defined personalities folder).

echo 65123.1.1.1.0,subtractor >> customdb

Finally, there are certain places in the code where you should ensure that the signature has been updated.

  • In the simulator (/sim/CaeIsaVadd.cpp), update: #define PERS_SIGN_CAE 0xfe63001000101000LL, where 0xfe63 is the hex value for your signature (65123).
  • In the C code, (SampleAppVadd/UserApp.c) update: cny_get_signature("subtractor", &sig, &sig2, &stat);, where "subtractor" is the pseudo name of your CAE given in the customdb file.
  • In the assembly code, (SampleAppVadd/cpVadd.s) update the signature directive: .signature pdk=65165

Additional details are available in Appendix D of the Convey PDK Reference Manual (.pdf).

See Also

References