byucc.jhdl.platforms.util.readback.Xilinx.Virtex2
Class XDL_Virtex2

java.lang.Object
  extended bybyucc.jhdl.platforms.util.readback.Xilinx.Virtex2.XDL_Virtex2
All Implemented Interfaces:
XDL_Virtex2Constants

public class XDL_Virtex2
extends java.lang.Object
implements XDL_Virtex2Constants

This class parses XDL file for Virtex2 FPGA designs and builds the data structures necessary to associate logical state elements with their state in readback bitstreams. The parsing is performed in two passes: the first pass processes the instances of physical state elements while the second pass processes the physical nets. This simplifies the process since it is not guaranteed that the logic instances will always appear before the net instances. The grammar for the XDL is based mostly on the grammar published by Xilinx, but some things have been added to handle unpublished additions to the grammar which have been determined via trial and error.

Author:
Paul Graham

Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 XDL_Virtex2TokenManager token_source
           
 
Fields inherited from interface byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.XDL_Virtex2Constants
BIONEBUF, BITWOBUF, BIUNBUF, BONDED, CFG, COLON, COMMA, DEFAULT, DESIGN, DQUOTE, DRIVER, ENDMODULE, EOF, GND, GROUND, IN_LINE_COMMENT, INPIN, INQUOTE, INST, INSTANCE, IQCOLON, IQDQUOTE, IQNWSTRING, IQWSPACE, LOAD, MODULE, NET, NONWHITESTRING, OUTPIN, PIP, PLACED, PORT, POWER, QUOTESTRING, SEMICOLON, tokenImage, UNBONDED, UNIBUF, UNPLACED, VCC, VDD, WIRE
 
Constructor Summary
XDL_Virtex2(java.io.InputStream stream)
           
XDL_Virtex2(java.io.Reader stream)
           
XDL_Virtex2(XDL_Virtex2TokenManager tm)
           
 
Method Summary
 void anchor_name()
          Parses the anchor for a subdesign.
 void bel_cfg()
          Parses an individual triplet definiing the configuration of some physical logic resource.
 void cfg_string()
          Parses the contents of the quoted configuration string.
 java.lang.String cfg_val()
          Parse the configuration information for the physical FPGA resource and return it.
 void design()
          Parses the header of the XDL file.
 void device_package()
          Parses the package type for the Virtex2 device.
 void device()
          Parses the Virtex2 device type.
 void disable_tracing()
           
 void enable_tracing()
           
 void file_inst()
          Initiates the parsing of the XDL file, recording only logic block instances in the parser's data structures.
 void file_net()
          Initiates the parsing of the XDL file, recording only net instances in the parser's data structures.
 void file()
          Initiates the parsing of the XDL file.
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
 void inst_cfg()
          Parses the configuration information related to the logic block instance.
 void inst_module()
          Parses the declaration of a module instance related with this logic block instance.
 java.lang.String inst_name()
          Parses the name of the logic block instance.
 java.lang.String inst_pin_name()
          Parses the name of an input or output pin to a logic block (SLICE/IOB/BLOCKRAM).
 void inst_placed()
          Parses a placed logic declaration and saves the location of the block in the blockLocations Hashtable keyed on the instance name of the block so net drivers can be related to logic blocks---this, of course, assumes that the logic instance is not in a module and that the parser is recording logic instance information.
 void inst_placement()
          Parses the placement information for the logic block
 void inst_prefix_id()
          Parses the "inst"/"instance" key words.
 void inst_prefix()
          Parses the instance header information, such as the name of the instance and the type of the instance (SLICE, BLOCKRAM, IOB).
 void inst_stmt()
          Parses an individual instance subclause which occur after the instance header information.
 void inst_stmts()
          Parses the instance subclauses following the instance header.
 java.lang.String inst_type()
          Parses the type of the instance and returns the type as a String.
 void inst_unplaced()
          Parses an umplaced logic declaration and throws an UnplacedBlockException to indicate a problem with the XDL file.
 void inst()
          Parses a logic block instance, recording the information if the instance clause is not in a module and if logic instances, not net instances, are being recorded by the parser.
 java.lang.String logical_name()
          Parse the name of the logical circuit instance which corresponds to the physical resource and return the instance name.
static void main(java.lang.String[] args)
          Tests the parser from the command line.
 void module_beg()
          Parses the module's header.
 void module_cfg()
          Parses logic configuration statements within a module.
 void module_end()
          Parses the closing clause of a module declaration.
 void module_name()
          Parses the module's name
 void module_port()
          Parses a single port declaration for a subdesign.
 void module_ports()
          Parses the port declarations to the subdesigns.
 void module_stmt()
          Parses an individual logic or net instance statement within a subdesign.
 void module_stmts()
          Parses a series of logic instance and net instance statements within a subdesign.
 void module()
          Parses a single design module.
 void name()
          Parses the name of the design.
 void ncd_version()
          Parses the version of the Xilinx NCD format.
 void net_bel_cfg()
          Parses an individual net configuration statement.
 void net_cfg()
          Parses net configuration statements.
 void net_inpin(java.lang.String netName)
          Parses the information describing an input pin to which the physical net is attached.
 java.lang.String net_name()
          Parses the name of a physical net.
 void net_outpin(java.lang.String netName)
          Parses the information describing an output pin to which the physical net is attached.
 void net_pip()
          Parses the configuration of a pip (programmable interconnection point, basically, a routing switch)
 void net_stmt(java.lang.String netName)
          Parses an individual net statement.
 void net_stmts(java.lang.String netName)
          Parses a series of net statements which occur after the initial header information of the net instance declaration.
 void net_type()
          Parses the type of the physical net.
 void net()
          Parses a net instance.
 void part()
          Parses the FPGA compound part type (for example, xcv1000fg680-6) for the design.
 java.lang.String physical_name()
          Parse the name of the physical FPGA resource and return the name.
 void pip_direction()
          Parses the direction of the pip.
 void port_name()
          Parses the name of a subdesign port.
 java.lang.String primitive_site()
          Parses the name of the primitive site for the physical logic block.
 java.lang.String quoted_string()
          Parses a string which is surrounded by double quotes, but does not have the following characters within the string: ":", ";", or "\n".
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.Reader stream)
           
 void ReInit(XDL_Virtex2TokenManager tm)
           
 void speed()
          Parses the Virtex2 device speed grade.
 void statement()
          Parses a single module, logic instance, or net instance
 void statements()
          Parses the rest of the file after the header.
 java.lang.String string()
          Parses a string in the grammar.
 void tile_name()
          Parses the name of the tile for the physical logic block.
 void tile()
          Parses the tile (location) of the pip.
 java.lang.String unquoted_string()
          Parses a simple string which is not surrounded by double quotes.
 void wire0()
          Parses the first connection point in a pip statement.
 void wire1()
          Parses the second connection point in a pip statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public XDL_Virtex2TokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

XDL_Virtex2

public XDL_Virtex2(java.io.InputStream stream)

XDL_Virtex2

public XDL_Virtex2(java.io.Reader stream)

XDL_Virtex2

public XDL_Virtex2(XDL_Virtex2TokenManager tm)
Method Detail

main

public static void main(java.lang.String[] args)
                 throws ParseException
Tests the parser from the command line. This requires that the complete name of the XDL file be provided as a parameter at the command line.

Parameters:
args - The command-line arguments to the program.
Throws:
ParseException

file

public final void file()
                throws ParseException,
                       byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Initiates the parsing of the XDL file. What actually gets processed/recorded depends on the value of the doInstances field for the object. If the doInstances is true, then logic instances are processed; otherwise, nst instances are processed.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

file_inst

public final void file_inst()
                     throws ParseException,
                            byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Initiates the parsing of the XDL file, recording only logic block instances in the parser's data structures.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

file_net

public final void file_net()
                    throws ParseException,
                           byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Initiates the parsing of the XDL file, recording only net instances in the parser's data structures.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

design

public final void design()
                  throws ParseException
Parses the header of the XDL file.

Throws:
ParseException

name

public final void name()
                throws ParseException
Parses the name of the design.

Throws:
ParseException

part

public final void part()
                throws ParseException
Parses the FPGA compound part type (for example, xcv1000fg680-6) for the design.

Throws:
ParseException

device

public final void device()
                  throws ParseException
Parses the Virtex2 device type.

Throws:
ParseException

device_package

public final void device_package()
                          throws ParseException
Parses the package type for the Virtex2 device.

Throws:
ParseException

speed

public final void speed()
                 throws ParseException
Parses the Virtex2 device speed grade.

Throws:
ParseException

ncd_version

public final void ncd_version()
                       throws ParseException
Parses the version of the Xilinx NCD format.

Throws:
ParseException

statements

public final void statements()
                      throws ParseException,
                             byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses the rest of the file after the header.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

statement

public final void statement()
                     throws ParseException,
                            byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses a single module, logic instance, or net instance

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

module

public final void module()
                  throws ParseException,
                         byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses a single design module. It is basically a macro or sub-design instanced in the design. Note that the general logic and net instance statements define the design completely, so the information in modules is not recorded by the parser.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

module_beg

public final void module_beg()
                      throws ParseException
Parses the module's header.

Throws:
ParseException

module_cfg

public final void module_cfg()
                      throws ParseException
Parses logic configuration statements within a module.

Throws:
ParseException

module_ports

public final void module_ports()
                        throws ParseException
Parses the port declarations to the subdesigns.

Throws:
ParseException

module_port

public final void module_port()
                       throws ParseException
Parses a single port declaration for a subdesign.

Throws:
ParseException

module_stmts

public final void module_stmts()
                        throws ParseException,
                               byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses a series of logic instance and net instance statements within a subdesign.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

module_stmt

public final void module_stmt()
                       throws ParseException,
                              byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses an individual logic or net instance statement within a subdesign.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

module_end

public final void module_end()
                      throws ParseException
Parses the closing clause of a module declaration.

Throws:
ParseException

module_name

public final void module_name()
                       throws ParseException
Parses the module's name

Throws:
ParseException

anchor_name

public final void anchor_name()
                       throws ParseException
Parses the anchor for a subdesign.

Throws:
ParseException

port_name

public final void port_name()
                     throws ParseException
Parses the name of a subdesign port.

Throws:
ParseException

inst

public final void inst()
                throws ParseException,
                       byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses a logic block instance, recording the information if the instance clause is not in a module and if logic instances, not net instances, are being recorded by the parser.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

inst_prefix

public final void inst_prefix()
                       throws ParseException
Parses the instance header information, such as the name of the instance and the type of the instance (SLICE, BLOCKRAM, IOB). Of course, if the parser is currently recording logic instance information and if the logic instance statement is not in a module, the parser records the block's name and type.

Throws:
ParseException

inst_prefix_id

public final void inst_prefix_id()
                          throws ParseException
Parses the "inst"/"instance" key words.

Throws:
ParseException

inst_type

public final java.lang.String inst_type()
                                 throws ParseException
Parses the type of the instance and returns the type as a String.

Returns:
The logic block's type (SLICE, BLOCKRAM, IOB).
Throws:
ParseException

inst_stmts

public final void inst_stmts()
                      throws ParseException,
                             byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses the instance subclauses following the instance header.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

inst_stmt

public final void inst_stmt()
                     throws ParseException,
                            byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses an individual instance subclause which occur after the instance header information.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

inst_placement

public final void inst_placement()
                          throws ParseException,
                                 byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses the placement information for the logic block

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

inst_placed

public final void inst_placed()
                       throws ParseException
Parses a placed logic declaration and saves the location of the block in the blockLocations Hashtable keyed on the instance name of the block so net drivers can be related to logic blocks---this, of course, assumes that the logic instance is not in a module and that the parser is recording logic instance information.

Throws:
ParseException

inst_unplaced

public final void inst_unplaced()
                         throws ParseException,
                                byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException
Parses an umplaced logic declaration and throws an UnplacedBlockException to indicate a problem with the XDL file.

Throws:
ParseException
byucc.jhdl.platforms.util.readback.Xilinx.Virtex2.UnplacedBlockException

inst_module

public final void inst_module()
                       throws ParseException
Parses the declaration of a module instance related with this logic block instance.

Throws:
ParseException

inst_cfg

public final void inst_cfg()
                    throws ParseException
Parses the configuration information related to the logic block instance.

Throws:
ParseException

cfg_string

public final void cfg_string()
                      throws ParseException
Parses the contents of the quoted configuration string.

Throws:
ParseException

bel_cfg

public final void bel_cfg()
                   throws ParseException
Parses an individual triplet definiing the configuration of some physical logic resource. If this does not occur within a module declaration and the parser is recording logic, as opposed to net, instances, the method records any state element (flip-flop/RAM) configuration information provided by the configuration statement.

Throws:
ParseException

physical_name

public final java.lang.String physical_name()
                                     throws ParseException
Parse the name of the physical FPGA resource and return the name.

Returns:
The physical name of the FPGA resource.
Throws:
ParseException

logical_name

public final java.lang.String logical_name()
                                    throws ParseException
Parse the name of the logical circuit instance which corresponds to the physical resource and return the instance name.

Returns:
The name of the logical circuit instance which corresponds to the physical resource.
Throws:
ParseException

cfg_val

public final java.lang.String cfg_val()
                               throws ParseException
Parse the configuration information for the physical FPGA resource and return it.

Returns:
The configuration information for the physical FPGA resource
Throws:
ParseException

tile_name

public final void tile_name()
                     throws ParseException
Parses the name of the tile for the physical logic block.

Throws:
ParseException

primitive_site

public final java.lang.String primitive_site()
                                      throws ParseException
Parses the name of the primitive site for the physical logic block. This information has the form of "CLB_R3C91.S1", "J38", or "RAMB4_R8C0" in the XDL file, depending on the type of the logic block.

Returns:
The name of the block's primitive site.
Throws:
ParseException

inst_name

public final java.lang.String inst_name()
                                 throws ParseException
Parses the name of the logic block instance.

Returns:
The name of the logic block instance.
Throws:
ParseException

inst_pin_name

public final java.lang.String inst_pin_name()
                                     throws ParseException
Parses the name of an input or output pin to a logic block (SLICE/IOB/BLOCKRAM).

Returns:
The name of the logic block's input or output pin.
Throws:
ParseException

net

public final void net()
               throws ParseException
Parses a net instance.

Throws:
ParseException

net_name

public final java.lang.String net_name()
                                throws ParseException
Parses the name of a physical net.

Returns:
The physical net's name.
Throws:
ParseException

net_type

public final void net_type()
                    throws ParseException
Parses the type of the physical net. This is usually used only in special cases when defining a net connected to VCC or ground.

Throws:
ParseException

net_stmts

public final void net_stmts(java.lang.String netName)
                     throws ParseException
Parses a series of net statements which occur after the initial header information of the net instance declaration.

Parameters:
netName - The name of the physical net whose information is being parsed.
Throws:
ParseException

net_stmt

public final void net_stmt(java.lang.String netName)
                    throws ParseException
Parses an individual net statement. Note that net_cfg() and related non-terminals are additions with Xilinx M2.1i's XDL.

Parameters:
netName - The name of the physical net whose information is being parsed.
Throws:
ParseException

net_cfg

public final void net_cfg()
                   throws ParseException
Parses net configuration statements. This is an alternate version designed to handle XDL files that are generated with faulty net_cfg strings. A more "consistent" version of this grammar rule is provided in the comments to the parser. Note that net_cfg() was added with Service Pack 6 of the Xilinx M2.1i tools.

Throws:
ParseException

net_bel_cfg

public final void net_bel_cfg()
                       throws ParseException
Parses an individual net configuration statement. Note that net_bel_cfg() is an addition with Xilinx M2.1i SP6's XDL.

Throws:
ParseException

net_inpin

public final void net_inpin(java.lang.String netName)
                     throws ParseException
Parses the information describing an input pin to which the physical net is attached. This method records the name of the signals attached to the address inputs of LUT RAMs when the net instance statement is not in a module definition and the parser is recording net instance information rather than logic instance information.

Parameters:
netName - The name of the physical net whose information is being parsed.
Throws:
ParseException

net_outpin

public final void net_outpin(java.lang.String netName)
                      throws ParseException
Parses the information describing an output pin to which the physical net is attached. This method records the sources of each physical net using a Vector of NetDriver objects when the net instance statement is not in a module definition and the parser is recording net instance information rather than logic instance information.

Parameters:
netName - The name of the physical net whose information is being parsed.
Throws:
ParseException

net_pip

public final void net_pip()
                   throws ParseException
Parses the configuration of a pip (programmable interconnection point, basically, a routing switch)

Throws:
ParseException

tile

public final void tile()
                throws ParseException
Parses the tile (location) of the pip.

Throws:
ParseException

wire0

public final void wire0()
                 throws ParseException
Parses the first connection point in a pip statement.

Throws:
ParseException

pip_direction

public final void pip_direction()
                         throws ParseException
Parses the direction of the pip.

Throws:
ParseException

wire1

public final void wire1()
                 throws ParseException
Parses the second connection point in a pip statement.

Throws:
ParseException

string

public final java.lang.String string()
                              throws ParseException
Parses a string in the grammar.

Returns:
The value of the string.
Throws:
ParseException

unquoted_string

public final java.lang.String unquoted_string()
                                       throws ParseException
Parses a simple string which is not surrounded by double quotes.

Returns:
The unquoted string.
Throws:
ParseException

quoted_string

public final java.lang.String quoted_string()
                                     throws ParseException
Parses a string which is surrounded by double quotes, but does not have the following characters within the string: ":", ";", or "\n".

Returns:
The quoted string.
Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(XDL_Virtex2TokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.