summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorStefan Radomski <sradomski@mintwerk.de>2016-01-26 08:39:58 (GMT)
committerStefan Radomski <sradomski@mintwerk.de>2016-01-26 08:39:58 (GMT)
commitda54846c2ea8cf35c22b70a2a7a53f525df8f0c9 (patch)
treeaf25f3da6922e8f114f1020b52e9065564cdc82e /apps
parent18bca76b4f4d81db962e97cfe79611461a8b7e61 (diff)
downloaduscxml-da54846c2ea8cf35c22b70a2a7a53f525df8f0c9.zip
uscxml-da54846c2ea8cf35c22b70a2a7a53f525df8f0c9.tar.gz
uscxml-da54846c2ea8cf35c22b70a2a7a53f525df8f0c9.tar.bz2
VHDL transformation
Diffstat (limited to 'apps')
-rw-r--r--apps/uscxml-transform.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/uscxml-transform.cpp b/apps/uscxml-transform.cpp
index 64d6b06..bb1fae3 100644
--- a/apps/uscxml-transform.cpp
+++ b/apps/uscxml-transform.cpp
@@ -2,6 +2,7 @@
#include "uscxml/Interpreter.h"
#include "uscxml/transform/ChartToFlatSCXML.h"
#include "uscxml/transform/ChartToC.h"
+#include "uscxml/transform/ChartToVHDL.h"
#include "uscxml/transform/ChartToTex.h"
#include "uscxml/transform/ChartToMinimalSCXML.h"
#include "uscxml/transform/ChartToPromela.h"
@@ -72,6 +73,7 @@ void printUsageAndExit(const char* progName) {
printf("Options\n");
printf("\t-t c : convert to C program\n");
printf("\t-t pml : convert to spin/promela program\n");
+ printf("\t-t vhdl : convert to VHDL hardware description\n");
printf("\t-t flat : flatten to SCXML state-machine\n");
printf("\t-t min : minimize SCXML state-chart\n");
printf("\t-t tex : write global state transition table as tex file\n");
@@ -223,6 +225,7 @@ int main(int argc, char** argv) {
outType != "scxml" &&
outType != "pml" &&
outType != "c" &&
+ outType != "vhdl" &&
outType != "min" &&
outType != "tex" &&
std::find(annotations.begin(), annotations.end(), "priority") == annotations.end() &&
@@ -279,6 +282,18 @@ int main(int argc, char** argv) {
exit(EXIT_SUCCESS);
}
+ if (outType == "vhdl") {
+ if (outputFile.size() == 0 || outputFile == "-") {
+ ChartToVHDL::transform(interpreter).writeTo(std::cout);
+ } else {
+ std::ofstream outStream;
+ outStream.open(outputFile.c_str());
+ ChartToVHDL::transform(interpreter).writeTo(outStream);
+ outStream.close();
+ }
+ exit(EXIT_SUCCESS);
+ }
+
if (outType == "pml") {
if (outputFile.size() == 0 || outputFile == "-") {
ChartToPromela::transform(interpreter).writeTo(std::cout);