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
nparallel jobsscons -j n -
Clean build files
scons -c
- Python
- VS Code
- Logisim
Put following libraries in logisim/libs/:
cdm16e.circlogisim-banked-memory-0.2.0.jarlogisim-uart.jar
-
Install
SConsbuild systempip install scons -
Install
cdm-devkitpip install cdm-devkit -
Optionally, set
CDM_COCAS_PATHenvironment variable tococasexecutable, otherwise it will be taken fromPATH -
Build this C compiler, note that it is developed in
backend/cdmbranch -
Set
CDM_CLANG_PATHenvironment variable tobin/clangexecutable of recently built compiler, otherwiseclangwill be taken fromPATH
-
Open project folder in VS Code.
-
Create
.vscode/settings.jsonfile 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
SConsbuild files - Setup formatting style
- Setup include paths for VS Code analysis
- Associate
.sfiles withCdM-16 Assembly
- Disable Python error checking for
-
Additionaly, create
.vscode/c_cpp_properties.jsonfile with following text:{ "configurations": [ { "name": "Coconut-16", "compilerPath": "<path to clang>", "cStandard": "c11", "intelliSenseMode": "clang-x64" } ], "version": 4 }Fill in
compilerPathwith path to your system'sclang, note that our proprietaryclangmay not work with it, so you needclangfrom 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"