diff --git a/com.minres.rdl.parent/com.minres.rdl.product/META-INF/MANIFEST.MF b/com.minres.rdl.parent/com.minres.rdl.product/META-INF/MANIFEST.MF index 17e031b..1d1c713 100644 --- a/com.minres.rdl.parent/com.minres.rdl.product/META-INF/MANIFEST.MF +++ b/com.minres.rdl.parent/com.minres.rdl.product/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: RDL Editor Bundle-SymbolicName: com.minres.rdl.product;singleton:=true -Bundle-Version: 1.1.0.qualifier +Bundle-Version: 1.1.1.qualifier Bundle-Vendor: MINRES Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0" diff --git a/com.minres.rdl.parent/com.minres.rdl.product/com.minres.rdl.product.product b/com.minres.rdl.parent/com.minres.rdl.product/com.minres.rdl.product.product index baf0f9b..d5bf213 100644 --- a/com.minres.rdl.parent/com.minres.rdl.product/com.minres.rdl.product.product +++ b/com.minres.rdl.parent/com.minres.rdl.product/com.minres.rdl.product.product @@ -1,8 +1,7 @@ - - + @@ -14,14 +13,13 @@ - + - diff --git a/com.minres.rdl.parent/com.minres.rdl.product/pom.xml b/com.minres.rdl.parent/com.minres.rdl.product/pom.xml index 9623e89..097a8bb 100644 --- a/com.minres.rdl.parent/com.minres.rdl.product/pom.xml +++ b/com.minres.rdl.parent/com.minres.rdl.product/pom.xml @@ -4,7 +4,7 @@ com.minres.rdl com.minres.rdl.parent - 1.1.0-SNAPSHOT + 1.0.0-SNAPSHOT com.minres.rdl.product eclipse-application @@ -18,4 +18,5 @@ + 1.1.1-SNAPSHOT diff --git a/com.minres.rdl.parent/com.minres.rdl.standalone/pom.xml b/com.minres.rdl.parent/com.minres.rdl.standalone/pom.xml index 7e24245..68a0405 100644 --- a/com.minres.rdl.parent/com.minres.rdl.standalone/pom.xml +++ b/com.minres.rdl.parent/com.minres.rdl.standalone/pom.xml @@ -168,6 +168,7 @@ com.minres.rdl.parent com.minres.rdl - 1.1.0-SNAPSHOT + 1.0.0-SNAPSHOT + 1.1.1-SNAPSHOT \ No newline at end of file diff --git a/com.minres.rdl.parent/com.minres.rdl.target/pom.xml b/com.minres.rdl.parent/com.minres.rdl.target/pom.xml index 019e21f..0255d6b 100644 --- a/com.minres.rdl.parent/com.minres.rdl.target/pom.xml +++ b/com.minres.rdl.parent/com.minres.rdl.target/pom.xml @@ -4,7 +4,7 @@ com.minres.rdl com.minres.rdl.parent - 1.1.0-SNAPSHOT + 1.0.0-SNAPSHOT com.minres.rdl.target eclipse-target-definition diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/.gitignore b/com.minres.rdl.parent/com.minres.rdl.ui/.gitignore new file mode 100644 index 0000000..6dfe64e --- /dev/null +++ b/com.minres.rdl.parent/com.minres.rdl.ui/.gitignore @@ -0,0 +1 @@ +/plugin.xml_gen diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/META-INF/MANIFEST.MF b/com.minres.rdl.parent/com.minres.rdl.ui/META-INF/MANIFEST.MF index a64ad21..06c5a1c 100644 --- a/com.minres.rdl.parent/com.minres.rdl.ui/META-INF/MANIFEST.MF +++ b/com.minres.rdl.parent/com.minres.rdl.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: com.minres.rdl.ui Bundle-Vendor: My Company -Bundle-Version: 1.1.0.qualifier +Bundle-Version: 1.1.1.qualifier Bundle-SymbolicName: com.minres.rdl.ui; singleton:=true Bundle-ActivationPolicy: lazy Require-Bundle: com.minres.rdl, diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/build.properties b/com.minres.rdl.parent/com.minres.rdl.ui/build.properties index 323f56c..f931a87 100644 --- a/com.minres.rdl.parent/com.minres.rdl.ui/build.properties +++ b/com.minres.rdl.parent/com.minres.rdl.ui/build.properties @@ -3,5 +3,6 @@ source.. = src/,\ xtend-gen/ bin.includes = .,\ META-INF/,\ - plugin.xml + plugin.xml,\ + icons/ bin.excludes = **/*.xtend diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/pom.xml b/com.minres.rdl.parent/com.minres.rdl.ui/pom.xml index 3a7f878..ee61d4b 100644 --- a/com.minres.rdl.parent/com.minres.rdl.ui/pom.xml +++ b/com.minres.rdl.parent/com.minres.rdl.ui/pom.xml @@ -4,7 +4,7 @@ com.minres.rdl com.minres.rdl.parent - 1.1.0-SNAPSHOT + 1.0.0-SNAPSHOT com.minres.rdl.ui eclipse-plugin @@ -18,4 +18,5 @@ + 1.1.1-SNAPSHOT diff --git a/com.minres.rdl.parent/com.minres.rdl/.gitignore b/com.minres.rdl.parent/com.minres.rdl/.gitignore new file mode 100644 index 0000000..a9f1b80 --- /dev/null +++ b/com.minres.rdl.parent/com.minres.rdl/.gitignore @@ -0,0 +1,4 @@ +/Run RDL Generator DBT-RISCV (test).launch +/Run RDL Generator DBT-RISCV.launch +/Run RDL Generator SC-Components-Test.launch +/plugin.xml_gen diff --git a/com.minres.rdl.parent/com.minres.rdl/pom.xml b/com.minres.rdl.parent/com.minres.rdl/pom.xml index 4307b96..20d939a 100644 --- a/com.minres.rdl.parent/com.minres.rdl/pom.xml +++ b/com.minres.rdl.parent/com.minres.rdl/pom.xml @@ -4,7 +4,7 @@ com.minres.rdl com.minres.rdl.parent - 1.1.0-SNAPSHOT + 1.0.0-SNAPSHOT com.minres.rdl eclipse-plugin @@ -146,4 +146,5 @@ + 1.1.0-SNAPSHOT diff --git a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/AddrmapGenerator.xtend b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/AddrmapGenerator.xtend index 572fcd2..3aa455f 100644 --- a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/AddrmapGenerator.xtend +++ b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/AddrmapGenerator.xtend @@ -2,6 +2,8 @@ package com.minres.rdl.generator import com.minres.rdl.generator.RdlBaseGenerator import com.minres.rdl.rdl.ComponentDefinition +import com.minres.rdl.IntegerWithRadix +import com.minres.rdl.rdl.ComponentDefinitionType class AddrmapGenerator extends RdlBaseGenerator { @@ -15,10 +17,12 @@ class AddrmapGenerator extends RdlBaseGenerator { #ifndef _E300_PLAT_MAP_H_ #define _E300_PLAT_MAP_H_ // need double braces, see https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191 - const std::array, 3> e300_plat_map = {{ - {&i_gpio, 0x10012000, 0x1000}, - {&i_uart, 0x10013000, 0x1000}, - {&i_spi, 0x10014000, 0x1000} + const std::array, «componentDefinition.instanceCount(ComponentDefinitionType.REGFILE)»> e300_plat_map = {{ + «FOR instantiation : componentDefinition.instantiationsOfType(ComponentDefinitionType.REGFILE)» + «FOR instance : instantiation.componentInstances» + {&i_«instance.name», 0x«Long.toHexString((instance.address as IntegerWithRadix).value)», 0x«Long.toHexString(instantiation.byteSize)»}, + «ENDFOR» + «ENDFOR» }}; #endif /* _E300_PLAT_MAP_H_ */ @@ -29,4 +33,5 @@ class AddrmapGenerator extends RdlBaseGenerator { '' } + } \ No newline at end of file diff --git a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend index 38da2f4..45c3521 100644 --- a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend +++ b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend @@ -1,11 +1,9 @@ package com.minres.rdl.generator - import com.google.inject.Inject import com.google.inject.Provider import com.minres.rdl.RDLStandaloneSetup import java.lang.reflect.MalformedParametersException -import java.util.ArrayList import org.eclipse.emf.common.util.URI import org.eclipse.emf.ecore.resource.ResourceSet import org.eclipse.emf.mwe.utils.ProjectMapping @@ -19,34 +17,33 @@ import org.eclipse.xtext.util.CancelIndicator import org.eclipse.xtext.validation.CheckMode import org.eclipse.xtext.validation.IResourceValidator import java.text.ParseException +import com.minres.rdl.generator.Options.Multiplicity +import com.minres.rdl.generator.Options.Separator +import org.eclipse.xtext.generator.IFileSystemAccess class Main { - static class Option { - String flag - String value - def Option(String flag, String value) { - this.flag = flag - this.value = value - } - } + + private val USAGE_STR = "RDL2code [-h] [-v] [-I ] "; def static main(String[] args) { if (args.empty) { - System::err.println('Aborting: no path to EMF resource provided!') + System::err.println('Aborting: no path to RDL file provided!') return } - - try { - val injector = new RDLStandaloneSetup().createInjectorAndDoEMFRegistration - injector.getInstance(Main).run(args) - } catch(MalformedParametersException e){ - print("Command line error "+e.message) - } catch(IllegalArgumentException e){ - print("generation error "+e.message) + val injector = new RDLStandaloneSetup().createInjectorAndDoEMFRegistration + val main = injector.getInstance(Main) + try { + main.run(args) + } catch (MalformedParametersException e) { + print("Command line error " + e.message) + System.exit(1) + } catch (IllegalArgumentException e) { + print("generation error " + e.message) e.printStackTrace - } catch(ParseException e){ - print("parse problem "+e.message+" ("+ e.errorOffset+")") - + System.exit(2) + } catch (ParseException e) { + print("parse problem " + e.message + " (" + e.errorOffset + ")") + System.exit(3) } } @@ -58,89 +55,71 @@ class Main { @Inject JavaIoFileSystemAccess fileAccess - var optsList = new ArrayList