Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumping changes into stable. #296

Merged
merged 4 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ For more information, please visit [**Github Wiki**](https://github.com/VisorFol

### Supported Platforms

| Atmel | SiFive | STMicro | TI | Raspberry Pi |
| ---------- | ------------- | ----------- | ----------- | -------------|
| ATMega328P | FE310-G002 | Coming soon | Coming soon | Coming soon |
| ATMega2560 | QEMU SiFive-E | | | |
| Atmel | SiFive | STMicro | TI | Raspberry Pi | ibex |
| ---------- | ------------- | ----------- | ----------- | ------------- | ------------- |
| ATMega328P | FE310-G002 | Coming soon | Coming soon | Coming soon | simple-system |
| ATMega2560 | QEMU SiFive-E | | | | |

7 changes: 4 additions & 3 deletions mk/lib.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
# Copyrights (C) 2024, Cyancore Team
#
# File Name : lib.mk
# Description : This file accumulates all the object files
Expand All @@ -18,10 +18,11 @@ include mk/lobj.mk
LIB := $(addprefix $(OUT)/$(DIR)/,$(LIB))
DEP_LIB_PATH += -L $(OUT)/$(DIR)
DEP_LIBS += $(LIB)
AR_FLAGS ?= rcs

$(LIB): $(LIB_OBJS)
$(LIB): $(LIB_OBJS) | $$(@D)/
@echo "Lib: Generating $(@F) ..."
$(AR) rc $@ $^
$(AR) $(AR_FLAGS) $@ $^

LIB_INCLUDE_PATH:=
LIB_OBJS :=
Expand Down
5 changes: 4 additions & 1 deletion mk/tc.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
# Copyrights (C) 2024, Cyancore Team
#
# File Name : tc.mk
# Description : This file defines toolchain specific variables
Expand All @@ -16,6 +16,7 @@ $(eval $(call get_tc_version,$(TC))) # Sets TC_VER
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)/
TCL := $(TOOLS_ROOT)/arm-toolchain/arm-none-eabi/lib/
endif

ifeq ($(findstring riscv,$(ARCH)),riscv)
Expand All @@ -24,13 +25,15 @@ $(eval $(call get_tc_version,$(TC))) # Sets TC_VER
TI := $(TOOLS_ROOT)/risc-v-toolchain/lib/gcc/riscv64-unknown-elf/$(TC_VER)/include-fixed/
TI += $(TOOLS_ROOT)/risc-v-toolchain/riscv64-unknown-elf/include/
TL := $(TOOLS_ROOT)/risc-v-toolchain/lib/gcc/riscv64-unknown-elf/$(TC_VER)/rv$(BIT)$(ARCH_VARIANT)/$(ARCH_ABI)/
TCL := $(TOOLS_ROOT)/risc-v-toolchain/riscv64-unknown-elf/lib/rv$(BIT)$(ARCH_VARIANT)/$(ARCH_ABI)
endif

ifeq ($(findstring avr,$(ARCH)),avr)
TC ?= $(TOOLS_ROOT)/avr-toolchain/bin/avr
$(eval $(call get_tc_version,$(TC))) # Sets TC_VER
TI := $(TOOLS_ROOT)/avr-toolchain/lib/gcc/avr/$(TC_VER)/include-fixed
TL := $(TOOLS_ROOT)/avr-toolchain/lib/gcc/avr/$(TC_VER)/$(ARCH)$(ARCH_VARIANT)/
TCL := $(TOOLS_ROOT)/avr-toolchain/avr/lib/$(ARCH)$(ARCH_VARIANT)
endif

ifneq ($(ARCH),)
Expand Down
22 changes: 5 additions & 17 deletions projects/demo_ibex_ss/project.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,22 @@

#include <status.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <terravisor/bootstrap.h>
#include <driver.h>
#include <time.h>
#include <platform.h>

void plug()
{
bootstrap();
driver_setup_all();

printf("Demo Program!\n");
mdelay(1000);
printf("Bye...\n");
exit(EXIT_SUCCESS);
return;
}


void play()
{
static unsigned char i = 0;
char progress[] = "-\\|/";
uint64_t time;
char c = progress[(i++) % strlen(progress)];
get_timestamp(&time);
time /= 1000U;

printf("[%012llu] Running Blinky ... [%c]", time, c);

mdelay(500);

printf("\r");
return;
}
39 changes: 20 additions & 19 deletions src/include/compiler_macros.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* CYANCORE LICENSE
* Copyrights (C) 2019, Cyancore Team
* Copyrights (C) 2024, Cyancore Team
*
* File Name : compiler_macro.h
* Description : This file defines the compiler macro utilities
Expand All @@ -10,22 +10,23 @@

#pragma once

#define _PRAGMA(x) _Pragma (#x)
#define INFO(x) _PRAGMA(message (#x))
#define WARN(x) _PRAGMA(GCC warning #x)
#define ERROR(x) _PRAGMA(GCC error #x)
#define TODO(x) INFO(TODO: x)
#define _PRAGMA(x) _Pragma (#x)
#define INFO(x) _PRAGMA(message (#x))
#define WARN(x) _PRAGMA(GCC warning #x)
#define ERROR(x) _PRAGMA(GCC error #x)
#define TODO(x) INFO(TODO: x)

#define _ATTRIBUTE(x) __attribute__((x))
#define _WEAK _ATTRIBUTE(weak)
#define _UNUSED _ATTRIBUTE(unused)
#define _INLINE _ATTRIBUTE(always_inline)
#define _NOINLINE _ATTRIBUTE(noinline)
#define _ALIGN(x) _ATTRIBUTE(aligned(x))
#define _SECTION(x) _ATTRIBUTE(section(x))
#define _DEPRICATE _ATTRIBUTE(depricated)
#define _ALIAS(x) _ATTRIBUTE(alias(x))
#define _FALLTHROUGH _ATTRIBUTE(fallthrough)
#define _NORETURN _ATTRIBUTE(noreturn)
#define _NAKED _ATTRIBUTE(naked)
#define EXPORT_C(x) extern "C" x; x
#define _ATTRIBUTE(x) __attribute__((x))
#define _WEAK _ATTRIBUTE(weak)
#define _UNUSED _ATTRIBUTE(unused)
#define _INLINE _ATTRIBUTE(always_inline)
#define _NOINLINE _ATTRIBUTE(noinline)
#define _ALIGN(x) _ATTRIBUTE(aligned(x))
#define _SECTION(x) _ATTRIBUTE(section(x))
#define _DEPRICATE _ATTRIBUTE(depricated)
#define _ALIAS(x) _ATTRIBUTE(alias(x))
#define _FALLTHROUGH _ATTRIBUTE(fallthrough)
#define _NORETURN _ATTRIBUTE(noreturn)
#define _NAKED _ATTRIBUTE(naked)
#define EXPORT_C(x) extern "C" x; x
#define EXPORT_C_PROTO(x) extern "C" { x }
32 changes: 1 addition & 31 deletions src/lib/libnmath/arithmetic/arithmetic.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* CYANCORE LICENSE
* Copyrights (C) 2019, Cyancore Team
* Copyrights (C) 2024, Cyancore Team
*
* File Name : arithmetic.c
* Description : This file contains sources of neo-math function
Expand All @@ -25,36 +25,6 @@ unsigned int clog2(unsigned long num)
return (num > 1) ? (1 + clog2((num & 0x01) ? ((num + 1) >> 1) : (num >> 1))) : 0;
}

/**
* ceiling
*
* @brief Determines the ceiling of the input number
*
* @param[in] num: Input number
*
* @return ceiling
*/
double ceiling(double num)
{
long inum = (long) num;
return (double)(num - inum) ? (inum + 1) : num;
}

/**
* floor
*
* @brief Determing the floor of the input number
*
* @param[in] num: Input number
*
* @return floor
*/
double floor(double num)
{
long inum = (long) num;
return (double)inum;
}

/**
* gcd - Greatest Common Divisor
*
Expand Down
4 changes: 3 additions & 1 deletion src/lib/libnmath/build.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2019, Cyancore Team
# Copyrights (C) 2024, Cyancore Team
#
# File Name : build.mk
# Descrption : This script accumulates sources and build
Expand All @@ -21,3 +21,5 @@ include $(NMATH_PATH)/dsp/build.mk

DIR := $(NMATH_PATH)
include mk/lib.mk

include $(NMATH_PATH)/libm/build.mk
4 changes: 1 addition & 3 deletions src/lib/libnmath/include/nmath.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* CYANCORE LICENSE
* Copyrights (C) 2019, Cyancore Team
* Copyrights (C) 2024, Cyancore Team
*
* File Name : nmath.h
* Description : This file contains prototypes of neo-math function
Expand All @@ -11,8 +11,6 @@
#pragma once
#include <stdbool.h>
unsigned int clog2(unsigned long num);
double ceiling(double num);
double floor(double num);
unsigned long gcd(unsigned long a, unsigned long b);
unsigned long lcd(unsigned int *a, unsigned int n);
long mod(long a, long b);
Expand Down
24 changes: 24 additions & 0 deletions src/lib/libnmath/libm/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# CYANCORE LICENSE
# Copyrights (C) 2024, Cyancore Team
#
# File Name : build.mk
# Descrption : This script generates tcmath library
# it uses toolchain's libm.a
# Primary Author : Akash Kollipara [[email protected]]
# Organisation : Cyancore Core-Team
#

TCMATH_PATH := $(GET_PATH)

LIB_OBJS := $$(TCL)/libm.a

LIB := libtcmath.a
LIB_INCLUDE += $(TCMATH_PATH)/include/
DEP_LIBS_ARG += -ltcmath

AR_FLAGS := rcsT

DIR := $(TCMATH_PATH)

include mk/lib.mk
Loading
Loading