From cbc1f1265fd129d066da10e72e819d7d20f5360a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 25 Nov 2013 19:27:27 +0100 Subject: [PATCH] dol: add command line options and empty class This allows selecting the Epiphany code generator using the command line switches --epiphany or -E and adds an empty EpiphanyVisitor class. --- dol/src/dol/main/Main.java | 9 +++++ dol/src/dol/main/Options.java | 6 ++- dol/src/dol/main/UserInterface.java | 40 +++++++++++++++++++ .../dol/visitor/epiphany/EpiphanyVisitor.java | 10 +++++ dol/src/dol/visitor/epiphany/package.html | 20 ++++++++++ 5 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 dol/src/dol/visitor/epiphany/EpiphanyVisitor.java create mode 100644 dol/src/dol/visitor/epiphany/package.html diff --git a/dol/src/dol/main/Main.java b/dol/src/dol/main/Main.java index 6d0cd95..cf31a65 100644 --- a/dol/src/dol/main/Main.java +++ b/dol/src/dol/main/Main.java @@ -22,6 +22,7 @@ import dol.visitor.dot.MapDotVisitor; import dol.visitor.dot.PNDotVisitor; import dol.visitor.hds.HdsVisitor; import dol.visitor.hdsd.HdsdVisitor; +import dol.visitor.Epiphany.EpiphanyVisitor; import dol.visitor.protothread.ProtothreadVisitor; import dol.visitor.rtems.RtemsVisitor; import dol.visitor.systemC.PNSystemCVisitor; @@ -197,6 +198,14 @@ public class Main { System.out.println(); } + if (_ui.getEpiphanyFlag() && (_pn != null)) { + System.out.println("Generating Epiphany package:"); + _pn.accept(new EpiphanyVisitor( + _ui.getEpiphanyCodeDirectoryName())); + System.out.println(" -- Generation [Finished]"); + System.out.println(); + } + if (_ui.getProtothreadFlag() && (_pn != null)) { System.out.println("Generating protothread package:"); _pn.accept(new ProtothreadVisitor( diff --git a/dol/src/dol/main/Options.java b/dol/src/dol/main/Options.java index b284d90..3177da2 100644 --- a/dol/src/dol/main/Options.java +++ b/dol/src/dol/main/Options.java @@ -73,6 +73,9 @@ public class Options { } else if(arg.equals("--PaF") || arg.equals("-PF") ) { _ui.setPipeAndFilterCodeDirectoryName(args[++i]); _ui.setPipeAndFilterFlag(); + } else if(arg.equals("--epiphany") || arg.equals("-E") ) { + _ui.setEpiphanyCodeDirectoryName(args[++i]); + _ui.setEpiphanyFlag(); } else if(arg.equals("--protothread") || arg.equals("-PT") ) { _ui.setProtothreadCodeDirectoryName(args[++i]); _ui.setProtothreadFlag(); @@ -192,7 +195,8 @@ public class Options { { "--profiling ", "-T", "" }, { "--vsplog ", "-L", "" }, { "--cbe ", "-CBE", "" }, - { "--yapi ", "-Y", "" } + { "--yapi ", "-Y", "" }, + { "--epiphany ", "-E", "" } }; /** diff --git a/dol/src/dol/main/UserInterface.java b/dol/src/dol/main/UserInterface.java index f9145ea..26d5add 100644 --- a/dol/src/dol/main/UserInterface.java +++ b/dol/src/dol/main/UserInterface.java @@ -44,6 +44,9 @@ public class UserInterface { // the RTEMS board support package for which code is generated private String _rtemsBSP = "pc386"; + // the Epiphany directory name + private String _epiphanyCodeDirectoryName = "nonameEpiphanyPackage"; + // the protothread directory name private String _protothreadCodeDirectoryName = "nonameHdsPackage"; @@ -81,6 +84,9 @@ public class UserInterface { // the SystemC flag private boolean _systemC = false; + // the Epiphany flag + private boolean _epiphanyFlag = false; + // the PipeAndFilter flag private boolean _pipeAndFilter = false; @@ -267,6 +273,24 @@ public class UserInterface { _codeDirectoryName = codeDirectoryName; } + /** + * Get the name of the Epiphany directory. + * + * @return The directory name of the Epiphany directory + */ + public final String getEpiphanyCodeDirectoryName() { + return _epiphanyCodeDirectoryName; + } + + /** + * Set the name of the Epiphany directory. + * + * @param codeDirectoryName Directory to generate Epiphany code in + */ + public final void setEpiphanyCodeDirectoryName(String codeDirectoryName) { + _epiphanyCodeDirectoryName = codeDirectoryName; + } + /** * Get the name of the PipeAndFilter directory. * @@ -443,6 +467,22 @@ public class UserInterface { _systemC = true; } + /** + * Get the status of the Epiphany flag. + * + * @return Epiphany flag value + */ + public final boolean getEpiphanyFlag() { + return _epiphanyFlag; + } + + /* + * Set the Epiphany flag. + */ + public final void setEpiphanyFlag() { + _epiphanyFlag = true; + } + /** * Get the status of the PipeAndFilter flag. * diff --git a/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java b/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java new file mode 100644 index 0000000..d2a39e8 --- /dev/null +++ b/dol/src/dol/visitor/epiphany/EpiphanyVisitor.java @@ -0,0 +1,10 @@ +package dol.visitor.Epiphany; + +import dol.visitor.PNVisitor; + +public class EpiphanyVisitor extends PNVisitor { + /* Constructor */ + public EpiphanyVisitor(String packageName) { + System.out.println("EPIPHANY VISITOR CONSTRUCTOR"); + } +} diff --git a/dol/src/dol/visitor/epiphany/package.html b/dol/src/dol/visitor/epiphany/package.html new file mode 100644 index 0000000..ad1c0e8 --- /dev/null +++ b/dol/src/dol/visitor/epiphany/package.html @@ -0,0 +1,20 @@ + + + + + + +Code generator for Epiphany platform. + +

Package Specification

+ + + +

Related Documentation

+ + + + + + + -- 2.30.2