NetFPGA Tips
Some tips for developing NetFPGA code using the standard framework (version 2).
Environment variables
Make sure that the following environment variables are set:
- NF_ROOT (something like /home/<username>/netfpga etc.)
- NF_WORK_DIR (/tmp/<username> works OK)
- NF_DESIGN_DIR (${NF_ROOT}/projects/CURRENT_DESIGN)
- PATH should include ${NF_ROOT}/bin
- LD_LIBRARY_PATH should include ${NF_ROOT}/lib/java/NetFPGAFrontEnd/bin
- PERL5LIB should include ${NF_DESIGN_DIR}/lib/Perl5 and ${NF_ROOT}/lib/Perl5
- PYTHONPATH should include ${NF_ROOT}/lib/python
Also a bunch of Xilinx and ModelSim related Env Vars such as:
- XILINX
- XILINXD_LICENSE_FILE
- CHIPSCOPE
- LMC_HOME
- MODEL_TECH
In particular, when starting a new project, make sure the NF_DESIGN_DIR is set correctly!
New designs
Recommendation is to start off by copying an existing reference design from the projects directory into a new directory with an appropriate PROJ_NAME. Then update $NF_DESIGN_DIR to reflect the path to this new $PROJ_NAME:
export NF_DESIGN_DIR=${NF_ROOT}/projects/${PROJ_NAME}
(or where ever you put your new project directory).
Most reference designs do not include a "src" directory under $PROJ_NAME. Good idea to make one. Any module.v files that need to be modified from the lib/verilog tree can be copied into this directory, and they will take precedence over the ones from the lib/verilog tree (assuming the file names and module names remain the same). Any other .v files required should also be placed in this directory. Update the include/project.xml file and start coding.
Create a test/both_maj_min with a run.py file (or copy an existing one). Edit the run.py file to suit (and learn some Python along the way!). Then, with the above env. variable set correctly, run:
nf_test.py sim --major maj --minor min
and watch all the beauty unfold (maj and min can be anything you want, of course). When the simulation is complete, there will be a bunch of files in $NF_WORK_DIR/test/<projname>/both_maj_min that can be looked at to get details of what, if anything, went wrong.
ModelSim tips
Many - please fill me in...