JHDL 0.2
| JHDL Doc Home Page | Getting Started Home Page | << | < | > | >>
After a design has been verified using simulation, JHDL makes it possible to netlist the design. The style of netlist will depend on the target platform. Generally, it will be a hierarchical EDIF netlist.
Netlisting is generally accomplished as part of the testbench. In order to netlist, you must first create a techmapper object. This object will have a netlist method which can be called to create the netlist. For example, if you are creating a design for a Xilinx 4k part, you would use the XC4000TechMapper.
The following example illustrates the use of a test bench to netlist an instance of the NBitAdder class.
import byucc.jhdl.base.*;
// The next 3 are needed for netlisting and simulation
import byucc.jhdl.Logic.*;
import byucc.jhdl.Xilinx.*;
import byucc.jhdl.Xilinx.XC4000.*;
public class tb_12BitAdder extends Synchronous implements TestBench {
private Wire a;
private Wire b;
private Wire sum;
private Cell adder;
private XC4000TechMapper tmapper;
public tb_12BitAdder(Node parent) {
super(parent);
// Set up the techmapper
tmapper = new XC4000TechMapper(true);
// Set default techmapper before instancing the circuit
Logic.setDefaultTechMapper(tmapper);
// Create the wires to pass into the NBitAdder
a = Logic.wire(this,12);
b = Logic.wire(this,12);
sum = Logic.wire(this,13);
// Instance a 12 bit adder
adder = new NBitAdder(this,a,b,sum,12);
// Netlist the design and output to file 12BitAdder.edn
tmapper.netlist(adder,"12BitAdder.edn");
}
public static void main(String args[]) {
// Instantiate the top level hardware system
HWSystem system = new HWSystem();
// Declare and instance the testbench object
tb_12BitAdder tb = new tb_12BitAdder(system);
// Constructor will generate netlist, so we are done.
}
// clock() and reset() method needed because the test bench extends
// Synchronous. Because we are only netlisting, they do not need to
// do anything
public void clock() {}
public void reset() {}
}
When the above design is executed with the following command:
java tb_12BitAdder
The program will create an edif netlist of the 12-bit adder described in the NBitAdder class.
After creating the netlist, you will need to run the back-end tools for the FPGA of interest. This may require you to manually run a number of tools or there may be a Makefile or script which will handle the execution of all the backend tools for you. For example, the following Unix script file may be used to run the back-end tools targetting the Xilinx XC4000 family of FPGAs.
#!/bin/csh -f
clear
set root = $1
#set part = 4036xl-1hq240
set part = 4062xl-1bg432
echo "Ngdbuild is starting."
ngdbuild -p $part $root $root.ngd | tee ngdbuild.log
if ($status != 0) then
echo "Ngdbuild did not succesfully finish, please check ngdbuild.log."
echo "for errors."
exit
endif
echo ""
echo "Mapping is starting."
map -c $root.ngd -o $root.ncd
if ($status != 0) then
echo MAP did not succesfully finish, please check the $root.rpt report
echo "for errors."
exit
endif
echo "PAR is starting."
par -w $root.ncd ${root}_r.ncd $root.pcf
if ($status != 0) then
echo PAR did not succesfully finish, please check the ${root}_r.ncd.par report
echo "for errors."
exit
endif
echo "TRACE is starting."
trce -a ${root}_r.ncd $root.pcf
if ($status != 0) then
echo "TRACE did not succesfully finish, please check the $TRACENCD.twr report"
echo "for errors."
exit
endif
echo "All done....."
This script runs the following Xilinx Tools:
This script runs the circuit through the M1 tools all the way to timing analysis. It creates report files and .ncd files with circuit information that can be used to generate the bitstreams for your part.
| JHDL Doc Home Page | Getting Started Home Page | << | < | > | >>
Copyright (c) 1998-1999 Brigham Young University. All
rights reserved.
Reproduction in whole or in part in any form or
medium without express permission of Brigham Young University is
prohibited.