byucc.jhdl.platforms.util.readback.Xilinx.XC4000
Class MRP_4K

java.lang.Object
  extended bybyucc.jhdl.platforms.util.readback.Xilinx.XC4000.MRP_4K
All Implemented Interfaces:
MRP_4KConstants

public class MRP_4K
extends java.lang.Object
implements MRP_4KConstants

This class parses Section 5 (the optimization section) of XC4000 .mrp (Map report) files generated with the -detail option to Map and builds a MergedSignalsHash which relates physical signal names to all their logical signal aliases. Though only the merged signals are really recorded, the grammar is "complete" for the entire section. The parser skips the rest of the file by returning at the end of the section. As mentioned before, the parser produces a Hashtable of MergedSignals which reflects the signals that were merged by the Xilinx Map tool. The parser handles multi-level merges, in other words, when a signal has been merged into one signal and then that signal is merged into to yet others.

Author:
Paul Graham

Field Summary
 Token jj_nt
           
 Token token
           
 MRP_4KTokenManager token_source
           
 
Fields inherited from interface byucc.jhdl.platforms.util.readback.Xilinx.XC4000.MRP_4KConstants
BLOCK, COLON, COMMA, DEFAULT, EOF, EQUAL, ID, IDCONTINUATION, LANGLE, LBRACKET, LOADLESSBLOCK, LOGICNAME, LPAREN, MERGEDSIGNALS, NETEXT, NUM, OPTIMIZEDBLOCKS, PERIOD, PRIMITIVE, RANGLE, RBRACKET, REDUNDANTBLOCKS, REMOVED, RPAREN, SECTION5, SECTION6, SOURCELESSBLOCK, THESIGNAL, TOENABLEPRINTING, tokenImage, TRIMMEDLOGIC1, TRIMMEDLOGIC2, TYPE, UNUSEDBLOCK
 
Constructor Summary
MRP_4K(java.io.InputStream stream)
           
MRP_4K(MRP_4KTokenManager tm)
           
MRP_4K(java.io.Reader stream)
           
 
Method Summary
 void disable_tracing()
           
 void enable_tracing()
           
 ParseException generateParseException()
           
 java.util.Hashtable getMergedSignalsHash()
          Returns a reference to the Hashtable of MergedSignals built by the parser.
 Token getNextToken()
           
 Token getToken(int index)
           
static java.io.BufferedReader initStream(java.io.InputStream ins)
          Provides a way for the user to skip past the first four sections of the MRP file.
 void initTables()
          Initializes the extra data structures used by the parser---it must be called before calling the parseMRP method.
static void main(java.lang.String[] args)
          Provides a command line interface test for the class.
 void MapDetailMessage()
          Parses message which describes how to get a more detailed Map Report file.
 void MergedSignals()
          Parses the Merged Signals subsection of the file and builds the MergedSignalsHash and the MergedToHash based on the information from this subsection.
 void OptimizedBlocks()
          Parses the Optimized Block portion of the file.
 void parseMRP()
          Initiates the parsing of the Section 5 of the MRP file.
 void RedundantBlocks()
          Parses the Redundant Block subsection of the file.
 void ReInit(java.io.InputStream stream)
           
 void ReInit(MRP_4KTokenManager tm)
           
 void ReInit(java.io.Reader stream)
           
 void RemovedBlock()
          Parses just the removed logic/block clauses for the Trimmed Logic section.
 void RemovedSignal()
          Parses just the removed signal clauses for the Trimmed Logic section.
 void S5Heading()
          Parses the heading of Section 5
 void S6Heading()
          Parses the heading of section 6.
 void TrimmedLogic()
          Parses any trimmed logic statements and headings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public MRP_4KTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt
Constructor Detail

MRP_4K

public MRP_4K(java.io.InputStream stream)

MRP_4K

public MRP_4K(java.io.Reader stream)

MRP_4K

public MRP_4K(MRP_4KTokenManager tm)
Method Detail

main

public static void main(java.lang.String[] args)
                 throws ParseException
Provides a command line interface test for the class.

Parameters:
args - If the parameter is empty, then the parser just parses the input via System.in (stdin). If there is one command line argument, the "*.mrp" ending is added to the argument when searching for the MRP file to parse and process.
Throws:
ParseException

initTables

public void initTables()
Initializes the extra data structures used by the parser---it must be called before calling the parseMRP method. Ideally, I should have just extended the MRP_4K class so I could override it's constructors. The default constructors are not flexible enough.


initStream

public static java.io.BufferedReader initStream(java.io.InputStream ins)
Provides a way for the user to skip past the first four sections of the MRP file.


getMergedSignalsHash

public java.util.Hashtable getMergedSignalsHash()
Returns a reference to the Hashtable of MergedSignals built by the parser.

Returns:
Reference to MergedSignalsHash.

parseMRP

public final void parseMRP()
                    throws ParseException
Initiates the parsing of the Section 5 of the MRP file. It is assumed that the first part of the file has already been skipped.

Throws:
ParseException

S5Heading

public final void S5Heading()
                     throws ParseException
Parses the heading of Section 5

Throws:
ParseException

TrimmedLogic

public final void TrimmedLogic()
                        throws ParseException
Parses any trimmed logic statements and headings

Throws:
ParseException

RemovedSignal

public final void RemovedSignal()
                         throws ParseException
Parses just the removed signal clauses for the Trimmed Logic section.

Throws:
ParseException

RemovedBlock

public final void RemovedBlock()
                        throws ParseException
Parses just the removed logic/block clauses for the Trimmed Logic section.

Throws:
ParseException

OptimizedBlocks

public final void OptimizedBlocks()
                           throws ParseException
Parses the Optimized Block portion of the file.

Throws:
ParseException

RedundantBlocks

public final void RedundantBlocks()
                           throws ParseException
Parses the Redundant Block subsection of the file.

Throws:
ParseException

MergedSignals

public final void MergedSignals()
                         throws ParseException
Parses the Merged Signals subsection of the file and builds the MergedSignalsHash and the MergedToHash based on the information from this subsection. Because of the presence of multi-level merges, the method effectively performs a transitive closure on signal names to resolve signal name aliases.

Throws:
ParseException

MapDetailMessage

public final void MapDetailMessage()
                            throws ParseException
Parses message which describes how to get a more detailed Map Report file. This method throws a MapDetailException since the .mrp file was generated without the -detail option.

Throws:
ParseException

S6Heading

public final void S6Heading()
                     throws ParseException
Parses the heading of section 6.

Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(MRP_4KTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public final 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.