diff --git a/.gitignore b/.gitignore
index 98aba88..549b265 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/.launch/
/.settings/
+/RV32GC.json
diff --git a/com.minres.coredsl.json.target/com.minres.coredsl.json.target.target b/com.minres.coredsl.json.target/com.minres.coredsl.json.target.target
index 79fb4c3..264f25a 100644
--- a/com.minres.coredsl.json.target/com.minres.coredsl.json.target.target
+++ b/com.minres.coredsl.json.target/com.minres.coredsl.json.target.target
@@ -39,7 +39,7 @@
-
+
diff --git a/com.minres.coredsl.json/src/com/minres/coredsl/json/CoreDslJsonGenerator.xtend b/com.minres.coredsl.json/src/com/minres/coredsl/json/CoreDslJsonGenerator.xtend
index a475b58..59bbde7 100644
--- a/com.minres.coredsl.json/src/com/minres/coredsl/json/CoreDslJsonGenerator.xtend
+++ b/com.minres.coredsl.json/src/com/minres/coredsl/json/CoreDslJsonGenerator.xtend
@@ -45,7 +45,7 @@ class CoreDslJsonGenerator extends AbstractGenerator {
}
def JSONArray compile(CoreDef coreDef) {
val insts = coreDef.allInstr
- val enabled_insts = insts.filter[it.isHls]
+ val enabled_insts = insts//.filter[it.isHls]
val res = enabled_insts.map[ inst | inst.jsonDescr ].toList
return res.length>0?new JSONArray(res) :new JSONArray()
}
@@ -60,7 +60,11 @@ class CoreDslJsonGenerator extends AbstractGenerator {
}
def String getSource(Statement stmt){
- (stmt.eResource as XtextResource).serializer.serialize(stmt)
+ try {
+ (stmt.eResource as XtextResource).serializer.serialize(stmt)
+ } catch(RuntimeException e){
+ ""
+ }
}
def Iterable allInstr(CoreDef core) {
diff --git a/com.minres.coredsl.json/src/com/minres/coredsl/json/Main.xtend b/com.minres.coredsl.json/src/com/minres/coredsl/json/Main.xtend
index f159797..c6072e7 100644
--- a/com.minres.coredsl.json/src/com/minres/coredsl/json/Main.xtend
+++ b/com.minres.coredsl.json/src/com/minres/coredsl/json/Main.xtend
@@ -28,6 +28,7 @@ import org.eclipse.xtext.generator.IFileSystemAccess
import java.lang.reflect.MalformedParametersException
import org.apache.log4j.Level
import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.xtext.diagnostics.Severity
class Main implements Callable {
@@ -83,10 +84,17 @@ class GeneratorMain {
val resource = resourceSet.getResource(URI.createFileURI(file.absolutePath), true)
// Validate the resource
val issues = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl)
- if (!issues.empty) {
- logger.error("Error validating " + resource.URI)
- issues.forEach[logger.error(it)]
- throw new ParseException("error validating " + resource.URI)
+ if (!issues.empty) {
+ val errors = issues.filter[it.severity == Severity.ERROR]
+ val warnings = issues.filter[it.severity == Severity.WARNING]
+ if (!errors.empty) {
+ logger.error("Error validating " + resource.URI)
+ issues.forEach[logger.error(it)]
+ throw new ParseException("error validating " + resource.URI)
+ } else if (!warnings.empty) {
+ logger.warn("There are warnings validating " + resource.URI)
+ issues.forEach[logger.warn(it)]
+ }
}
// Configure and start the generator
resource.runGenerator(params.outputFile)