Skip to content

Commit 2a10ba7

Browse files
author
Alexei Gladkikh
committed
Updated README.md
1 parent c18221b commit 2a10ba7

1 file changed

Lines changed: 45 additions & 27 deletions

File tree

README.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<img src="https://kopy.cat/static/media/big_logo.169d84fb.png" width="384">
22

3-
Kopycat is a modular software emulator of hardware systems
3+
Kopycat is a multi-architecture hardware emulation solution
44

55
## Description
66

77
Main features are:
88

9-
- Ease of creating a computer system emulator
10-
- The platform can be described using JSON or in the Kotlin language
11-
- The platform description completely coincides with the block diagram of the device
12-
- Supported architectures: ARM, MIPS, MSP430, v850ES, x86
9+
- Easy of assemble. Configure your own platform using JSON or Kotlin
10+
- Easy to customise. Create your own platform-module using Kotlin
11+
- One-to-one correspondence. Virtual platform representation is identical to block diagram
12+
- Multiple supported architectures: MIPS, ARM, MSP430, v850ES, x86
1313

1414
This project contains CPU cores (ARMv6, ARMv6M, ARMv7, MIPS, MSP430, v850ES, x86) and MCU (CortexM0, STM32F0xx, MSP430x44x) for Kopycat.
1515

@@ -22,40 +22,49 @@ To run Kopycat you have to install the following software:
2222
1. OpenJDK (version 11.0.6/7 tested)
2323
2. Highly recommended Python (version 2.7 and 3.6, 3.8 tested) with Jep package (version 0.3.9 tested) for embedded console in Kopycat.
2424

25-
NOTE: prebuild OpenJDK installer available on https://adoptopenjdk.net/
25+
NOTE: prebuild OpenJDK installer is available on https://adoptopenjdk.net/
2626

27-
Linux and OSX user can use package manager to install OpenJDK and Python. To install **jep** `pip` command can be used, but before **compiler** and **toolchain** have to be installed for building **jep** package. On Linux system **gcc** from `apt` and on OSX `Developer Tools` with XCode (XCode by itself is not needed, but we need a compiler). As for Windows users you may stumble upon a lot of difficulties to compile Python packages.
27+
Linux and OSX users can use package manager to install OpenJDK and Python. To install **jep** `pip` command can be used, but before **compiler** and **toolchain** have to be installed for building **jep** package. On Linux system **gcc** from `apt` and on OSX `Developer Tools` with XCode (XCode by itself is not needed, but we need a compiler). As for Windows users you may face a lot of difficulties while compiling Python packages.
2828

2929
### Installation of requirements on Windows 10
3030

3131
1. For Windows, you should manually download OpenJDK package and setup `PATH` and `JAVA_HOME` environment variables, see https://openjdk.java.net/install/
3232

33-
1. Download and install Python (don't forget to add Python to `PATH` during installation and select to install **pip**) from an official site: https://www.python.org/downloads/
33+
1. Download and install Python (don't forget to add Python to `PATH` during installation and select to install **pip**) from the official site: https://www.python.org/downloads/
3434

35-
1. Download and install Visual Studio build tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/ (**DON'T FORGET TO SELECT ALSO VERSION 14.x**)
35+
1. Download and install Visual Studio build tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/ (**DON'T FORGET TO SELECT VERSION 14.x**)
3636

3737
1. Fix ¯\_(ツ)_/¯ Python setuptools to work with Visual Studio compiler: https://stackoverflow.com/a/20050195/1312718
3838

39-
1. Run Console from **x64 Native Tools Command Prompt** (installed in a main menu of Windows) and execute:
39+
1. Run Console from **x64 Native Tools Command Prompt** (installed in the main menu of Windows) and execute:
4040

4141
```shell script
4242
pip install jep
4343
```
4444

45-
### Installation of requirements on Linux
45+
### Installation of requirements on Linux (i.e. Debian 9)
4646

4747
```shell script
48-
sudo apt-get install gcc
49-
sudo apt-get install openjdk-11-jdk
50-
sudo apt-get install python
48+
# only for debian 9
49+
echo 'deb http://ftp.debian.org/debian stretch-backports main' | sudo tee /etc/apt/sources.list.d/stretch-backports.list
50+
sudo apt update
51+
52+
sudo apt install gcc openjdk-11-jdk curl python socat
53+
54+
# path may differ. JAVA_HOME required to be set for jep installation
55+
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
56+
57+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
58+
sudo python get-pip.py
5159
pip install jep
5260
```
5361

54-
NOTE: OpenJDK installation reference https://dzone.com/articles/installing-openjdk-11-on-ubuntu-1804-for-real
62+
NOTE: OpenJDK installation reference for Ubuntu https://dzone.com/articles/installing-openjdk-11-on-ubuntu-1804-for-real
5563

5664
### Installation of requirements on OSX
5765

5866
```shell script
67+
brew install socat
5968
brew cask install adoptopenjdk
6069
brew install adoptopenjdk/openjdk/adoptopenjdk-openjdk11
6170
brew install python@3.7
@@ -64,34 +73,41 @@ pip install jep
6473

6574
NOTE: OpenJDK installation reference https://dzone.com/articles/install-openjdk-versions-on-the-mac
6675

67-
## Requirements to developing modules and software with Kopycat
76+
## Requirements for developing modules and software with Kopycat
6877

69-
For module development and working with sources the following software required:
78+
For module development and working with sources the following software is required:
7079

7180
1. IntelliJ (version >= 2020.1)
7281
2. Kotlin plugin (version >= 1.3.72)
7382

7483
## Getting started
7584

76-
In this part of readme start of Kopycat with STM32F042 on Cortex-M0 core (ARMv6M architecture) device and virtual ARM device on ARM1176JZS core (ARMv6/v7 architecture) will be shown. For STM32F042 implemented the next peripheral modules: UART, TIMx, DMAC, GPIOx, WDG. These peripheral modules enough to run FreeRTOS. In the example firmware `freertos_uart` working with FreeRTOS shown. Virtual ARM (VirtARM) runs UBoot and Linux with kernel 2.6.x, as filesystem used ext2.
85+
In this part of readme start of Kopycat with STM32F042 on Cortex-M0 core (ARMv6M architecture) device and virtual ARM device on ARM1176JZS core (ARMv6/v7 architecture) will be shown. For STM32F042 the next peripheral modules are implemented: UART, TIMx, DMAC, GPIOx, WDG. These peripheral modules are enough to run FreeRTOS. In the example firmware `freertos_uart` working with FreeRTOS is shown. Virtual ARM (VirtARM) runs UBoot and Linux with kernel 2.6.x, ext2 filesystem is used.
7786

78-
All examples shown on ARM architecture as a most popular nowadays in embedded devices. But as already mentioned for Kopycat also implemented cores: x86, MIPS, MSP430, v850ES.
87+
All examples are shown on ARM architecture as the most popular in embedded devices nowadays. But as it has already been mentioned x86, MIPS, MSP430, v850ES cores are also implemented for Kopycat.
7988

80-
**NOTE**: The concept of architecture and core sometimes differs for different manufacturers. For examples ARM has complicated system of architecture and core, but for TI MSP430 core, architecture and MCU itself almost the same. So we will often name core and architecture just as core. Moreover in sources we have no architecture as apart entity. The most low-level part in Kopycat is `Core` that consists of `CPU` - actual CPU (execute instructions), `Decoder`, `COP` - coprocessor (interrupt processing), `MMU` - memory management unit.
89+
**NOTE**: The concept of architecture and core sometimes differs for different manufacturers. For example, ARM has complicated system of architecture and core, but for TI MSP430 core, architecture and MCU itself are almost the same. So we will often use "core" to refer to core and architecture. Moreover, in sources we have no architecture as an entity. The most low-level part in Kopycat is `Core` that consists of `CPU` - actual CPU (execute instructions), `Decoder`, `COP` - coprocessor (interrupt processing), `MMU` - memory management unit.
8190

82-
ARM core and architectures may be confusing. At lowest level lay architecture i.e. ARMv6, ARMv7 (CPUs), ARMv6M (embedded MCUs) etc. Above architectures cores are being build, i.e. ARM1176JZS (not ARMv11!), CortexM0, CortexM3 etc. And at the top implemented MCUs, i.e. STM32F042.
91+
ARM core and architectures may be confusing at the lowest level lay architecture i.e. ARMv6, ARMv7 (CPUs), ARMv6M (embedded MCUs) etc. Mentioned architecture cores are being built, i.e. ARM1176JZS (not ARMv11!), CortexM0, CortexM3 etc. And at the top implemented MCUs, i.e. STM32F042.
8392

8493
### Run prebuild Kopycat core and module STM32F042 on Cortex-M0 core
8594

86-
1. Download prebuild emulator core kopycat-X.Y.AB (https://kopy.cat/download/0.3.20/kopycat-0.3.20.zip) and unzip this archive into any directory (**it's strongly recommended not to use directories with spaces or special symbols!**)
87-
1. Add environment variable `KOPYCAT_HOME` (recommended) to this directory, e.g. `KOPYCAT_HOME=D:\kopycat-X.Y.Z-RCx` and add to environment variable `PATH` path to `KOPYCAT_HOME/bin`
88-
1. Download prebuild modules libraries for Kopycat (https://kopy.cat/download/0.3.20/library.zip) and unzip this archive into any directory (**also it's strongly recommended not to use directories with spaces or special symbols!**)
89-
1. Add environment variable `KOPYCAT_MODULES_LIB_PATH` to this directory
95+
1. Download prebuild emulator core kopycat-X.Y.AB (https://kopy.cat/download/0.3.20/kopycat-0.3.20.zip) and unzip the archive into any directory (**it is strongly recommended not to use directories with spaces or special symbols!**)
96+
1. Add environment variable `KOPYCAT_HOME` (recommended, used by Kopycat core to lookup default modules library) to this directory, e.g. `KOPYCAT_HOME=/opt/kopycat-X.Y.Z-RCx` and add to environment variable `PATH` path to `KOPYCAT_HOME/bin`
97+
1. Download prebuild modules libraries for Kopycat (https://kopy.cat/download/0.3.20/library.zip) and:
98+
- unzip this archive into any directory (**it is also strongly recommended not to use directories with spaces or special symbols!**) and add environment variable `KOPYCAT_MODULES_LIB_PATH` (only to simplify readme commands) to the directory
99+
- unzip this archive into `${KOPYCAT_HOME}/modules` directory (if you setup `KOPYCAT_HOME`)
90100
1. Start emulation one of module: **STM32F042**
91101

92102
```shell script
93103
kopycat -y ${KOPYCAT_MODULES_LIB_PATH} -l mcu -n stm32f042_example -g 23946 -p "firmware=example:usart_poll,tty1=socat:,tty2=socat:"
94104
```
105+
106+
OR if you set up `KOPYCAT_HOME` environment variable and copy modules into `${KOPYCAT_HOME}/modules` just:
107+
108+
```shell script
109+
kopycat -l mcu -n stm32f042_example -g 23946 -p "firmware=example:usart_poll,tty1=socat:,tty2=socat:"
110+
```
95111

96112
- `-y` - path to a bunch of prebuild module's libraries (aka **registry**)
97113
- `-l` - actual library for the module (name of directory in the registry)
@@ -103,8 +119,10 @@ ARM core and architectures may be confusing. At lowest level lay architecture i.
103119
- **bytes** - hex string i.e. `AACCDDEE90909090`.
104120
- `ttyX` - virtual terminal connected to usart1 and usart2 of STM32F042.
105121
- `-g` - GDB server port
106-
107-
NOTE: due to socat this line will work only in **nix** system with installed socat, to disable, use `tty1=null,tty2=null`. For windows system com0com can be used or any other software to create virtual COM ports. In this case you should specify directly virtual com-port name `tty1=COM1,tty2=COM2`.
122+
123+
**NOTES:**
124+
1. If you've added `KOPYCAT_HOME` environment variable you can put prebuild modules libraries into `${KOPYCAT_HOME}/modules` without necessity to specify `-y` parameter explicitly.
125+
1. Due to socat this line will work only in **nix** system with installed socat, to disable, use `tty1=null,tty2=null`. For windows system com0com can be used or any other software to create virtual COM ports. In this case you should specify directly virtual com-port name `tty1=COM1,tty2=COM2`.
108126

109127
1. You should see the following start log:
110128

0 commit comments

Comments
 (0)