X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fmain%2FUserInterface.java;fp=dol%2Fsrc%2Fdol%2Fmain%2FUserInterface.java;h=f9145eaf2ce743e68f3582e39a8d7b84cf5c6aa9;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/main/UserInterface.java b/dol/src/dol/main/UserInterface.java new file mode 100644 index 0000000..f9145ea --- /dev/null +++ b/dol/src/dol/main/UserInterface.java @@ -0,0 +1,771 @@ +/* $Id: UserInterface.java 203 2010-10-11 08:59:47Z dchokshi $ */ +package dol.main; + +import java.util.ResourceBundle; + +/** + * Class to store commandline arguments and flags. + */ +public class UserInterface { + + /** + * Get a single instance of the UserInterface object. + */ + private final static UserInterface _instance = new UserInterface(); + + + // the platform file name + private String _platformFileName = null; + + // the process network file name + private String _networkFileName = null; + + // the mapping file name + private String _mappingFileName = null; + + // the scheduler file name + private String _schedulerFileName = null; + + // the dotty file name + private String _dottyFileName = "dotty.dot"; + + // the systemc directory name + private String _codeDirectoryName = "nonamePackage"; + + // the pipeandfilter directory name + private String _pipeCodeDirectoryName = "nonamePipePackage"; + + // the hds directory name + private String _hdsCodeDirectoryName = "nonameHdsPackage"; + + // the RTEMS directory name + private String _rtemsCodeDirectoryName = "nonameHdsPackage"; + + // the RTEMS board support package for which code is generated + private String _rtemsBSP = "pc386"; + + // the protothread directory name + private String _protothreadCodeDirectoryName = "nonameHdsPackage"; + + // the CBE directory name + private String _cbeCodeDirectoryName = "nonameCbePackage"; + + // the Yapi directory name + private String _yapiCodeDirectoryName = "nonameYapiPackage"; + + + // trace filename + private String _traceName = ""; + + // the xml generation flag + private boolean _xmlGen = false; + + // the trace flag + private boolean _profiling = false; + + // the verbose flag + private boolean _verbose = false; + + // the vsp log flag + private boolean _vsplog = false; + + // the name of the vsp log file + private String _vspLogFileName = ""; + + // the workload annotation flag + private boolean _workload = false; + + // the name of the workload file produces by Matlab + private String _workloadFileName = ""; + + // the SystemC flag + private boolean _systemC = false; + + // the PipeAndFilter flag + private boolean _pipeAndFilter = false; + + // the HdS flag + private boolean _hds = false; + + // the RTEMS flag + private boolean _rtems = false; + + // the CBE flag + private boolean _cbe = false; + + // the YAPI flag + private boolean _yapi = false; + + // the RTEMS flag + private boolean _protothread = false; + + // the debug flag + private boolean _debug = false; + + // the dotty flag + private boolean _dotty = false; + + // the check flag + private boolean _check = false; + + // the path finder flag + private boolean _archiPaths = true; + + // the basepath name + private String _basePath = "."; + + // the filename + private String _outputFileName = ""; + + // ResourceBundle + private ResourceBundle _rb; + private String _rbFileName = "dol"; + + + public final String getMySystemCLib() { + /* + return _rb.getString("DOL_path") + getDelimiter() + + "src" + getDelimiter() + "dol" + getDelimiter() + + "visitor" + getDelimiter() + "systemC" + getDelimiter() + + "lib"; + */ + + return this.getClass().getResource( + "/dol/visitor/systemC/lib").getFile(); + } + + public final String getVisitorDir(){ + return this.getClass().getResource("/dol/visitor/").getFile(); + } + + public final String getDOLPath() { return _rb.getString("DOL_path"); } + public final String getSystemCINC(){return _rb.getString("SYSTEMC_INC");} + public final String getSystemCLIB(){return _rb.getString("SYSTEMC_LIB");} + + /** + * returns the singleton instance of this class. + * + * @return The instance value + */ + public final static UserInterface getInstance() { + return _instance; + } + + /** + * Get the name of the platform file. + * + * @return The platformFileName value + */ + public final String getPlatformFileName() { + return _platformFileName; + } + + /** + * Set the name of the platform file. + * + * @param platformFileName + * The new platformFileName value + */ + public final void setPlatformFileName(String platformFileName) { + _platformFileName = platformFileName; + } + + /** + * Get the name of the process network file. + * + * @return The networkFileName value + */ + public final String getNetworkFileName() { + return _networkFileName; + } + + /** + * Set the name of the process network file. + * + * @param networkFileName + * The new networkFileName value + */ + public final void setNetworkFileName(String networkFileName) { + _networkFileName = networkFileName; + } + + /** + * Get the name of the mapping file. + * + * @return The mappingFileName value + */ + public final String getMappingFileName() { + return _mappingFileName; + } + + /** + * Set the name of the mapping file. + * + * @param mappingFileName + * The new mappingFileName value + */ + public final void setMappingFileName(String mappingFileName) { + _mappingFileName = mappingFileName; + } + + + /** + * Get the name of the scheduler file. + * + * @return The schedulerFileName value + */ + public final String getSchedulerFileName() { + return _schedulerFileName; + } + + /** + * Set the name of the scheduler file. + * + * @param schedulerFileName + * The new schedulerFileName value + */ + public final void setSchedulerFileName(String schedulerFileName) { + _schedulerFileName = schedulerFileName; + } + + + /** + * Get the name of the dotty file.. + * + * @return The dottyFileName value + */ + public final String getDottyFileName() { + return _dottyFileName; + } + + /** + * Set the name of the directory where the SystemC code shall be generated. + * + * @param dottyFileName The dotty file name. + */ + public final void setDottyFileName(String dottyFileName) { + _dottyFileName = dottyFileName; + setDottyFlag(); + } + + + /** + * Get the name of the SystemC directory. + * + * @return The directory name of the SystemC directory + */ + public final String getCodeDirectoryName() { + return _codeDirectoryName; + } + + /** + * Set the name of the directory where the SystemC code shall be generated. + * + * @param codeDirectoryName The code directory + */ + public final void setCodeDirectoryName(String codeDirectoryName) { + _codeDirectoryName = codeDirectoryName; + } + + /** + * Get the name of the PipeAndFilter directory. + * + * @return The directory name of the PipeAndFilter directory + */ + public final String getPipeAndFilterCodeDirectoryName() { + return _pipeCodeDirectoryName; + } + + /** + * Set the name of the directory where the Hds code shall be generated. + * + * @param codeDirectoryName The code directory + */ + public final void setPipeAndFilterCodeDirectoryName(String codeDirectoryName) { + _pipeCodeDirectoryName = codeDirectoryName; + } + + /** + * Get the name of the Hds directory. + * + * @return The directory name of the Hds directory + */ + public final String getHdsCodeDirectoryName() { + return _hdsCodeDirectoryName; + } + + /** + * Set the name of the directory where the Hds code shall be generated. + * + * @param codeDirectoryName The code directory + */ + public final void setHdsCodeDirectoryName(String codeDirectoryName) { + _hdsCodeDirectoryName = codeDirectoryName; + } + + /** + * Get the name of the protothread directory. + * + * @return The directory name of the protohread directory + */ + public final String getProtothreadCodeDirectoryName() { + return _protothreadCodeDirectoryName; + } + + /** + * Set the name of the directory where the protothread code shall be generated. + * + * @param codeDirectoryName The code directory + */ + public final void setProtothreadCodeDirectoryName(String codeDirectoryName) { + _protothreadCodeDirectoryName = codeDirectoryName; + } + + /** + * Get the name of the CBE directory. + * + * @return The directory name of the CBE directory + */ + public final String getCbeCodeDirectoryName() { + return _cbeCodeDirectoryName; + } + + /** + * Set the name of the directory where the CBE code shall be generated. + * + * @param codeDirectoryName The code directory + */ + public final void setCbeCodeDirectoryName(String codeDirectoryName) { + _cbeCodeDirectoryName = codeDirectoryName; + } + + /** + * Get the name of the YAPI directory. + * + * @return The directory name of the CBE directory + */ + public final String getYapiCodeDirectoryName() { + return _yapiCodeDirectoryName; + } + + /** + * Set the name of the directory where the YAPI code shall be generated. + * + * @param codeDirectoryName The code directory + */ + public final void setYapiCodeDirectoryName(String codeDirectoryName) { + _yapiCodeDirectoryName = codeDirectoryName; + } + + /** + * Get the name of the RTEMS directory. + * + * @return The directory name of the RTEMS directory + */ + public final String getRtemsCodeDirectoryName() { + return _rtemsCodeDirectoryName; + } + + /** + * Set the name of the directory where the RTEMS code shall be generated. + * + * @param codeDirectoryName The code directory + */ + public final void setRtemsCodeDirectoryName(String codeDirectoryName) { + _rtemsCodeDirectoryName = codeDirectoryName; + } + + /** + * Get the name of the RTEMS board support package. + * + * @return The name of the board support package + */ + public final String getRtemsBSP() { + return _rtemsBSP; + } + + /** + * Set the name of the board support package for which RTEMS code shall + * be generated. + * + * @param bsp board support package for which code is generated + * currently supported: pc386, mparm + */ + public final void setRtemsBSP(String bsp) { + _rtemsBSP = bsp; + } + + /** + * Get the status of the Verbose flag. + * + * @return verbose flag value + */ + public final boolean getVerboseFlag() { + return _verbose; + } + + /** + * Set the Verbose flag. + */ + public final void setVerboseFlag() { + _verbose = true; + } + + /** + * Get the status of the Debug flag. + * + * @return debug flag value + */ + public final boolean getDebugFlag() { + return _debug; + } + + /** + * Set the debug flag. + */ + public final void setDebugFlag() { + _debug = true; + } + + /** + * Get the status of the SystemC flag + * + * @return The systemC flag value + */ + public final boolean getSystemCFlag() { + return _systemC; + } + + /** + * Set the SystemC flag. + */ + public final void setSystemCFlag() { + _systemC = true; + } + + /** + * Get the status of the PipeAndFilter flag. + * + * @return PipeAndFilter flag value + */ + public final boolean getPipeAndFilterFlag() { + return _pipeAndFilter; + } + + /** + * Set the PipeAndFilter flag. + */ + public final void setPipeAndFilterFlag() { + _pipeAndFilter = true; + } + + /** + * Get the status of the protothread flag. + * + * @return PipeAndFilter flag value + */ + public final boolean getProtothreadFlag() { + return _protothread; + } + + /** + * Set the protothread flag. + */ + public final void setProtothreadFlag() { + _protothread = true; + } + + /** + * Get the status of the HdS flag. + * + * @return The HdS flag value + */ + public final boolean getHdsFlag() { + return _hds; + } + + /** + * Set the HdS flag. + */ + public final void setHdsFlag() { + _hds = true; + } + + /** + * Get the status of the RTEMS flag. + * + * @return The HdS flag value + */ + public final boolean getRtemsFlag() { + return _rtems; + } + + /** + * Set the RTEMS flag. + */ + public final void setRtemsFlag() { + _rtems = true; + } + + /** + * Get the status of the CBE flag. + * + * @return The CBE flag value + */ + public final boolean getCbeFlag() { + return _cbe; + } + + /** + * Set the CBE flag. + */ + public final void setCbeFlag() { + _cbe = true; + } + + /** + * Set the YAPI flag. + */ + public final void setYapiFlag() { + _yapi = true; + } + + /** + * Get the status of the YAPI flag. + * + * @return The YAPI flag value + */ + public final boolean getYapiFlag() { + return _yapi; + } + + /** + * Get the status of the dotty flag + * + * @return The dotty Flag value + */ + public final boolean getDottyFlag() { + return _dotty; + } + + /** + * Sets the dotty flag + */ + public final void setDottyFlag() { + _dotty = true; + } + + /** + * Get the status of the profiling flag + * + * @return The profiling Flag value + */ + public final boolean getProfilingFlag() { + return _profiling; + } + + /** + * Sets the profiling flag + */ + public final void setProfilingFlag() { + _profiling = true; + } + + /** + * Get the status of the vsp log flag. + * + * @return The vsp log value + */ + public final boolean getVspLogFlag() { + return _vsplog; + } + + /** + * Sets the vsp log flag. + */ + public final void setVspLogFlag() { + _vsplog = true; + } + + /** + * Get the status of the workload annotation flag. + * + * @return workload flag + */ + public final boolean getWorkloadFlag() { + return _workload; + } + + /** + * Sets the workload flag. + */ + public final void setWorkloadFlag() { + _workload = true; + } + + /** + * Get the status of the xml generation flag + * + * @return The xmlGen Flag value + */ + public final boolean getXmlGenFlag() { + return _xmlGen; + } + + /** + * Sets the xml generation flag + */ + public final void setXmlGenFlag() { + _xmlGen = true; + } + + /** + * Get the status of the check flag + * + * @return The check Flag value + */ + public final boolean getCheckFlag() { + return _check; + } + + /** + * Sets the check flag + */ + public final void setCheckFlag() { + _check = true; + } + + /** + * Get the status of the path finder flag + * + * @return The path finder Flag value + */ + public final boolean getPathsFlag() { + return _archiPaths; + } + + /** + * Sets the check flag + */ + public final void setPathsFlag() { + _archiPaths = true; + } + + /** + * Print a message to screen if the verbose flag has been selected with an + * end-of-line. + * + * @param s description that needs to printed. + */ + public void printVerbose(String s) { + if ( getVerboseFlag() ) { + System.out.print(s); + } + } + + /** + * Print a message to screen if the verbose flag has been selected. + * + * @param s description that needs to printed. + */ + public void printlnVerbose(String s) { + if( getVerboseFlag() ) { + System.out.println(s); + } + } + + + /** + * get the name of the output file name. + * + * @return The outputFileName value + */ + public final String getOutputFileName() { + return _outputFileName; + } + + /** + * set the name of the input file name. + * + * @param filename The new outputFileName value + */ + public final void setOutputFileName(String filename) { + _outputFileName = filename; + } + + /** + * get the base path name. + * + * @return The basePath value + */ + public final String getBasePath() { return _basePath; } + + /** + * sets the base path name. + * + * @param name + * The new basePath value + */ + public final void setBasePath(String name) { _basePath = name; } + + /** + * get the trace filename. + * + * @return The name value of trace file + */ + public final String getTraceName() { return _traceName; } + + /** + * sets the trace Filename. + * + * @param name trace filename + */ + public final void setTraceName(String name) { + _traceName = name; + } + + + /** + * Get the vsp log filename. + * + * @return name of the vsp log file + */ + public final String getVspLogFileName() { + return _vspLogFileName; + } + + /** + * Set the vsp log filename. + * + * @param name vsp log filename + */ + public final void setVspLogFileName(String name) { + _vspLogFileName = name; + } + + /** + * Get the workload filename. + * + * @return name workload filename + */ + public final String getWorkloadFileName() { + return _workloadFileName; + } + + /** + * Sets the workload filename. + * + * @param name workload filename + */ + public final void setWorkloadFileName(String name) { + _workloadFileName = name; + } + + /** + * Constructor. Private since only a single version may exist. + */ + private UserInterface() { + _rb = ResourceBundle.getBundle(_rbFileName); + } +} +