JHDL 0.3.39

| JHDL Doc Home Page | User's Manual Home Page |


JHDL Template Generators


After completing a few designs in JHDL or any other HDL or computer programming language you will notice that there is quite a bit of syntax that will be duplicated in most of your designs.  This syntax can get tedious if you are one to crank out a lot of designs over a short period of time or you may just forget how to do it all if you create just a few stretched over a long period of time.  Either way, the programs in this section are designed to help you get your designs done faster by writing most of that syntax for you when you start a design.

At this point, the following template generators are available:


NewJHDL

Getting started quickly with NewJHDL doesn't take much explaining.  NewJHDL is contained in the JHDL.jar file of JHDL release 2.3.1 and beyond.  With JHDL.jar in your classpath, you can invoke it simply by typing the command java NewJHDL from the command line.  It will also take an optional argument that is the name of the class being created.  If the optional argument is not supplied on the command line, NewJHDL will ask for the name of the class to be created before going on to anything else.  NewJHDL will create the class in the current directory in a file named after the jhdl class with the suffix .java appended to it.

NewJHDL will ask you a series of questions about your new design.  The following list of information will need to be provided.  Note that any fields can be left out by simply leaving them blank and hitting enter.

After you have entered your last Output NewJDHL will provide you with a summary of the class to be created and give you a menu of options.  I suspect that 99% of the time you will want to just accept what you have entered, write out the .java file and quit.  To do this just hit w followed by Enter and open up the new file.  The other options provided are there to give you a second change to get any part of the class right without having to go through the whole thing again.  If you see something wrong or something that you ommited just hit the key corresponding to what you would like to change or add and follow the instructions.  It will be just like what you did above to enter the information in the first place.

The following is a screen dump from a complete NewJHDL session that created the file  newclass.java .

--- Begin screen dump ---
ccl15.ee.byu.edu:/tmp/jhdl> java NewJHDL newclass
JHDL template generator, version 2.4, by Carl Baldwin
 

Package name: byucc.project.packagename
MESSAGE: Logic and base will automatically be imported
Import: byucc.project.*
Import:
Shall I extend Logic(Y,n)?: n
Extends: jhdlpart
Implements: interface1
Implements: interface2
Implements:
Input name: In1
        Width: wid
Input name: In2
        Width: wid2
Input name: In3
        Width: 1
Input name:
Output name: Out1
        Width: wid+1
Output name: Out2
        Width: wid2*2
Output name:

*****************************************************************************
*        Summary of class newclass
*****************************************************************************

Summary of class newclass:
        PACKAGE: byucc.project.packagename
        IMPORT(0): byucc.project.*
        EXTENDS: jhdlpart
        IMPLEMENTS(0): interface1
        IMPLEMENTS(1): interface2

INTERFACE
        NAMES           WIDTH           DIRECTION
(0)     "In1"           "wid"           "in"
(1)     "In2"           "wid2"          "in"
(2)     "In3"           "1"             "in"
(0)     "Out1"          "wid+1"         "out"
(1)     "Out2"          "wid2*2"        "out"

Summary of symbolic widths used in class
        wid
        wid2

Now that you have defined your class choose from the following menu or just hit enter:
        Change (C)LASS name
        Change (P)ACKAGE name
        Change (I)MPORT name
        Change (E)XTENDS
        Change I(M)PLEMENTS
        Change an I(N)PUT
        Change an (O)UTPUT
        (W)rite and quit
        (A)bort
Your choice:
File newclass.java has been written in the current directory
ccl15.ee.byu.edu:/tmp/jhdl>
--- End screen dump ---


NewTB

The first thing that you want to do before attempting to use NewTB is to create the class for the design that you want to test, and make sure that it compiles and that the .class file is found in your classpath.  For help in doing this quickly see the section on NewJHDL above.  This is because NewTB uses reflection to obtain the information about a design that it needs to write the interfacing testbench circuit.

NewTB is also included in the JHDL.jar file of JHDL release 2.3.1 and beyond.  To invoke NewTB type java NewTB on the command line.   It will take an optional argument that is the name of the class.  Give it the same name that you would on the java command line with the different elements of the package name separated by a '.'.  If this argument is left off it will prompt for it before doing anything else.

Once the class is found NewTB will extract the cell interface from the class file.  If any generic widths were used in the cell interface it will ask you to enter numerical values for these at this point.  These numeric values will be entered in the test bench as static final int's so they can easily be changed but some numeric value is required at this time.

NewTB will then print a summary of the cell interface and ask you if it is correct.  If it is not correct NewTB will terminate because there really isn't anything that can be done at this point.  Either the cell interface has something wrong with it (this is most likely the case) that will need to be fixed outside of NewTB or NewTB just wasn't smart enough to understand something about it.  I have not seen the latter case but will not rule out its possible existance.

NewTB will then ask you a few questions about how to set up (if at all) the simulation and the TechMappers.  You're done.  NewTB wrote the test bench template to a file in the current directory.  The file's name will be "tb_" + classname + ".java" where classname is the name of the class to be tested.

The following is a screen dump of a complete session of NewTB.  The tb was created for the cell called  newclass  created by NewJHDL above.  The file that is create by NewTB is called tb_newclass.java .

--- Begin screen dump ---
ccl15.ee.byu.edu:/tmp/jhdl> java NewTB byucc.project.packagename.newclass
JHDL test bench generator, version 2.2, by Carl Baldwin
 

        Enter an integer value for symbolic width, "wid2": 3
        Enter an integer value for symbolic width, "wid": 2
Found interface for cell newclass
        In1     [wid]           "in"
        In2     [wid2]          "in"
        In3     [1]             "in"
        Out1    [wid+1]         "out"
        Out2    [wid2*2]        "out"
Is this correct? (Y/n):
Shall I do the simulation setup for you? (Y/n):
Should the clock method print input values for each cycle? (y/N): y
        (X) XC4000, Xilinx
        (V) Virtex, Xilinx
        (Enter) None
Select the type of techmapping that you would like: x
ccl15.ee.byu.edu:/tmp/jhdl>
--- End screen dump ---


| JHDL Doc Home Page | User's Manual Home Page |

Copyright (c) 1998-2003 Brigham Young Un