update target definition
This commit is contained in:
parent
2f8940ddb1
commit
7f09cd6907
@ -48,9 +48,8 @@
|
|||||||
<unit id="org.json" version="1.0.0.v201011060100"/>
|
<unit id="org.json" version="1.0.0.v201011060100"/>
|
||||||
</location>
|
</location>
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||||
<repository location="https://artifactory.minres.com/artifactory/eclipse/CoreDSL-2.0.1"/>
|
<repository location="https://artifactory.minres.com/artifactory/eclipse/CoreDSL/2.0"/>
|
||||||
<unit id="com.minres.coredsl.feature.feature.group" version="2.0.1.202109251203"/>
|
<unit id="com.minres.coredsl.feature.feature.group" version="2.0.1.202109261307"/>
|
||||||
<unit id="com.minres.coredsl.feature.source.feature.group" version="2.0.1.202109251203"/>
|
|
||||||
</location>
|
</location>
|
||||||
</locations>
|
</locations>
|
||||||
</target>
|
</target>
|
@ -20,6 +20,7 @@ import com.minres.coredsl.coreDsl.ISA
|
|||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import com.minres.coredsl.util.BigIntegerWithRadix
|
import com.minres.coredsl.util.BigIntegerWithRadix
|
||||||
|
import com.minres.coredsl.coreDsl.Statement
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates code from your model files on save.
|
* Generates code from your model files on save.
|
||||||
@ -27,7 +28,7 @@ import com.minres.coredsl.util.BigIntegerWithRadix
|
|||||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
|
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
|
||||||
*/
|
*/
|
||||||
class CoreDslJsonGenerator extends AbstractGenerator {
|
class CoreDslJsonGenerator extends AbstractGenerator {
|
||||||
|
|
||||||
val logger = Logger.getLogger(typeof(CoreDslJsonGenerator));
|
val logger = Logger.getLogger(typeof(CoreDslJsonGenerator));
|
||||||
|
|
||||||
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
|
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
|
||||||
@ -55,9 +56,34 @@ class CoreDslJsonGenerator extends AbstractGenerator {
|
|||||||
ret.put("decoding", inst.encoding.fields.map[it.asString].join(' '))
|
ret.put("decoding", inst.encoding.fields.map[it.asString].join(' '))
|
||||||
ret.put("name", inst.name);
|
ret.put("name", inst.name);
|
||||||
ret.put('disassembly', inst.disass !== null? inst.name.toLowerCase + ' ' + inst.disass.toLowerCase : inst.name)
|
ret.put('disassembly', inst.disass !== null? inst.name.toLowerCase + ' ' + inst.disass.toLowerCase : inst.name)
|
||||||
ret.put('execution', inst.behavior.toString)
|
ret.put('execution', inst.behavior.source)
|
||||||
ret.put('restrictions', '')
|
ret.put('restrictions', '')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def String getSource(Statement stmt){
|
||||||
|
// val c = CoreDslFactory.eINSTANCE.createDescriptionContent => [
|
||||||
|
// definitions += CoreDslFactory.eINSTANCE.createISA => [
|
||||||
|
// name = 'dummy'
|
||||||
|
// instructions += CoreDslFactory.eINSTANCE.createInstruction => [
|
||||||
|
// name = 'dummy'
|
||||||
|
// encoding = CoreDslFactory.eINSTANCE.createEncoding => [
|
||||||
|
// fields += CoreDslFactory.eINSTANCE.createBitField => [
|
||||||
|
// name = 'dummy'
|
||||||
|
// left = CoreDslFactory.eINSTANCE.createIntegerConstant => [ value= BigInteger.valueOf(32) ]
|
||||||
|
// right = CoreDslFactory.eINSTANCE.createIntegerConstant => [ value= BigInteger.ZERO ]
|
||||||
|
// ]
|
||||||
|
// ]
|
||||||
|
// behavior = stmt
|
||||||
|
// ]
|
||||||
|
// ]
|
||||||
|
// ]
|
||||||
|
// val rs = rsp.get
|
||||||
|
// val r = rs.createResource(URI.createURI("dummy.core_desc"))
|
||||||
|
// r.contents+=c
|
||||||
|
// c.serialize
|
||||||
|
stmt.toString
|
||||||
|
}
|
||||||
|
|
||||||
def Iterable<Instruction> allInstr(CoreDef core) {
|
def Iterable<Instruction> allInstr(CoreDef core) {
|
||||||
val unique = newLinkedHashMap
|
val unique = newLinkedHashMap
|
||||||
val instrList = if (core.contributingType.size == 0)
|
val instrList = if (core.contributingType.size == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user