-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2,309 changed files
with
694,967 additions
and
8,726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Changelog | ||
|
||
- Core - changes relates to Kopycat emulator core/kernel | ||
- x86/ARM/MIPS etc - changes relates to this architecture/processor core | ||
- Gradle - changes in Gradle plugins or build scripts | ||
|
||
## Version 0.3.20 | ||
|
||
Release date: 05.2020 | ||
|
||
Kopycat now is fully open-source project. In this release we try do our best to run different widespread systems on Kopycat emulator. Previous release can run STM32F0xx with FreeRTOS operating system. This time we add various examples of firmwares for unittesting emulator and to work with different peripheral modules. But the most exciting addition is Kopycat runs Linux on ARM MCU's ARM1176JZ. All these samples presented in sources and as prebuild modules. Also, a lot of bugs has been fixed in emulator core and in modules. | ||
|
||
### Added | ||
|
||
- Core: full open-source release | ||
- Core: moved to OpenJDK and version updated to 11.0.x | ||
- Core: register bank system `ARegisterBankNG` to simplify configuring processor core (currently only in ARM) | ||
- Core: implemented fast wait-for-interrupt processing | ||
- Auxiliary: NANDGen - NAND modules generator based on standard NAND parameters | ||
- Auxiliary: NANDPart - NAND dump loader to partition dump by pages and add ECC in spares | ||
- ARM: implemented partially MCU ARM1176JZ (enough to run Linux 2.6.x) | ||
- ARM: implemented ARMv6 Coprocessor and MMU | ||
- ARM: implemented generic timer for ARMv6 | ||
- ARM: implemented NS16550 UART-controller | ||
- ARM: implemented PL190 (VIC) Vector Interrupt Controller | ||
- ARM: implemented VirtARM - a virtual ARM-based device | ||
- ARM: U-boot and Linux prebuild binaries based on buildroot in example | ||
- ARM: implemented DMA-controller in STM32F042 | ||
- Others: different examples to show possible cases how to use Kopycat in projects | ||
- Others: tested development of firmware to STM32 controller using CLion and Kopycat | ||
- Gradle: Kopycat build plugin to simplify a configuration `build.gradle` of new emulator modules | ||
- Gradle: dokkaMultilang build plugin to generate documentation on multiple languages, each language tags with "{EN}"/"{RU}" tokens | ||
|
||
### Modified | ||
|
||
- Core: embedded Python interpreter fixes, add autodetect of Python version and Jep library path | ||
- ARM: fixed a lot of bugs in CPU's instructions | ||
- ARM: fixed bugs in STM32F042 | ||
|
||
## Version 0.3.1 | ||
|
||
Release date: 26.12.2019 | ||
|
||
### Added | ||
|
||
- Core: dynamic loading of Jep library (only for Python2) | ||
- Core: logging calls when access to buses | ||
- Core: slave port now can be connected to several buses | ||
|
||
### Modified | ||
|
||
- Core: fixed different bugs | ||
- Core: CPU's cores tracer modified | ||
- Core: method `exec` renamed to `cont` (incompatibility with Python interpreter) | ||
- x86: fixed buses connection in x86Core | ||
- x86: fixed critical bug of on cross page memory access (for Paging access mode) | ||
- x86: bugs fixed in instructions (rol, ror) | ||
- x86: implemented instructions: hlt, btr, partially support FPU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.3.20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,45 @@ | ||
apply plugin: 'java' | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
ext.productionDirectoryPath = "${rootProject.projectDir}/production" | ||
ext.jarOutputDirectoryPath = "${productionDirectoryPath}/library" | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' apply false | ||
} | ||
|
||
dependencies { | ||
compile project(':cores:mips') | ||
compile project(':cores:x86') | ||
compile project(':cores:v850es') | ||
compile project(':cores:msp430') | ||
compile project(':cores:arm') | ||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
jcenter() | ||
maven { url "https://jitpack.io" } | ||
} | ||
|
||
compile project(':mcu:cortexm0') | ||
compile project(':mcu:stm32f0xx') | ||
compile project(':mcu:msp430x44x') | ||
ext.kotlinx_version = "1.0.1" | ||
} | ||
|
||
subprojects { | ||
afterEvaluate { | ||
tasks.each { task -> | ||
if (task instanceof Test) { | ||
task.jvmArgs += ["-Xms2G", "-Xmx5G", "-XX:MaxDirectMemorySize=2g"] | ||
|
||
task.testLogging { | ||
events "passed", "skipped", "failed" //, "standardOut", "standardError" | ||
|
||
showExceptions true | ||
exceptionFormat "full" | ||
showCauses true | ||
showStackTraces true | ||
|
||
// showStandardStreams = false | ||
} | ||
} | ||
|
||
if (task instanceof KotlinCompile) { | ||
task.kotlinOptions { | ||
jvmTarget = "11" | ||
apiVersion = "1.3" | ||
languageVersion = "1.3" | ||
} | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version "1.3.61" | ||
id 'org.gradle.java-gradle-plugin' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
jcenter() | ||
maven { url "https://jitpack.io" } | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin") | ||
implementation group: 'org.jetbrains.dokka', name: 'dokka-gradle-plugin', version: '0.10.0' | ||
implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '+' | ||
implementation("com.github.inforion:kotlin-extensions:+") | ||
implementation("com.auth0:java-jwt:3.8.0") | ||
implementation('com.github.oshi:oshi-core:3.13.0') | ||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.2") | ||
implementation group: 'org.reflections', name: 'reflections', version: '0.9.11' | ||
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.8' | ||
|
||
|
||
testImplementation("junit:junit:4.12") | ||
testImplementation('org.junit.jupiter:junit-jupiter-api:5.1.0') | ||
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.1.0') | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
create("gradle-build-config-plugin") { | ||
id = "ru.inforion.lab403.gradle.buildConfig" | ||
implementationClass = "ru.inforion.lab403.gradle.buildConfig.BuildConfigPlugin" | ||
} | ||
|
||
create("gradle-version-config-plugin") { | ||
id = "ru.inforion.lab403.gradle.versionConfig" | ||
implementationClass = "ru.inforion.lab403.gradle.versionConfig.VersionConfigPlugin" | ||
} | ||
|
||
create("gradle-dokka-mutltilang-plugin") { | ||
id = "ru.inforion.lab403.gradle.dokkaMultilang" | ||
implementationClass = "ru.inforion.lab403.gradle.dokkaMultilang.DokkaMultilangPlugin" | ||
} | ||
|
||
create("gradle-kopycat-plugin") { | ||
id = "ru.inforion.lab403.gradle.kopycat" | ||
implementationClass = "ru.inforion.lab403.gradle.kopycat.KopycatPlugin" | ||
} | ||
|
||
|
||
} | ||
} | ||
|
||
|
||
|
||
compileKotlin { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
freeCompilerArgs += ['-Xuse-experimental=kotlin.contracts.ExperimentalContracts'] | ||
} | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
freeCompilerArgs += ['-Xuse-experimental=kotlin.contracts.ExperimentalContracts'] | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
buildSrc/src/main/kotlin/ru/inforion/lab403/gradle/buildConfig/BuildConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package ru.inforion.lab403.gradle.buildConfig | ||
|
||
//import ru.inforion.lab403.common.logging | ||
import ru.inforion.lab403.gradle.common.className | ||
import ru.inforion.lab403.gradle.common.kotlinFileExtension | ||
import ru.inforion.lab403.gradle.common.packageName | ||
import ru.inforion.lab403.gradle.kodegen.Kodegen | ||
import java.io.File | ||
|
||
internal object BuildConfig { | ||
// val log = logger(Level.INFO) | ||
|
||
internal fun generateBuildConfig(configObject: String, properties: Map<String, Any>) = Kodegen { | ||
pkg(configObject.packageName()) { | ||
obj(configObject.className()) { | ||
properties.forEach { (name, value) -> | ||
// log.debug("Setup $name: ${value.javaClass.simpleName} = $value") | ||
constval(name, value) | ||
} | ||
} | ||
} | ||
} | ||
|
||
private fun createDirIfNotExists(dir: File) { | ||
if (!dir.exists()) { | ||
// log.lifecycle("Creating directory: '$dir'") | ||
dir.mkdirs() | ||
} | ||
} | ||
|
||
fun makeConfigSources(baseDir: File, configObject: String, properties: Map<String, Any>): Boolean { | ||
val newSourceFile = File(baseDir, configObject.replace(".", "/") + kotlinFileExtension) | ||
|
||
val output = generateBuildConfig(configObject, properties).toString() | ||
|
||
if (newSourceFile.exists() && newSourceFile.readText() == output) { | ||
// log.info("Nothing changed in '$configObject'") | ||
return false | ||
} | ||
|
||
createDirIfNotExists(newSourceFile.parentFile) | ||
|
||
// log.lifecycle("Writing config to '${newSourceFile.path}'\n$output") | ||
newSourceFile.writeText(output) | ||
|
||
return true | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
buildSrc/src/main/kotlin/ru/inforion/lab403/gradle/buildConfig/BuildConfigPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
|
||
package ru.inforion.lab403.gradle.buildConfig | ||
|
||
import org.gradle.api.GradleException | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import ru.inforion.lab403.gradle.common.kotlinPluginString | ||
|
||
|
||
class BuildConfigPlugin : Plugin<Project> { | ||
override fun apply(project: Project) { | ||
if (!project.plugins.hasPlugin(kotlinPluginString)) | ||
throw GradleException("Plugin $kotlinPluginString must be applied!") | ||
|
||
val task = project.tasks.create(BuildConfigTask.taskIdentifier, BuildConfigTask::class.java) | ||
project.afterEvaluate { task.afterProjectEvaluate() } | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
buildSrc/src/main/kotlin/ru/inforion/lab403/gradle/buildConfig/BuildConfigTask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ru.inforion.lab403.gradle.buildConfig | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.TaskAction | ||
import ru.inforion.lab403.gradle.common.* | ||
import java.io.File | ||
|
||
|
||
open class BuildConfigTask : DefaultTask() { | ||
|
||
companion object { | ||
const val taskIdentifier = "buildConfig" | ||
} | ||
|
||
@Input var generatedPath = "generated" | ||
@Input lateinit var configObject: String | ||
|
||
private val baseDir get() = File(temporaryDir, generatedPath) | ||
|
||
fun afterProjectEvaluate() { | ||
buildConfig() | ||
project.addKotlinSourceDir(baseDir) | ||
|
||
project.compileKotlinTask.dependsOn(this) | ||
project.cleanTaskOrNull?.delete(baseDir) | ||
} | ||
|
||
@TaskAction | ||
fun buildConfig() { | ||
if (BuildConfig.makeConfigSources(baseDir, configObject, extraProperties)) { | ||
project.compileKotlinTask.rebuildRequired() | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
buildSrc/src/main/kotlin/ru/inforion/lab403/gradle/common/array.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package ru.inforion.lab403.gradle.common | ||
|
||
import java.security.MessageDigest | ||
|
||
fun ByteArray.sha1(): ByteArray { | ||
val digester = MessageDigest.getInstance("SHA1") | ||
return digester.digest(this) | ||
} |
24 changes: 24 additions & 0 deletions
24
buildSrc/src/main/kotlin/ru/inforion/lab403/gradle/common/configurables/IConfigurable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ru.inforion.lab403.gradle.common.configurables | ||
|
||
import groovy.lang.Closure | ||
|
||
interface IConfigurable { | ||
|
||
// val properties = HashMap<String, Any?>() | ||
|
||
fun configure(closure: Closure<*>) { | ||
closure.resolveStrategy = Closure.DELEGATE_FIRST | ||
closure.delegate = this | ||
closure.call() | ||
} | ||
|
||
// It's a Groovy implicit inheritance (Groovy will see it) | ||
// fun methodMissing(name: String, value: Any?): Any? { // here we extract the closure from arguments, etc | ||
// TODO("methodMissing called with name '$name' and args = $args") | ||
// } | ||
|
||
// It's a Groovy implicit inheritance (Groovy will see it) | ||
// fun propertyMissing(name: String, value: Any?): Any? { // here we extract the closure from arguments, etc | ||
// return properties.set(name, value) | ||
// } | ||
} |
6 changes: 6 additions & 0 deletions
6
...Src/src/main/kotlin/ru/inforion/lab403/gradle/common/configurables/IMethodConfigurable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package ru.inforion.lab403.gradle.common.configurables | ||
|
||
interface IMethodConfigurable : IConfigurable { | ||
// It's a Groovy implicit inheritance (Groovy will see it) | ||
fun methodMissing(name: String, value: Any?): Any? | ||
} |
Oops, something went wrong.