Educational system based on CdM-16e processor.
This project uses SCons
as build system.
To build project run scons
. It will put files to build
directory.
Couple useful commands:
-
Run build with
n
parallel jobsscons -j n
-
Clean build files
scons -c
- Python
- VS Code
- Logisim
Put following libraries in logisim/libs/
:
cdm16e.circ
logisim-banked-memory-0.2.0.jar
logisim-uart.jar
-
Install
SCons
build systempip install scons
-
Install
cdm-devkit
pip install cdm-devkit
-
Optionally, set
CDM_COCAS_PATH
environment variable tococas
executable, otherwise it will be taken fromPATH
-
Build this C compiler, note that it is developed in
backend/cdm
branch -
Set
CDM_CLANG_PATH
environment variable tobin/clang
executable of recently built compiler, otherwiseclang
will be taken fromPATH
-
Open project folder in VS Code.
-
Create
.vscode/settings.json
file with following text{ "python.analysis.ignore": [ "SConstruct", "src/" ], "C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4 }", "C_Cpp.default.systemIncludePath" : ["${workspaceFolder}/include/"], "files.associations": { "*.s": "cdm16-assembly" } }
It will:
- Disable Python error checking for
SCons
build files - Setup formatting style
- Setup include paths for VS Code analysis
- Associate
.s
files withCdM-16 Assembly
- Disable Python error checking for
-
Additionaly, create
.vscode/c_cpp_properties.json
file with following text:{ "configurations": [ { "name": "Coconut-16", "compilerPath": "<path to clang>", "cStandard": "c11", "intelliSenseMode": "clang-x64" } ], "version": 4 }
Fill in
compilerPath
with path to your system'sclang
, note that our proprietaryclang
may not work with it, so you needclang
from official LLVM distrubution.
-
Install proprietary extension
-
Add following launch configuration to
launch.json
{ "name": "Debug Coconut-16", "type": "coconut", "request": "launch", "address": "ws://localhost:7001", "target": "coconut16", "debugInfos": { "0": "${workspaceFolder}/build/bootloader.dbg.json", "1": "${workspaceFolder}/build/loader.dbg.json" } }
-
Create new task in
tasks.json
{ "label": "runScons", "type": "shell", "command": "scons" }
-
Add following property to launch configuration
"preLaunchTask": "runScons"