初始提交

This commit is contained in:
2024-09-28 14:24:04 +08:00
commit c756587541
5564 changed files with 2413077 additions and 0 deletions

57
dtest/pmu_diag_test/Makefile Executable file
View File

@@ -0,0 +1,57 @@
# OUTPUT type
# 1 - .out
# 2 - .a
# 3 - .so
OUTPUT_TYPE = 1
OUTPUT_NAME = pmu_diag_test
SUB_DIRS = ./src
# .h files dir
ADD_INCLUDE += $(TOPDIR)/inc/io_lib $(TOPDIR)/inc/driver
# predefined macro
PRE_MARCO +=
LD_SCRIPT = link_pmu_test.lds
ifeq ($(gcc),arm)
ADD_LIB = cm3
ADD_LIBDIR = $(TOPDIR)/startup/cm3
else
ADD_LIB = riscv
ifeq ($(target), kunlun2)
ADD_LIBDIR = $(TOPDIR)/startup/riscv2
else
ADD_LIBDIR = $(TOPDIR)/startup/riscv
endif
endif
# lib dir
ADD_LIBDIR += $(TOPDIR)/driver $(TOPDIR)/common/io_lib
# lib need to ld together
ADD_LIB += driver io_lib
#####################################################
ifdef TOPDIR
include $(TOPDIR)/build/makefile.cfg
else
include $(CURDIR)/build/makefile.cfg
TOPDIR = $(CURDIR)
export TOPDIR
endif
dump:
$(OBJDUMP) -D -S -l $(OUTPUT_FULL_NAME) > $(OUTPUT_FULL_NAME).dump
# display the obj files and output name
debug:
@echo TOPDIR=$(TOPDIR)
@echo OUTPUT_LIB=$(OUTPUT_FULL_NAME)
@echo DEPS=$(DEPS)
@echo OBJECTS=$(OBJECTS)
@echo SRCS=$(SRCS)
@echo OBJECTS folder=$(foreach dirname, $(SUB_DIRS), $(addprefix $(BIN_DIR)/, $(dirname)))
@echo output_name=$(OUTPUT_FULL_NAME)

View File

@@ -0,0 +1,33 @@
/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
typedef unsigned int uint32_t;
typedef unsigned char uint8_t;
#ifndef BIT
#define BIT(b) (1<<(b))
#endif
#define REG32(a) (*((volatile uint32_t *)(a)))
#define ROM_NOP() __asm volatile("nop\n")
int main(void)
{
uint32_t i = 0;
for(i = 0; i < 0xfffffff; i++) {
REG32(0x9000c000) = i;
for(volatile uint32_t j = 0; j < 10000; j++);
}
return 0;
}