Skip to content

Commit

Permalink
Merge pull request #246 from VisorFolks/development
Browse files Browse the repository at this point in the history
Added several new features:
- Helios Updates (compatibility with newer updates pending)
- VCall Updates
- ARM-M Code updates
- Updates to basic documentation
- Add build demo program using qemu

Closes Issue: #87 #155 #184 #243
  • Loading branch information
akashkollipara authored Nov 23, 2023
2 parents 511695e + ea9b716 commit 3a53a42
Show file tree
Hide file tree
Showing 132 changed files with 3,659 additions and 1,805 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/github_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: GitHub CI

on:
push:
branches: [ stable, development]
branches: [ stable, development, helios_stage]

pull_request:
branches: [ stable, development]
branches: [ stable, development, helios_stage]

jobs:
build:
Expand Down Expand Up @@ -44,17 +44,13 @@ jobs:
languages: ${{ matrix.language }}
debug: true

- name: Linting
run: |
make demo_avr check
make demo_avr_cpp check
make demo_riscv check
- name: Build
run: |
make demo_avr
make demo_avr_cpp
make demo_riscv
make demo_helios_avr
make demo_helios_riscv
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- stable
- development
- helios_stage
pull_request:
branches:
- stable
- development
- helios_stage

jobs:
build:
Expand Down
87 changes: 44 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
.scannerwork
sonar-cfamily-reproducer.zip
temp
out/
tools/
backup/
bkp/
projects/
*.elf
*.bin
*.d
*.o
*.ko
*.obj
*.dll
*.so
*.so.*
*.dylib
*.lib
*.la
*.lo
*.a
*.ilk
*.map
*.dis
*.new
*.bkp
*.backup
*.b
*.dev
*.old
*.temp
*.tmp
*.sw*
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
*.mod*
*.cmd
*.todo
.scannerwork
.vscode/
sonar-cfamily-reproducer.zip
temp
out/
tools/
backup/
bkp/
projects/
*.elf
*.bin
*.d
*.o
*.ko
*.obj
*.dll
*.so
*.so.*
*.dylib
*.lib
*.la
*.lo
*.a
*.ilk
*.map
*.dis
*.new
*.bkp
*.backup
*.b
*.dev
*.old
*.temp
*.tmp
*.sw*
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
*.mod*
*.cmd
*.todo
3 changes: 2 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"intelliSenseMode": "${default}",
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14"
"cppStandard": "gnu++14",
"compileCommands": "${workspaceFolder}/.vscode/compile_commands.json"
}
],
"version": 4
Expand Down
47 changes: 45 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,50 @@
"text": "b plug"
},
],


},
{
"name": "FE310 Debug (JLink)",
"type": "cppdbg",
"request": "launch",
"miDebuggerServerAddress": ":2331",
"program": "${workspaceFolder}/out/${input:project}/${input:project}.elf",
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"svdPath": "",
"externalConsole": false,
"showDisplayString": true,
"variables": {
"elfPath": "${workspaceFolder}/out/${input:project}/${input:project}.elf"
},
"miDebuggerPath": "${workspaceFolder}/tools/risc-v-toolchain/bin/riscv64-unknown-elf-gdb",
"miDebuggerArgs": "${elfPath}",
"setupCommands":
[
{
"text": "b init"
},
{
"text": "b plug"
},
],
"postRemoteConnectCommands": [
{
"text": "file ${elfPath}"
},
{
"text": "monitor halt"
},
{
"text": "load"
},
{
"text": "monitor reset"
},
{
"text": "monitor go"
}
]
}
],
"inputs": [
Expand All @@ -48,6 +90,7 @@
"demo_avr",
"demo_avr_cpp",
"demo_riscv",
"demo_helios_riscv"
],
"default": "demo_avr"
},
Expand Down
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"*.sx": "c",
"*.{c,c.dev.c.temp,c.tmp,c.old,h,h.dev,h.old,h.temp,h.tmp)": "C",
"*.{cpp,cpp.dev,cpp.temp,cpp.tmp,cpp.old}": "C++",
"*.{S,S.old,S.dev.S.temp,S.tmp,s.old,s.temp,s.tmp,s.dev,asm,asm.old,asm.dev.asm.temp,asm.tmp,inc,inc.old,inc.temp,inc.tmp,ld,ld.old,ld.temp,ld.tmp,ld.sx,ld.sx.old,ld.sx.temp,ld.sx.tmp,lst}": "coffeescript"
"*.{S,S.old,S.dev.S.temp,S.tmp,s.old,s.temp,s.tmp,s.dev,asm,asm.old,asm.dev.asm.temp,asm.tmp,inc,inc.old,inc.temp,inc.tmp,ld,ld.old,ld.temp,ld.tmp,ld.sx,ld.sx.old,ld.sx.temp,ld.sx.tmp,lst}": "coffeescript",
"cc_os_sched.h": "c",
"cc_os.h": "c"
},
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 100,
Expand All @@ -57,5 +59,6 @@
"workbench.settings.openDefaultKeybindings": true,
"C_Cpp.autocompleteAddParentheses": true,
"git.alwaysSignOff": true,
"files.autoGuessEncoding": true
"files.autoGuessEncoding": true,
"sonarlint.pathToCompileCommands": "${workspaceFolder}/.vscode/compile_commands.json"
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contributing Guidlines
- Use tabs, width=8, commit of **code** with spaces and whitespaces will be rejected.
- Use tabs, width=8, commit of **code** with spaces and trailing whitespaces will be rejected.
- Use Spaces, width=4, for **documentation** that is "<filename>.md"
- Use the coding format that is set in the current repo as of 3-jul-2021.
- We recommend going through Cyancore sources by taking help of README in each folder before you start with project. It is our duty to ensure the code is simple and understandable.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body>
<div align="center">
<i>An unified software platform for embedded system projects ...</i><br>
<i>From India with Pride!</i><br><br>
<i>From Bharat with Pride!</i><br><br>
</div>
</body>

Expand Down
65 changes: 62 additions & 3 deletions mk/help.mk
Original file line number Diff line number Diff line change
@@ -1,14 +1,73 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
# Copyrights (C) 2023, Cyancore Team
#
# File Name : help.mk
# Description : This file prints cyancore build help
# Primary Author : Akash Kollipara [[email protected]]
# Organisation : Cyancore Core-Team
#

.PHONY: help
T_ALLOWLIST += help

HELP :="\
==================< Cyancore Make Help >==================\n\
Usage: make [<project_name>|default|...] (V=|PP=|...)\n\
\n\
Examples:\n\
$$ make demo_avr \# Builds project demo_avr\n\
$$ make clean \# Cleans the build out folder \n\
$$ make demo_avr V=1 \# Builds demo_avr with verbose\n\
$$ make list \# Displays all the available projects\n\
$$ make get_all_tc \# Fetches all toolchains\n\
\n\
----------\n\
Variables:\n\
----------\n\
V=(*0/1) Verbose build logs.\n\
If 1, the build will spew all the build logs.\n\
\n\
PP=(*0/1) PreProcess stage enable.\n\
If 1, the build engine shall generate/save preprocessed\n\
file which can be used for debugging.\n\
\n\
DEBUG=(*0/1/2/3/5) Enable build with debug code.\n\
This Flag is used to enable debug routines to log info\n\
while program executes. Visit libsyslog directory for\n\
more info.\n\
\n\
* - marks default value\n\
For more variablea that can be passed,\n\
please visit [DOCS REPO]\n\
\n\
--------\n\
Targets:\n\
--------\n\
project_name: Name of the project.\n\
The build engine will automatically create dynamic target\n\
using project name. Any following target which will\n\
depend on project name will be marked with \`~\`.\n\
\n\
~ default: The default target of make, this need not be\n\
passed. This uses multi threaded build.\n\
~ cyancore: This performs 1 thread build.\n\
Use this for debug as it will be slow than default.\n\
~ clean: Cleans the project build artifacts.\n\
~ check: Perform static analysis.\n\
clean: Cleans all the build artifacts.\n\
list: Displays all the projects available for build.\n\
get_all_tc: Fetches all Toolchains.\n\
get_avr_tc: Fetches AVR Toolchain.\n\
get_arm_tc: Fetches ARM Toolchain.\n\
get_riscv_tc: Fetches RISC-V Toolchain.\n\
qemu_test: Performs build and runs a demo on qemu.\n\
\n\
For more targets/info, please visit [DOCS REPO].\n\
\n\
----------------------------------------------------------\n\
DOCS REPO: https://github.com/VisorFolks/cc_docs\n\
----------------------------------------------------------\
"

help:
less mk/usage_help.txt
echo -e $(HELP)
4 changes: 1 addition & 3 deletions mk/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
#------------< Project Search >-------------#
#*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*#

include mk/path.mk
include mk/mk_helper.mk
include mk/qemu.mk
include mk/picotool.mk

P_TARGETS += default cyancore check version copy_to_remote clean_remote
T_ALLOWLIST += help list clean all_projects
T_ALLOWLIST += list clean all_projects
PROJECT_LIST := $(shell ls projects/ -I *.template -I *.src)

.PHONY: aux_target
Expand Down Expand Up @@ -59,7 +58,6 @@ ifeq ($(CMD),)
CMD := default
endif

.PHONY: $(PROJECT)
$(PROJECT): $(CMD)

endif
Expand Down
16 changes: 14 additions & 2 deletions mk/qemu.mk
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
# Copyrights (C) 2023, Cyancore Team
#
# File Name : qemu.mk
# Description : This file helps fetch and build qemu
# Primary Author : Akash Kollipara [[email protected]]
# Organisation : Cyancore Core-Team
#

T_ALLOWLIST += get_qemu clean_qemu
T_ALLOWLIST += get_qemu clean_qemu qemu_test

QEMU_CHECKOUT := v7.2.0
QEMU_PATH := $(TOOLS_ROOT)/qemu
Expand Down Expand Up @@ -43,3 +43,15 @@ clean_qemu:
@echo "< ! > Removing cc-qemu installation ..."
rm -rf $(QEMU_OUT_PATH) $(QEMU_PATH)
@echo "< / > Done!"

qemu_test:
ifeq ($(realpath $(QEMU_OUT_PATH)/bin/qemu-system-riscv32),)
$(info < x > QEMU is not installed...)
$(info < ! > Please run `make get_qemu`)
$(error < x > Stopping demo simulation!)
endif
make demo_qemu_sifive_e
@echo
@echo "Press Ctrl+A - X to exit!"
@echo
$(QEMU_OUT_PATH)/bin/qemu-system-riscv32 -machine sifive_e -device loader,file=out/qemu_sifive_e_bl/qemu_sifive_e_bl.elf -kernel out/demo_qemu_sifive_e/demo_qemu_sifive_e.elf -nographic
2 changes: 0 additions & 2 deletions mk/slib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ include mk/lobj.mk
SLIB := $(addprefix $(OUT)/,$(SLIB))
HEADER := $(addprefix $(LIB_INCLUDE_PATH)/,$(LIB_HEADER))

.PHONY: slib

slib: $(SLIB)

$(SLIB): $(HEADER) $(LIB_OBJS)
Expand Down
7 changes: 4 additions & 3 deletions mk/tc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

include mk/path.mk

ifeq ($(findstring arm-v7,$(ARCH)),arm)
ifeq ($(findstring arm,$(ARCH)),arm)
TC ?= $(TOOLS_ROOT)/arm-toolchain/bin/arm-none-eabi
TI := $(TOOLS_ROOT)/arm-toolchain/arm-none-eabi/include
TL := $(TOOLS_ROOT)/arm-toolchain/arm-none-eabi/lib
TI := $(TOOLS_ROOT)/arm-toolchain/lib/gcc/arm-none-eabi/$(TC_VER)/include-fixed/
TI += $(TOOLS_ROOT)/arm-toolchain/arm-none-eabi/include/
TL := $(TOOLS_ROOT)/arm-toolchain/lib/gcc/arm-none-eabi/$(TC_VER)/$(TL_TYPE)/
endif

ifeq ($(findstring riscv,$(ARCH)),riscv)
Expand Down
Loading

0 comments on commit 3a53a42

Please sign in to comment.