byucc.jhdl.platforms.util.readback.Xilinx.Virtex
Class LL_Virtex

java.lang.Object
  extended bybyucc.jhdl.platforms.util.readback.Xilinx.Virtex.LL_Virtex
All Implemented Interfaces:
LL_VirtexConstants

public class LL_Virtex
extends java.lang.Object
implements LL_VirtexConstants

The Xilinx Logical Allocation file (.ll file) parser for Virtex FPGAs. The parser fills two Hashtable objects with the readback bitstream information for state elements in the Virtex design. One Hashtable is filled with RAM bitstream information keyed on physical location (block name) while the second holds the bitstream information for flip-flops keyed on physical location (block name). The grammar is not published but was developed from looking at the file format.

Author:
Paul Graham

Field Summary
 Token jj_nt
           
 Token token
           
 LL_VirtexTokenManager token_source
           
 
Fields inherited from interface byucc.jhdl.platforms.util.readback.Xilinx.Virtex.LL_VirtexConstants
BIT, BLOCK, BLOCKRAM, COLON, COMPARE, DEFAULT, EOF, EQUAL, HEXNUM, I, ID, IN_LINE_COMMENT, INFO, IQ, LANGLE, LATCH, LBRACKET, LUT, NET, NETEXT, NO, NUM, O, PAD, RAM, RANGLE, RBRACKET, REVISION, ROM, T, tokenImage, X, XQ, XX, Y, YES, YQ
 
Constructor Summary
LL_Virtex(java.io.InputStream stream)
           
LL_Virtex(LL_VirtexTokenManager tm)
           
LL_Virtex(java.io.Reader stream)
           
 
Method Summary
 void Attributes(int offset, int frame, int frameOffset, java.lang.String block)
          Parses the "attributes" of a state bit in the readback bitstream, which define whether it belongs to a flip-flop, a RAM, or a ROM and other related information.
 void BitStreamEntry()
          Parses an entire readback bitstream location entry for a state element.
 java.lang.String Block()
          Parses the information regarding location of the IOB/SLICE/BLOCKRAM and returns the information as a String.
 void Compare()
          Parses "COMPARE=..." clauses, which are otherwise ignored.
 void disable_tracing()
           
 void enable_tracing()
           
 ParseException generateParseException()
           
 java.util.Hashtable getNetHashBlock()
          Returning a reference to the NetHashBlock, which holds a LatchRBEntry for each flip-flop in the .ll file keyed on the location and the latch type (XQ, YQ, etc.)
 Token getNextToken()
           
 java.util.Hashtable getRAMGroupHash()
          Returns a reference to the RAMGroupHash, which holds a RAMGroup object for each RAM in the .ll file keyed on the location of the RAM and the RAM type (F, G, M, or B).
 Token getToken(int index)
           
 boolean hasAbsoluteOffsets()
          Returns true if the LL file provides absolute offsets and false otherwise.
 void InfoEntry()
          Parses any entries in the LL file which do not directly associate state elements with readback bitstream locations.
 void InfoValue()
          Parses the value of any the informational entries in the LL file.
 void initTables()
          Initializes the Hashtables and counts.
 java.lang.String Latch()
          Parses the entire clause having the type of the flip-flop and returns the flip-flop type as a String.
 java.lang.String LatchType()
          Defines the various flip-flop types and returns the type as a String.
static void main(java.lang.String[] args)
          Instances and initializes the parser and parses the input from System.in
 void Net(int offset, int frame, int frameOffset, java.lang.String block, java.lang.String latchType)
          Parses the entire "Net=..." clause.
 void NetName(int offset, int frame, int frameOffset, java.lang.String block, java.lang.String latchType)
          Parses the net names associated with latches and stores a LatchRBEntry object in the NetHashBlock Hashtable.
 void parseLL()
          Initiates the parsing of an .ll file and prints out statistics about the number of flip-flops (latches) and RAMs it found.
 void Ram(int offset, int frame, int frameOffset, java.lang.String block)
          Parses the "Ram=..." clauses of the RAM LL entries and enters the data into the RAMGroupHash.
 void ReInit(java.io.InputStream stream)
           
 void ReInit(LL_VirtexTokenManager tm)
           
 void ReInit(java.io.Reader stream)
           
 void Revision()
          Parses the revision information for the .ll file.
 void Rom()
          Parses "Rom=..." entries, but doesn't do anything with them.
 void YesNo()
          Parses "YES/NO" clauses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public LL_VirtexTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt
Constructor Detail

LL_Virtex

public LL_Virtex(java.io.InputStream stream)

LL_Virtex

public LL_Virtex(java.io.Reader stream)

LL_Virtex

public LL_Virtex(LL_VirtexTokenManager tm)
Method Detail

main

public static void main(java.lang.String[] args)
                 throws ParseException
Instances and initializes the parser and parses the input from System.in

Parameters:
args - Command line arguments (ignored by the method)
Throws:
ParseException

initTables

public void initTables()
Initializes the Hashtables and counts.


getRAMGroupHash

public java.util.Hashtable getRAMGroupHash()
Returns a reference to the RAMGroupHash, which holds a RAMGroup object for each RAM in the .ll file keyed on the location of the RAM and the RAM type (F, G, M, or B).

Returns:
Reference to RAMGroupHash

getNetHashBlock

public java.util.Hashtable getNetHashBlock()
Returning a reference to the NetHashBlock, which holds a LatchRBEntry for each flip-flop in the .ll file keyed on the location and the latch type (XQ, YQ, etc.)

Returns:
Reference to NetHashBlock

hasAbsoluteOffsets

public boolean hasAbsoluteOffsets()
Returns true if the LL file provides absolute offsets and false otherwise. Absolute readback bitstream offsets started appearing in the Xilinx ISE 4.1i series of tools.

Returns:
true if absolute offsets are provide, false otherwise.

LatchType

public final java.lang.String LatchType()
                                 throws ParseException
Defines the various flip-flop types and returns the type as a String.

Returns:
String for flip-flop type.
Throws:
ParseException

parseLL

public final void parseLL()
                   throws ParseException
Initiates the parsing of an .ll file and prints out statistics about the number of flip-flops (latches) and RAMs it found.

Throws:
ParseException

Revision

public final void Revision()
                    throws ParseException
Parses the revision information for the .ll file.

Throws:
ParseException

Block

public final java.lang.String Block()
                             throws ParseException
Parses the information regarding location of the IOB/SLICE/BLOCKRAM and returns the information as a String.

Returns:
The Virtex block location string (for example, "A21", "CLB_R8C55", "RAMB4_R7C0").
Throws:
ParseException

Latch

public final java.lang.String Latch()
                             throws ParseException
Parses the entire clause having the type of the flip-flop and returns the flip-flop type as a String.

Returns:
Flip-flop type as String.
Throws:
ParseException

NetName

public final void NetName(int offset,
                          int frame,
                          int frameOffset,
                          java.lang.String block,
                          java.lang.String latchType)
                   throws ParseException
Parses the net names associated with latches and stores a LatchRBEntry object in the NetHashBlock Hashtable. The method handles both angle brackets ("<>") and square brackets ("[]") for net names. In some strange circumstances, it was necessary to handle names which extended beyond the array naming construct (in other words, there was still part of the name after the last "]" or ">"). In these cases, the names are considered atomic (not multi-bit), so the index variable is reset to "-1".

Parameters:
offset - The first offset provided by the LL file for this flip-flop; it is actually a junk bit in the readback bitstream.
frame - The frame number for this flip-flops readback data provided by the LL file.
frameOffset - The offset within the frame for this flip-flop's readback data provided by the LL file.
block - The block's name and location.
latchType - The type of the flip-flop.
Throws:
ParseException

Net

public final void Net(int offset,
                      int frame,
                      int frameOffset,
                      java.lang.String block,
                      java.lang.String latchType)
               throws ParseException
Parses the entire "Net=..." clause.

Parameters:
offset - The first offset provided by the LL file for this flip-flop; it is actually a junk bit in the readback bitstream.
frame - The frame number for this flip-flops readback data provided by the LL file.
frameOffset - The offset within the frame for this flip-flop's readback data provided by the LL file.
block - The block's name and location.
latchType - The type of the flip-flop.
Throws:
ParseException

Ram

public final void Ram(int offset,
                      int frame,
                      int frameOffset,
                      java.lang.String block)
               throws ParseException
Parses the "Ram=..." clauses of the RAM LL entries and enters the data into the RAMGroupHash. Since a certain RAM may already have a RAMGroup entry in the RAMGroupHash, the method performs a lookup first to see if the RAM's RAMGroup entry exists. If the entry exists, the method adds a RAMRBEntry to the RAMGroup which was found. Otherwise, the method creates a new RAMGroup and adds an RAMRBEntry to it. This method handles both LUT RAMs and BlockRAMs.

Parameters:
offset - The first offset provided by the LL file for this flip-flop; it is actually a junk bit in the readback bitstream.
frame - The frame number for this flip-flops readback data provided by the LL file.
frameOffset - The offset within the frame for this flip-flop's readback data provided by the LL file.
block - The block's name and location.
Throws:
ParseException

Rom

public final void Rom()
               throws ParseException
Parses "Rom=..." entries, but doesn't do anything with them.

Throws:
ParseException

YesNo

public final void YesNo()
                 throws ParseException
Parses "YES/NO" clauses.

Throws:
ParseException

Compare

public final void Compare()
                   throws ParseException
Parses "COMPARE=..." clauses, which are otherwise ignored.

Throws:
ParseException

Attributes

public final void Attributes(int offset,
                             int frame,
                             int frameOffset,
                             java.lang.String block)
                      throws ParseException
Parses the "attributes" of a state bit in the readback bitstream, which define whether it belongs to a flip-flop, a RAM, or a ROM and other related information. This is really the core of the parsing work.

Parameters:
offset - The first offset provided by the LL file for this flip-flop; it is actually a junk bit in the readback bitstream.
frame - The frame number for this flip-flops readback data provided by the LL file.
frameOffset - The offset within the frame for this flip-flop's readback data provided by the LL file.
block - The block's name and location.
Throws:
ParseException

BitStreamEntry

public final void BitStreamEntry()
                          throws ParseException
Parses an entire readback bitstream location entry for a state element.

Throws:
ParseException

InfoValue

public final void InfoValue()
                     throws ParseException
Parses the value of any the informational entries in the LL file. The information is ignored.

Throws:
ParseException

InfoEntry

public final void InfoEntry()
                     throws ParseException
Parses any entries in the LL file which do not directly associate state elements with readback bitstream locations. These entries describe some of the bitstream generation options used for the bitstream.

Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(LL_VirtexTokenManager 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.