updates coredsl version and makes BitValues with leading zeros

This commit is contained in:
2025-09-27 12:30:34 +02:00
parent 6ee86b26db
commit b37ab5d008
10 changed files with 24 additions and 15 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
/.launch/ /.launch/
/.settings/ /.settings/
/RV32GC.json /*.json

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>com.minres.coredsl.json.parent</artifactId> <artifactId>com.minres.coredsl.json.parent</artifactId>
<groupId>com.minres.coredsl</groupId> <groupId>com.minres.coredsl</groupId>
<version>2.0.1</version> <version>2.0.2</version>
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
<artifactId>com.minres.coredsl.json.standalone</artifactId> <artifactId>com.minres.coredsl.json.standalone</artifactId>

View File

@@ -19,9 +19,9 @@
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.26.0/"/> <repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.26.0/"/>
</location> </location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.google.gson" version="2.8.9.v20220111-1409"/> <unit id="com.google.gson" version="2.8.9.v202.0.21-1409"/>
<unit id="com.google.inject" version="5.0.1.v20210324-2015"/> <unit id="com.google.inject" version="5.0.1.v20210324-2015"/>
<unit id="javax.inject" version="1.0.0.v20091030"/> <unit id="javax.inject" version="1.0.0.v2.0.2030"/>
<unit id="org.junit" version="4.13.2.v20211018-1956"/> <unit id="org.junit" version="4.13.2.v20211018-1956"/>
<unit id="org.apiguardian" version="1.1.2.v20211018-1956"/> <unit id="org.apiguardian" version="1.1.2.v20211018-1956"/>
<unit id="org.junit.jupiter.api" version="5.8.1.v20211018-1956"/> <unit id="org.junit.jupiter.api" version="5.8.1.v20211018-1956"/>
@@ -32,14 +32,14 @@
<unit id="org.junit.platform.runner" version="1.8.1.v20211018-1956"/> <unit id="org.junit.platform.runner" version="1.8.1.v20211018-1956"/>
<unit id="org.junit.platform.suite.commons" version="1.8.1.v20211018-1956"/> <unit id="org.junit.platform.suite.commons" version="1.8.1.v20211018-1956"/>
<unit id="org.opentest4j" version="1.2.0.v20211018-1956"/> <unit id="org.opentest4j" version="1.2.0.v20211018-1956"/>
<unit id="org.objectweb.asm" version="9.2.0.v20210813-1119"/> <unit id="org.objectweb.asm" version="9.2.0.v202.0.23-1119"/>
<unit id="org.objectweb.asm.tree" version="9.2.0.v20210813-1119"/> <unit id="org.objectweb.asm.tree" version="9.2.0.v202.0.23-1119"/>
<unit id="io.github.classgraph" version="4.8.138.v20211212-1642"/> <unit id="io.github.classgraph" version="4.8.138.v20211212-1642"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/2022-03"/> <repository location="https://download.eclipse.org/tools/orbit/downloads/2022-03"/>
<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://minres.github.io/CoreDSL/repository/2.0/2.0.17"/> <repository location="https://minres.github.io/CoreDSL/repository/2.0/2.0.28"/>
<unit id="com.minres.coredsl.feature.source.feature.group" version="0.0.0"/> <unit id="com.minres.coredsl.feature.source.feature.group" version="0.0.0"/>
<unit id="com.minres.coredsl.feature.feature.group" version="0.0.0"/> <unit id="com.minres.coredsl.feature.feature.group" version="0.0.0"/>
</location> </location>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.coredsl</groupId> <groupId>com.minres.coredsl</groupId>
<artifactId>com.minres.coredsl.json.parent</artifactId> <artifactId>com.minres.coredsl.json.parent</artifactId>
<version>2.0.1</version> <version>2.0.2</version>
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
<artifactId>com.minres.coredsl.json.target</artifactId> <artifactId>com.minres.coredsl.json.target</artifactId>

View File

@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: com.minres.coredsl.json.dbt_rise.tests Automatic-Module-Name: com.minres.coredsl.json.dbt_rise.tests
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Vendor: MINRES Technologies GmbH Bundle-Vendor: MINRES Technologies GmbH
Bundle-Version: 2.0.1 Bundle-Version: 2.0.2
Bundle-SymbolicName: com.minres.coredsl.json.tests;singleton:=true Bundle-SymbolicName: com.minres.coredsl.json.tests;singleton:=true
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Require-Bundle: com.minres.coredsl.json;bundle-version="1.0.0", Require-Bundle: com.minres.coredsl.json;bundle-version="1.0.0",

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.coredsl</groupId> <groupId>com.minres.coredsl</groupId>
<artifactId>com.minres.coredsl.json.parent</artifactId> <artifactId>com.minres.coredsl.json.parent</artifactId>
<version>2.0.1</version> <version>2.0.2</version>
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
<artifactId>com.minres.coredsl.json.tests</artifactId> <artifactId>com.minres.coredsl.json.tests</artifactId>

View File

@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: com.minres.coredsl.json Automatic-Module-Name: com.minres.coredsl.json
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Vendor: MINRES Technologies GmbH Bundle-Vendor: MINRES Technologies GmbH
Bundle-Version: 2.0.1 Bundle-Version: 2.0.2
Bundle-SymbolicName: com.minres.coredsl.json;singleton:=true Bundle-SymbolicName: com.minres.coredsl.json;singleton:=true
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Require-Bundle: com.minres.coredsl;bundle-version="2.0.0", Require-Bundle: com.minres.coredsl;bundle-version="2.0.0",

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.coredsl</groupId> <groupId>com.minres.coredsl</groupId>
<artifactId>com.minres.coredsl.json.parent</artifactId> <artifactId>com.minres.coredsl.json.parent</artifactId>
<version>2.0.1</version> <version>2.0.2</version>
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
<artifactId>com.minres.coredsl.json</artifactId> <artifactId>com.minres.coredsl.json</artifactId>

View File

@@ -20,6 +20,7 @@ import org.json.JSONObject
import org.json.JSONArray import org.json.JSONArray
import com.minres.coredsl.coreDsl.Statement import com.minres.coredsl.coreDsl.Statement
import org.eclipse.xtext.resource.XtextResource import org.eclipse.xtext.resource.XtextResource
import com.minres.coredsl.util.TypedBigInteger
/** /**
* Generates code from your model files on save. * Generates code from your model files on save.
@@ -108,7 +109,15 @@ class CoreDslJsonGenerator extends AbstractGenerator {
def dispatch asString(BitField i) '''«i.name»[«i.startIndex.value.intValue»:«i.endIndex.value.intValue»]''' def dispatch asString(BitField i) '''«i.name»[«i.startIndex.value.intValue»:«i.endIndex.value.intValue»]'''
def dispatch asString(BitValue i) { def dispatch asString(BitValue i) {
i.value.toString(2) val str = i.value.toString(2)
if(i.value instanceof TypedBigInteger) {
val v = i.value as TypedBigInteger
if(v.size > str.length) {
val format_string = String.format("%%%ds", v.size)
return String.format(format_string, str).replace(' ', '0');
}
}
return str
} }

View File

@@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.minres.coredsl</groupId> <groupId>com.minres.coredsl</groupId>
<version>2.0.1</version> <version>2.0.2</version>
<artifactId>com.minres.coredsl.json.parent</artifactId> <artifactId>com.minres.coredsl.json.parent</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
@@ -95,7 +95,7 @@
<artifact> <artifact>
<groupId>com.minres.coredsl</groupId> <groupId>com.minres.coredsl</groupId>
<artifactId>com.minres.coredsl.json.target</artifactId> <artifactId>com.minres.coredsl.json.target</artifactId>
<version>2.0.1</version> <version>2.0.2</version>
</artifact> </artifact>
</target> </target>
<environments> <environments>