Skip to content

Commit a3a3ae5

Browse files
author
yao
committed
Update SDK
1 parent 4ccd08e commit a3a3ae5

File tree

475 files changed

+65416
-26835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

475 files changed

+65416
-26835
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,19 @@ openocd.checkout:
178178
fi
179179

180180
openocd.build: openocd.checkout
181-
cd utils/openocd && ./bootstrap && ./configure --enable-jtag_dpi --prefix=$(INSTALL_DIR)/openocd && make && make install
181+
cd utils/openocd && ./bootstrap && ./configure --enable-jtag_dpi --prefix=$(INSTALL_DIR)/openocd && $(MAKE) && $(MAKE) install
182182

183183
openocd.clean:
184184
rm -rf $(INSTALL_DIR)/openocd tools/openocd
185185

186+
PROFILER_V2_DIR = $(GAP_SDK_HOME)/tools/profiler_v2
187+
PROFILER_V2_BUILD_DIR = $(GAP_SDK_HOME)/build/profiler_v2
188+
189+
profiler_v2:
190+
cmake -S $(PROFILER_V2_DIR) -B $(PROFILER_V2_BUILD_DIR)
191+
cmake --build $(PROFILER_V2_BUILD_DIR)
192+
cmake --install $(PROFILER_V2_BUILD_DIR) --prefix $(INSTALL_DIR)
193+
186194
profiler:
187195
$(MAKE) -C tools/profiler all
188196
mkdir -p $(INSTALL_DIR)/bin

configs/common.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export PYTHONPATH=$GAP_SDK_HOME/gvsoc/gvsoc/engine/python:$PYTHONPATH
7676
export PATH="$GAP_SDK_HOME/utils/gaptest":$PATH
7777

7878
# Audio framework
79-
export PYTHONPATH=$GAP_SDK_HOME/tools/audio-framework/frontends/python_graph_generator:$GAP_SDK_HOME/tools/audio-framework/components:$PYTHONPATH
79+
export GAP_AUDIO_FRAMEWORK_HOME=$GAP_SDK_HOME/tools/audio-framework
80+
export PYTHONPATH=$GAP_AUDIO_FRAMEWORK_HOME/frontends/python_graph_generator:$GAP_AUDIO_FRAMEWORK_HOME/components:$PYTHONPATH
8081

8182

8283
# Autotiler

configs/gapuino_v3.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ export OPENOCD_CABLE=interface/ftdi/gapuino_ftdi.cfg
2323

2424
export GAPY_TARGET=gapuino_v3
2525

26+
export PLPTEST_DEFAULT_PROPERTIES="chip=gap8_v3 chip_family=gap8 board=gapuino_v3 duration=50 test_duration=50"
27+
2628
source $GAP_SDK_HOME/configs/common.sh

doc/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def configure_doxyfile(file_in, file_out, replace_dict):
3535
"../rtos/pmsis/pmsis_api/include/pmsis/rtos/",
3636
"../rtos/pmsis/pmsis_api/include/pmsis/cluster/",
3737
"../rtos/pmsis/pmsis_api/include/pmsis/platforms/",
38+
"../rtos/pmsis/pmsis_api/include/pmsis/",
3839
"../rtos/pmsis/pmsis_bsp/include/",
3940
"source/reference/builtins/headers/",
4041
]
@@ -86,6 +87,10 @@ def configure_doxyfile(file_in, file_out, replace_dict):
8687
html_theme = "sphinx_rtd_theme"
8788
html_logo = "_static/logo.png"
8889

90+
html_theme_options = {
91+
'navigation_depth' : -1,
92+
}
93+
8994
# Add any paths that contain custom static files (such as style sheets) here,
9095
# relative to this directory. They are copied after the builtin static files,
9196
# so a file named "default.css" will overwrite the builtin "default.css".

examples/autotiler/FFTL1/FFTRunTest.c

Lines changed: 62 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
#define pmsis_exit(a) exit(a)
55
#endif
66

7+
#ifndef SILENT
8+
#define PRINTF printf
9+
#else
10+
#define PRINTF(...) ((void) 0)
11+
#endif
12+
713
#define __XSTR(__s) __STR(__s)
814
#define __STR(__s) #__s
915
#include <stdlib.h>
@@ -21,7 +27,8 @@
2127
#endif
2228
#define STACK_SIZE 2048
2329
typedef void (*FFTFun_T )(void *Data, void *Twiddles, signed char *shift, unsigned int Nfft, unsigned int Inverse);
24-
30+
PI_L2 int PERF_ARR[6][3][2];
31+
PI_L2 float MSE_ARR[6][2];
2532

2633
short int *InBuff_q16;
2734
float *InBuff_f32, *InBuff_f32R4, *OutBuff_f32;
@@ -58,14 +65,14 @@ float MSE_f32(float* real, float* calc, int Size){
5865
void CallFFT(int Nfft, int Type){
5966

6067
// FFT: reset buffers, run and check mse
61-
int start, elapsed, elapsedFFT, Q;
68+
int start, elapsed, elapsedFFT, Q = 0;
6269
FFT_InstallArg_T ArgIns;
6370
FFT_Arg_T FFTArg;
6471
AT_L2_EVENT DmaR_Evt1;
65-
void (*FFTFun)(FFT_Arg_T*);
66-
void (*SwapFun)(SwapSamples_Arg_T*);
72+
void (*FFTFun)(FFT_Arg_T*) = 0;
73+
void (*SwapFun)(SwapSamples_Arg_T*) = 0;
6774
char *FFTDataType = 0;
68-
void *InBuff;
75+
void *InBuff = 0;
6976

7077
ArgIns.Nfft = Nfft;
7178
ArgIns.Radix = ((Nfft)==64 || (Nfft)==256 || (Nfft)==1024)?4:2;
@@ -96,11 +103,11 @@ void CallFFT(int Nfft, int Type){
96103
FFTDataType = "Q16";
97104
switch (Nfft) {
98105
case 64: ArgIns.Twiddles = R4_Twiddles_fix_64; ArgIns.SwapLUT = R4_SwapTable_fix_64; Q = 10; break;
99-
case 128: ArgIns.Twiddles = R2_Twiddles_fix_128; ArgIns.SwapLUT = R2_SwapTable_fix_128; Q = 8; break;
100-
case 256: ArgIns.Twiddles = R4_Twiddles_fix_256; ArgIns.SwapLUT = R4_SwapTable_fix_256; Q = 8; break;
101-
case 512: ArgIns.Twiddles = R2_Twiddles_fix_512; ArgIns.SwapLUT = R2_SwapTable_fix_512; Q = 6; break;
102-
case 1024: ArgIns.Twiddles = R4_Twiddles_fix_1024; ArgIns.SwapLUT = R4_SwapTable_fix_1024; Q = 6; break;
103-
case 2048: ArgIns.Twiddles = R2_Twiddles_fix_2048; ArgIns.SwapLUT = R2_SwapTable_fix_2048; Q = 4; break;
106+
case 128: ArgIns.Twiddles = R2_Twiddles_fix_128; ArgIns.SwapLUT = R2_SwapTable_fix_128; Q = 7; break;
107+
case 256: ArgIns.Twiddles = R4_Twiddles_fix_256; ArgIns.SwapLUT = R4_SwapTable_fix_256; Q = 6; break;
108+
case 512: ArgIns.Twiddles = R2_Twiddles_fix_512; ArgIns.SwapLUT = R2_SwapTable_fix_512; Q = 5; break;
109+
case 1024: ArgIns.Twiddles = R4_Twiddles_fix_1024; ArgIns.SwapLUT = R4_SwapTable_fix_1024; Q = 4; break;
110+
case 2048: ArgIns.Twiddles = R2_Twiddles_fix_2048; ArgIns.SwapLUT = R2_SwapTable_fix_2048; Q = 3; break;
104111
}
105112
if (ArgIns.Radix == 2) FFTFun = &Radix2FFT_DIF_Par_Fix16;
106113
else FFTFun = &Radix4FFT_DIF_Par_Fix16;
@@ -139,24 +146,32 @@ void CallFFT(int Nfft, int Type){
139146
__CALL((*FFTFun), &FFTArg);
140147
AT_FORK(gap_ncore(), (void *) (*SwapFun), (void *) &SwapArg);
141148
__CALL((*SwapFun), &SwapArg);
142-
elapsed = gap_cl_readhwtimer() - start; printf("| %4d | %3s %6s | %6d | %5d | %6d", Nfft, FFTDataType, ArgIns.Radix==2?"Radix2":"Radix4", elapsedFFT, elapsed, elapsed+elapsedFFT);
149+
elapsed = gap_cl_readhwtimer() - start;
150+
151+
PERF_ARR[Nfft/128][Type][0] = elapsedFFT;
152+
PERF_ARR[Nfft/128][Type][1] = elapsed;
153+
154+
155+
PRINTF("| %4d | %3s %6s | %6d | %5d | %6d", Nfft, FFTDataType, ArgIns.Radix==2?"Radix2":"Radix4", elapsedFFT, elapsed, elapsed+elapsedFFT);
143156
#if !defined(__EMUL__) && defined(PERF_ALL)
144-
printf(" | %7d | %7d | %7d | %8d | %7d |", pi_perf_read(PI_PERF_INSTR), pi_perf_read(PI_PERF_ACTIVE_CYCLES), pi_perf_read(PI_PERF_TCDM_CONT), pi_perf_read(PI_PERF_LD_STALL), pi_perf_read(PI_PERF_IMISS));
157+
PRINTF(" | %7d | %7d | %7d | %8d | %7d |", pi_perf_read(PI_PERF_INSTR), pi_perf_read(PI_PERF_ACTIVE_CYCLES), pi_perf_read(PI_PERF_TCDM_CONT), pi_perf_read(PI_PERF_LD_STALL), pi_perf_read(PI_PERF_IMISS));
145158
#else
146-
printf(" | | | | | |");
159+
PRINTF(" | | | | | |");
147160
#endif
148161
if (Type == 0) {
149-
printf(" |\n");
150-
// printf("\nOutFFT%d_f32 = np.array([\n", Nfft); for(int i=0;i<(Nfft); i++) printf("%f%+fj, ", InBuff_f32[2*i], InBuff_f32[2*i+1]); printf("])\n");
162+
PRINTF(" |\n");
163+
// PRINTF("\nOutFFT%d_f32 = np.array([\n", Nfft); for(int i=0;i<(Nfft); i++) PRINTF("%f%+fj, ", InBuff_f32[2*i], InBuff_f32[2*i+1]); PRINTF("])\n");
151164
} else if (Type == 1) {
152-
// printf("\nOutFFT%d_q16 = np.array([\n", Nfft); for(int i=0;i<(Nfft); i++) printf("%d%+dj, ", ((short int*)InBuff_q16)[2*i], ((short int*)InBuff_q16)[2*i+1]); printf("])\n");
153-
printf(" %f |\n", MSE_16(InBuff_f32, (short int*) InBuff_q16, Nfft, Q));
165+
// PRINTF("\nOutFFT%d_q16 = np.array([\n", Nfft); for(int i=0;i<(Nfft); i++) PRINTF("%d%+dj, ", ((short int*)InBuff_q16)[2*i], ((short int*)InBuff_q16)[2*i+1]); PRINTF("])\n");
166+
MSE_ARR[Nfft/128][0] = MSE_16(InBuff_f32, (short int*) InBuff_q16, Nfft, Q);
167+
PRINTF(" %f |\n", MSE_ARR[Nfft/128][0]);
154168
} else if (Type == 2) {
155169
#ifdef __gap9__
156-
// printf("\nOutFFT%d_f16 = np.array([\n", Nfft); for(int i=0;i<(Nfft); i++) printf("%f%+fj, ", ((f16*)OutBuff)[2*i], ((f16*)OutBuff)[2*i+1]); printf("])\n");
157-
printf(" %f |\n", MSE_f16(InBuff_f32, (f16 *) InBuff_f16, Nfft));
170+
// PRINTF("\nOutFFT%d_f16 = np.array([\n", Nfft); for(int i=0;i<(Nfft); i++) PRINTF("%f%+fj, ", ((f16*)OutBuff)[2*i], ((f16*)OutBuff)[2*i+1]); PRINTF("])\n");
171+
MSE_ARR[Nfft/128][1] = MSE_f16(InBuff_f32, (f16 *) InBuff_f16, Nfft);
172+
PRINTF(" %f |\n", MSE_ARR[Nfft/128][1]);
158173
#else
159-
printf("\n");
174+
PRINTF("\n");
160175
#endif
161176
}
162177
}
@@ -171,31 +186,31 @@ static void RunFFT()
171186
#endif
172187
gap_cl_resethwtimer();
173188
int start, elapsed, timef32;
174-
printf("Initializing inputs....\n");
189+
PRINTF("Initializing inputs....\n");
175190
//InitData4 (InDataQ16, MAXDIM, 37, 15, 23, 73, 0.1, 0.5, 0.6, 0.8);
176191
//InitData4_float(InDataf32, MAXDIM, 37, 15, 23, 73, 0.1, 0.5, 0.6, 0.8);
177192
#ifdef __gap9__
178193
for (int i=0; i<MAXDIM; i++) InDataf16[i] = (f16) InDataf32[i];
179194
#endif
180-
printf("Done!\n");
195+
PRINTF("Done!\n");
181196

182197
gap_cl_resethwtimer();
183198

184199
int FFTBins = 64;
185-
printf("|----------+------------+--------+-------+--------+---------+---------+---------+----------+---------+----------|\n");
186-
printf("| FFT BINS | Type | FFT | Swap | Tot | Instr | Act Cyc | TCDM Co | LD Stall | Imiss | MSE Err |\n");
187-
printf("|----------+------------+--------+-------+--------+---------+---------+---------+----------+---------+----------|\n");
200+
PRINTF("|----------+------------+--------+-------+--------+---------+---------+---------+----------+---------+----------|\n");
201+
PRINTF("| FFT BINS | Type | FFT | Swap | Tot | Instr | Act Cyc | TCDM Co | LD Stall | Imiss | MSE Err |\n");
202+
PRINTF("|----------+------------+--------+-------+--------+---------+---------+---------+----------+---------+----------|\n");
188203
while (FFTBins < MAXDIM){
189-
//printf("FFT: %4d\n", FFTBins);
204+
//PRINTF("FFT: %4d\n", FFTBins);
190205
CallFFT(FFTBins, 0);
191206
CallFFT(FFTBins, 1);
192207
#ifdef __gap9__
193208
CallFFT(FFTBins, 2);
194209
#endif
195210
FFTBins *= 2;
196-
printf("|----------+------------+--------+-------+--------+---------+---------+---------+----------+---------+----------|\n");
211+
PRINTF("|----------+------------+--------+-------+--------+---------+---------+---------+----------+---------+----------|\n");
197212
}
198-
printf("Finished\n");
213+
PRINTF("Finished\n");
199214
}
200215

201216
void test_kickoff(void *arg)
@@ -237,7 +252,25 @@ void test_kickoff(void *arg)
237252
task.slave_stack_size = (unsigned int) 1048;
238253
pi_cluster_send_task(&cluster_dev, &task);
239254
#endif
240-
printf("Exiting\n");
255+
256+
int FFTBins = 64;
257+
while (FFTBins < MAXDIM){
258+
if (MSE_ARR[FFTBins/128][0] > 0.016) {
259+
printf("Error: MSE too large for %d FFT Q16\n", FFTBins);
260+
printf("Test FAILED\n");
261+
pmsis_exit(-1);
262+
}
263+
#ifdef __gap9__
264+
if (MSE_ARR[FFTBins/128][1] > 0.000048) {
265+
printf("Error: MSE too large for %d FFT F16\n", FFTBins);
266+
printf("Test FAILED\n");
267+
pmsis_exit(-1);
268+
}
269+
#endif
270+
FFTBins *= 2;
271+
}
272+
273+
printf("Test PASSED\n");
241274
pmsis_exit(0);
242275
}
243276

examples/autotiler/FFTL1/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# User Test
22
#------------------------------------
33

4-
PMSIS_OS?=pulpos
4+
#PMSIS_OS?=pulpos
55
APP = test
66
APP_SRCS += FFTRunTest.c $(AT_HOME)/DSP_Libraries/FFT_Library.c $(AT_HOME)/DSP_Libraries/LUT_Tables/TwiddlesDef.c $(AT_HOME)/DSP_Libraries/LUT_Tables/SwapTablesDef.c
77
APP_INC +=

examples/pmsis/periph/i2c/i2c_scan/Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ APP_INC +=
77
APP_CFLAGS +=
88

99

10-
runner_args =--trace=corruptor --trace-level=trace
11-
#runner_args =--trace=board.*i2c --trace-level=trace
12-
#runner_args =--trace=board.*i2c:gvsoc.log --trace-level=trace
13-
#runner_args =--trace=eeprom
14-
#runner_args +=--trace-level=trace
10+
ifeq '$(platform)' 'gvsoc'
1511
# Overwrite the default target so that GVSOC simulates our board
1612
# First name is the class name, second one is the python module
1713
export GAPY_PY_TARGET=My_board@my_board
14+
endif
1815

1916
# Append current directory to python path so that it finds our board and module
2017
export PYTHONPATH:=$(CURDIR):$(PYTHONPATH)

gvsoc/gvsoc/bin/pulp-pc-info

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,15 @@ toolchain = os.environ.get('PULP_RISCV_GCC_TOOLCHAIN_CI')
6363
if toolchain is None:
6464
toolchain = os.environ.get('PULP_RISCV_GCC_TOOLCHAIN')
6565

66-
if toolchain is not None:
67-
readelf = toolchain + '/bin/riscv32-unknown-elf-readelf'
68-
addr2line = toolchain + '/bin/riscv32-unknown-elf-addr2line'
69-
else:
70-
readelf = 'riscv32-unknown-elf-readelf'
71-
addr2line = 'riscv32-unknown-elf-addr2line'
66+
# if toolchain is not None:
67+
# readelf = toolchain + '/bin/riscv32-unknown-elf-readelf'
68+
# addr2line = toolchain + '/bin/riscv32-unknown-elf-addr2line'
69+
# else:
70+
# readelf = 'riscv32-unknown-elf-readelf'
71+
# addr2line = 'riscv32-unknown-elf-addr2line'
72+
73+
readelf = 'readelf'
74+
addr2line = 'addr2line'
7275

7376
process = Popen((readelf + ' -s %s' % args.file).split(), stdin=PIPE, stdout=PIPE)
7477

0 commit comments

Comments
 (0)