Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with gradle #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gradle
build/
**/obj

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ Most of Jove is written in the Java 5.0 language, and should therefore work on a
| Microsoft Windows XP + Cygwin 1.5.18-1 | Intel x86 | GPL Cver |
| Apple Mac OS X 10.4.2 + J2SE 5.0 Release 1 | PowerPC | GPL Cver |


Modernization
----

An attempt is being made to upgrade Jove to build with Gradle on Java 17. It might be interesting to write a scheduler using Java Loom.


What Verilog simulators does Jove support?
----

Expand Down
59 changes: 59 additions & 0 deletions java/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//plugins {
// id 'java-library'
//}

//subprojects {
// apply plugin: "java-library"
// //sourceCompatibility = '1.5'
// sourceSets {
// main {
// java {
// srcDirs = ['src']
// }
// }
// test {
// java {
// srcDirs = ['test']
// }
// }
// }
//}
/*
project(":jove") {
repositories {
mavenCentral()
}
dependencies {
implementation project(":newisys-utils")
testImplementation "junit:junit:4.12"
}
}

project(":langschema") {
dependencies {
implementation project(":newisys-utils")
}
}
project(":langschema-java") {
dependencies {
implementation project(":langschema")
implementation project(":newisys-utils")
}
}
project(":langschema-jove") {
dependencies {
implementation project(":langschema-java")
implementation project(":langschema")
implementation project(":newisys-utils")
}
}
project(":randsolver") {
dependencies {
implementation project(":langschema-jove")
implementation project(":langschema-java")
implementation project(":langschema")
implementation project(":jove")
testImplementation "junit:junit:4.12"
}
}
*/
43 changes: 43 additions & 0 deletions java/jove-ifgen/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
id 'application'
id 'com.intershop.gradle.javacc' version '4.0.1'
}

javacc {
// configuration container for all javacc configurations
configs {
template {
inputFile = file('src/com/newisys/dv/ifgen/parser/IfgenParser.jj')
packageName = 'com.newisys.dv.ifgen.parser'
lookahead = '2'
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}
dependencies {
implementation project(":newisys-utils")
implementation project(":langschema")
implementation project(":langschema-java")
implementation project(":langschema-jove")
implementation project(":jove")
implementation 'org.apache.ant:ant:1.10.12'
testImplementation "junit:junit:4.12"
}

application {
mainClass = 'com.newisys.dv.ifgen.IfgenMain'
}
32 changes: 32 additions & 0 deletions java/jove-samples/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
id 'java-library'
}

sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}

dependencies {
implementation project(":langschema")
implementation project(":langschema-java")
implementation project(":langschema-jove")
implementation project(":jove-ifgen")
implementation project(":randsolver")
implementation project(":jove")
implementation project(":newisys-utils")
}

task createIfs(type: JavaExec) {
classpath = project(":jove-ifgen").sourceSets.main.runtimeClasspath
mainClass = 'com.newisys.dv.ifgen.IfgenMain'
args '-file', './src/com/newisys/samples/and3/and3.if'
}
22 changes: 22 additions & 0 deletions java/jove/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
id 'java-library'
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}
dependencies {
implementation project(":newisys-utils")
testImplementation "junit:junit:4.12"
}
2 changes: 1 addition & 1 deletion java/jove/src/com/newisys/behsim/BehavioralReg.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ else if (type == ValueType.VECTOR)
}
else if (type == ValueType.INT)
{
return new Integer(buffer.intValue());
return Integer.valueOf(buffer.intValue());
}
else if (type == ValueType.SUPPRESS)
{
Expand Down
2 changes: 1 addition & 1 deletion java/jove/src/com/newisys/behsim/BehavioralSimulation.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public long getSimTime()
*/
public double getScaledRealTime()
{
Long tmp = new Long(eventScheduler.getCurrentTime());
Long tmp = Long.valueOf(eventScheduler.getCurrentTime());
return tmp.doubleValue();
}

Expand Down
15 changes: 8 additions & 7 deletions java/jove/test/com/newisys/behsim/BehavioralRegTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private void doDriveDelayModeTest(

try
{
reggie.putValueDelay(new BitVector("16'h0001"), delay, mode);
reggie.putValueDelay(new BitVector("32'h0001"), delay, mode);

}
catch (UnsupportedOperationException e)
Expand All @@ -191,16 +191,16 @@ public void testValueChangeCallbackDefault()
TimeType timeType = TimeType.SIM;
ValueType valueType = ValueType.OBJ_TYPE;
VerilogTime time = new VerilogSimTime(0);
valueChangeCallbackTest(value, timeType, valueType, time);
valueChangeCallbackTest(reggie, value, timeType, valueType, time);
}

public void testValueChangeCallbackScaledRealInt()
{
Object value = new Integer(299772);
Object value = Integer.valueOf(299772);
TimeType timeType = TimeType.SCALED_REAL;
ValueType valueType = ValueType.INT;
VerilogTime time = new VerilogScaledRealTime(0.0);
valueChangeCallbackTest(value, timeType, valueType, time);
valueChangeCallbackTest(reggie, value, timeType, valueType, time);
}

public void testValueChangeCallbackSupressTimeScalar()
Expand All @@ -209,7 +209,7 @@ public void testValueChangeCallbackSupressTimeScalar()
TimeType timeType = TimeType.SUPPRESS;
ValueType valueType = ValueType.SCALAR;
VerilogTime time = null;
valueChangeCallbackTest(value, timeType, valueType, time);
valueChangeCallbackTest(new BehavioralReg(simulation, "Reggie", 1), value, timeType, valueType, time);
}

public void testValueChangeCallbackScaledRealVector()
Expand All @@ -218,7 +218,7 @@ public void testValueChangeCallbackScaledRealVector()
TimeType timeType = TimeType.SCALED_REAL;
ValueType valueType = ValueType.VECTOR;
VerilogTime time = new VerilogScaledRealTime(0.0);
valueChangeCallbackTest(value, timeType, valueType, time);
valueChangeCallbackTest(reggie, value, timeType, valueType, time);
}

public void testValueChangeCallbackSupressValueScalar()
Expand All @@ -227,10 +227,11 @@ public void testValueChangeCallbackSupressValueScalar()
TimeType timeType = TimeType.SCALED_REAL;
ValueType valueType = ValueType.SUPPRESS;
VerilogTime time = new VerilogScaledRealTime(0.0);
valueChangeCallbackTest(value, timeType, valueType, time);
valueChangeCallbackTest(reggie, value, timeType, valueType, time);
}

private void valueChangeCallbackTest(
BehavioralReg reggie,
Object value,
TimeType timeType,
ValueType valueType,
Expand Down
2 changes: 1 addition & 1 deletion java/jove/test/com/newisys/dv/MailboxTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final public void testMailbox()
doPeekNoWait(0);
doSize(SIZE * 2);

doToString(m1.getClass().getName() + "{m1}");
doToString("m1");
}

public void doPut()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ public void run()

List<Integer> order = soTest.order;
assertEquals(5, order.size());
assertEquals(new Integer(1), order.get(0));
assertEquals(new Integer(2), order.get(1));
assertEquals(new Integer(3), order.get(2));
assertEquals(new Integer(4), order.get(3));
assertEquals(new Integer(5), order.get(4));
assertEquals(Integer.valueOf(1), order.get(0));
assertEquals(Integer.valueOf(2), order.get(1));
assertEquals(Integer.valueOf(3), order.get(2));
assertEquals(Integer.valueOf(4), order.get(3));
assertEquals(Integer.valueOf(5), order.get(4));

}
}
Expand Down
2 changes: 1 addition & 1 deletion java/jove/test/com/newisys/printf/TestPrintf.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void testStringConversions()
public void testSignedConversion()
{
// only %d and %i should be signed for a signed type
Object o = new Short((short) -1);
Object o = Short.valueOf((short) -1);
assertEquals("1111111111111111", Printf.sprintf("%b", o));
assertEquals("177777", Printf.sprintf("%o", o));
assertEquals("-1", Printf.sprintf("%d", o));
Expand Down
21 changes: 21 additions & 0 deletions java/langschema-java/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id 'java-library'
}

sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}

dependencies {
implementation project(":newisys-utils")
implementation project(":langschema")
}
22 changes: 22 additions & 0 deletions java/langschema-jove/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
id 'java-library'
}

sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}

dependencies {
implementation project(":newisys-utils")
implementation project(":langschema")
implementation project(":langschema-java")
}
20 changes: 20 additions & 0 deletions java/langschema/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
id 'java-library'
}

sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}

dependencies {
implementation project(":newisys-utils")
}
16 changes: 16 additions & 0 deletions java/newisys-utils/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
id 'java-library'
}

sourceSets {
main {
java {
srcDirs = ['src']
}
}
test {
java {
srcDirs = ['test']
}
}
}
Loading