-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-coremark-modification.patch
6728 lines (6722 loc) · 197 KB
/
0001-coremark-modification.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From 638d002c9482fb275fe9679b0d56ac9196570030 Mon Sep 17 00:00:00 2001
From: sjthales <[email protected]>
Date: Fri, 9 Oct 2020 10:24:36 +0200
Subject: [PATCH] coremark modification
---
sw/app/coremark/barebones/core_portme.c | 153 -------
sw/app/coremark/barebones/core_portme.h | 210 ---------
sw/app/coremark/barebones/core_portme.mak | 87 ----
sw/app/coremark/barebones/cvt.c | 127 ------
sw/app/coremark/barebones/ee_printf.c | 700 ------------------------------
sw/app/coremark/core_main.c | 4 +-
sw/app/coremark/cygwin/core_portme.c | 420 ------------------
sw/app/coremark/cygwin/core_portme.h | 312 -------------
sw/app/coremark/cygwin/core_portme.mak | 141 ------
sw/app/coremark/freebsd/core_portme.c | 419 ------------------
sw/app/coremark/freebsd/core_portme.h | 309 -------------
sw/app/coremark/freebsd/core_portme.mak | 140 ------
sw/app/coremark/linux/core_portme.c | 422 ------------------
sw/app/coremark/linux/core_portme.h | 308 -------------
sw/app/coremark/linux/core_portme.mak | 140 ------
sw/app/coremark/linux64/core_portme.c | 420 ------------------
sw/app/coremark/linux64/core_portme.h | 309 -------------
sw/app/coremark/linux64/core_portme.mak | 140 ------
sw/app/coremark/macos/core_portme.c | 420 ------------------
sw/app/coremark/macos/core_portme.h | 309 -------------
sw/app/coremark/macos/core_portme.mak | 140 ------
sw/app/coremark/rtems/core_portme.c | 364 ----------------
sw/app/coremark/rtems/core_portme.h | 305 -------------
sw/app/coremark/rtems/core_portme.mak | 140 ------
sw/app/coremark/simple/core_portme.c | 8 +-
sw/app/coremark/simple/core_portme.h | 12 +-
26 files changed, 14 insertions(+), 6445 deletions(-)
delete mode 100644 sw/app/coremark/barebones/core_portme.c
delete mode 100644 sw/app/coremark/barebones/core_portme.h
delete mode 100755 sw/app/coremark/barebones/core_portme.mak
delete mode 100644 sw/app/coremark/barebones/cvt.c
delete mode 100644 sw/app/coremark/barebones/ee_printf.c
delete mode 100644 sw/app/coremark/cygwin/core_portme.c
delete mode 100644 sw/app/coremark/cygwin/core_portme.h
delete mode 100755 sw/app/coremark/cygwin/core_portme.mak
delete mode 100644 sw/app/coremark/freebsd/core_portme.c
delete mode 100644 sw/app/coremark/freebsd/core_portme.h
delete mode 100755 sw/app/coremark/freebsd/core_portme.mak
delete mode 100644 sw/app/coremark/linux/core_portme.c
delete mode 100644 sw/app/coremark/linux/core_portme.h
delete mode 100755 sw/app/coremark/linux/core_portme.mak
delete mode 100644 sw/app/coremark/linux64/core_portme.c
delete mode 100644 sw/app/coremark/linux64/core_portme.h
delete mode 100755 sw/app/coremark/linux64/core_portme.mak
delete mode 100644 sw/app/coremark/macos/core_portme.c
delete mode 100644 sw/app/coremark/macos/core_portme.h
delete mode 100755 sw/app/coremark/macos/core_portme.mak
delete mode 100755 sw/app/coremark/rtems/core_portme.c
delete mode 100755 sw/app/coremark/rtems/core_portme.h
delete mode 100755 sw/app/coremark/rtems/core_portme.mak
diff --git a/sw/app/coremark/barebones/core_portme.c b/sw/app/coremark/barebones/core_portme.c
deleted file mode 100644
index 1896767..0000000
--- a/sw/app/coremark/barebones/core_portme.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Original Author: Shay Gal-on
-*/
-#include "coremark.h"
-#include "core_portme.h"
-
-#if VALIDATION_RUN
-volatile ee_s32 seed1_volatile = 0x3415;
-volatile ee_s32 seed2_volatile = 0x3415;
-volatile ee_s32 seed3_volatile = 0x66;
-#endif
-#if PERFORMANCE_RUN
-volatile ee_s32 seed1_volatile = 0x0;
-volatile ee_s32 seed2_volatile = 0x0;
-volatile ee_s32 seed3_volatile = 0x66;
-#endif
-#if PROFILE_RUN
-volatile ee_s32 seed1_volatile = 0x8;
-volatile ee_s32 seed2_volatile = 0x8;
-volatile ee_s32 seed3_volatile = 0x8;
-#endif
-volatile ee_s32 seed4_volatile = ITERATIONS;
-volatile ee_s32 seed5_volatile = 0;
-/* Porting : Timing functions
- How to capture time and convert to seconds must be ported to whatever is
- supported by the platform. e.g. Read value from on board RTC, read value from
- cpu clock cycles performance counter etc. Sample implementation for standard
- time.h and windows.h definitions included.
-*/
-CORETIMETYPE
-barebones_clock()
-{
-#error \
- "You must implement a method to measure time in barebones_clock()! This function should return current time.\n"
-}
-/* Define : TIMER_RES_DIVIDER
- Divider to trade off timer resolution and total time that can be
- measured.
-
- Use lower values to increase resolution, but make sure that overflow
- does not occur. If there are issues with the return value overflowing,
- increase this value.
- */
-#define GETMYTIME(_t) (*_t = barebones_clock())
-#define MYTIMEDIFF(fin, ini) ((fin) - (ini))
-#define TIMER_RES_DIVIDER 1
-#define SAMPLE_TIME_IMPLEMENTATION 1
-#define EE_TICKS_PER_SEC (CLOCKS_PER_SEC / TIMER_RES_DIVIDER)
-
-/** Define Host specific (POSIX), or target specific global time variables. */
-static CORETIMETYPE start_time_val, stop_time_val;
-
-/* Function : start_time
- This function will be called right before starting the timed portion of
- the benchmark.
-
- Implementation may be capturing a system timer (as implemented in the
- example code) or zeroing some system parameters - e.g. setting the cpu clocks
- cycles to 0.
-*/
-void
-start_time(void)
-{
- GETMYTIME(&start_time_val);
-}
-/* Function : stop_time
- This function will be called right after ending the timed portion of the
- benchmark.
-
- Implementation may be capturing a system timer (as implemented in the
- example code) or other system parameters - e.g. reading the current value of
- cpu cycles counter.
-*/
-void
-stop_time(void)
-{
- GETMYTIME(&stop_time_val);
-}
-/* Function : get_time
- Return an abstract "ticks" number that signifies time on the system.
-
- Actual value returned may be cpu cycles, milliseconds or any other
- value, as long as it can be converted to seconds by <time_in_secs>. This
- methodology is taken to accomodate any hardware or simulated platform. The
- sample implementation returns millisecs by default, and the resolution is
- controlled by <TIMER_RES_DIVIDER>
-*/
-CORE_TICKS
-get_time(void)
-{
- CORE_TICKS elapsed
- = (CORE_TICKS)(MYTIMEDIFF(stop_time_val, start_time_val));
- return elapsed;
-}
-/* Function : time_in_secs
- Convert the value returned by get_time to seconds.
-
- The <secs_ret> type is used to accomodate systems with no support for
- floating point. Default implementation implemented by the EE_TICKS_PER_SEC
- macro above.
-*/
-secs_ret
-time_in_secs(CORE_TICKS ticks)
-{
- secs_ret retval = ((secs_ret)ticks) / (secs_ret)EE_TICKS_PER_SEC;
- return retval;
-}
-
-ee_u32 default_num_contexts = 1;
-
-/* Function : portable_init
- Target specific initialization code
- Test for some common mistakes.
-*/
-void
-portable_init(core_portable *p, int *argc, char *argv[])
-{
-#error \
- "Call board initialization routines in portable init (if needed), in particular initialize UART!\n"
- if (sizeof(ee_ptr_int) != sizeof(ee_u8 *))
- {
- ee_printf(
- "ERROR! Please define ee_ptr_int to a type that holds a "
- "pointer!\n");
- }
- if (sizeof(ee_u32) != 4)
- {
- ee_printf("ERROR! Please define ee_u32 to a 32b unsigned type!\n");
- }
- p->portable_id = 1;
-}
-/* Function : portable_fini
- Target specific final code
-*/
-void
-portable_fini(core_portable *p)
-{
- p->portable_id = 0;
-}
diff --git a/sw/app/coremark/barebones/core_portme.h b/sw/app/coremark/barebones/core_portme.h
deleted file mode 100644
index 55f643b..0000000
--- a/sw/app/coremark/barebones/core_portme.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
-Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Original Author: Shay Gal-on
-*/
-/* Topic : Description
- This file contains configuration constants required to execute on
- different platforms
-*/
-#ifndef CORE_PORTME_H
-#define CORE_PORTME_H
-/************************/
-/* Data types and settings */
-/************************/
-/* Configuration : HAS_FLOAT
- Define to 1 if the platform supports floating point.
-*/
-#ifndef HAS_FLOAT
-#define HAS_FLOAT 1
-#endif
-/* Configuration : HAS_TIME_H
- Define to 1 if platform has the time.h header file,
- and implementation of functions thereof.
-*/
-#ifndef HAS_TIME_H
-#define HAS_TIME_H 1
-#endif
-/* Configuration : USE_CLOCK
- Define to 1 if platform has the time.h header file,
- and implementation of functions thereof.
-*/
-#ifndef USE_CLOCK
-#define USE_CLOCK 1
-#endif
-/* Configuration : HAS_STDIO
- Define to 1 if the platform has stdio.h.
-*/
-#ifndef HAS_STDIO
-#define HAS_STDIO 0
-#endif
-/* Configuration : HAS_PRINTF
- Define to 1 if the platform has stdio.h and implements the printf
- function.
-*/
-#ifndef HAS_PRINTF
-#define HAS_PRINTF 0
-#endif
-
-/* Definitions : COMPILER_VERSION, COMPILER_FLAGS, MEM_LOCATION
- Initialize these strings per platform
-*/
-#ifndef COMPILER_VERSION
-#ifdef __GNUC__
-#define COMPILER_VERSION "GCC"__VERSION__
-#else
-#define COMPILER_VERSION "Please put compiler version here (e.g. gcc 4.1)"
-#endif
-#endif
-#ifndef COMPILER_FLAGS
-#define COMPILER_FLAGS \
- FLAGS_STR /* "Please put compiler flags here (e.g. -o3)" */
-#endif
-#ifndef MEM_LOCATION
-#define MEM_LOCATION "STACK"
-#endif
-
-/* Data Types :
- To avoid compiler issues, define the data types that need ot be used for
- 8b, 16b and 32b in <core_portme.h>.
-
- *Imprtant* :
- ee_ptr_int needs to be the data type used to hold pointers, otherwise
- coremark may fail!!!
-*/
-typedef signed short ee_s16;
-typedef unsigned short ee_u16;
-typedef signed int ee_s32;
-typedef double ee_f32;
-typedef unsigned char ee_u8;
-typedef unsigned int ee_u32;
-typedef ee_u32 ee_ptr_int;
-typedef size_t ee_size_t;
-#define NULL ((void *)0)
-/* align_mem :
- This macro is used to align an offset to point to a 32b value. It is
- used in the Matrix algorithm to initialize the input memory blocks.
-*/
-#define align_mem(x) (void *)(4 + (((ee_ptr_int)(x)-1) & ~3))
-
-/* Configuration : CORE_TICKS
- Define type of return from the timing functions.
- */
-#define CORETIMETYPE ee_u32
-typedef ee_u32 CORE_TICKS;
-
-/* Configuration : SEED_METHOD
- Defines method to get seed values that cannot be computed at compile
- time.
-
- Valid values :
- SEED_ARG - from command line.
- SEED_FUNC - from a system function.
- SEED_VOLATILE - from volatile variables.
-*/
-#ifndef SEED_METHOD
-#define SEED_METHOD SEED_VOLATILE
-#endif
-
-/* Configuration : MEM_METHOD
- Defines method to get a block of memry.
-
- Valid values :
- MEM_MALLOC - for platforms that implement malloc and have malloc.h.
- MEM_STATIC - to use a static memory array.
- MEM_STACK - to allocate the data block on the stack (NYI).
-*/
-#ifndef MEM_METHOD
-#define MEM_METHOD MEM_STACK
-#endif
-
-/* Configuration : MULTITHREAD
- Define for parallel execution
-
- Valid values :
- 1 - only one context (default).
- N>1 - will execute N copies in parallel.
-
- Note :
- If this flag is defined to more then 1, an implementation for launching
- parallel contexts must be defined.
-
- Two sample implementations are provided. Use <USE_PTHREAD> or <USE_FORK>
- to enable them.
-
- It is valid to have a different implementation of <core_start_parallel>
- and <core_end_parallel> in <core_portme.c>, to fit a particular architecture.
-*/
-#ifndef MULTITHREAD
-#define MULTITHREAD 1
-#define USE_PTHREAD 0
-#define USE_FORK 0
-#define USE_SOCKET 0
-#endif
-
-/* Configuration : MAIN_HAS_NOARGC
- Needed if platform does not support getting arguments to main.
-
- Valid values :
- 0 - argc/argv to main is supported
- 1 - argc/argv to main is not supported
-
- Note :
- This flag only matters if MULTITHREAD has been defined to a value
- greater then 1.
-*/
-#ifndef MAIN_HAS_NOARGC
-#define MAIN_HAS_NOARGC 0
-#endif
-
-/* Configuration : MAIN_HAS_NORETURN
- Needed if platform does not support returning a value from main.
-
- Valid values :
- 0 - main returns an int, and return value will be 0.
- 1 - platform does not support returning a value from main
-*/
-#ifndef MAIN_HAS_NORETURN
-#define MAIN_HAS_NORETURN 0
-#endif
-
-/* Variable : default_num_contexts
- Not used for this simple port, must cintain the value 1.
-*/
-extern ee_u32 default_num_contexts;
-
-typedef struct CORE_PORTABLE_S
-{
- ee_u8 portable_id;
-} core_portable;
-
-/* target specific init/fini */
-void portable_init(core_portable *p, int *argc, char *argv[]);
-void portable_fini(core_portable *p);
-
-#if !defined(PROFILE_RUN) && !defined(PERFORMANCE_RUN) \
- && !defined(VALIDATION_RUN)
-#if (TOTAL_DATA_SIZE == 1200)
-#define PROFILE_RUN 1
-#elif (TOTAL_DATA_SIZE == 2000)
-#define PERFORMANCE_RUN 1
-#else
-#define VALIDATION_RUN 1
-#endif
-#endif
-
-int ee_printf(const char *fmt, ...);
-
-#endif /* CORE_PORTME_H */
diff --git a/sw/app/coremark/barebones/core_portme.mak b/sw/app/coremark/barebones/core_portme.mak
deleted file mode 100755
index 8159469..0000000
--- a/sw/app/coremark/barebones/core_portme.mak
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC)
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Original Author: Shay Gal-on
-
-#File : core_portme.mak
-
-# Flag : OUTFLAG
-# Use this flag to define how to to get an executable (e.g -o)
-OUTFLAG= -o
-# Flag : CC
-# Use this flag to define compiler to use
-CC = gcc
-# Flag : LD
-# Use this flag to define compiler to use
-LD = gld
-# Flag : AS
-# Use this flag to define compiler to use
-AS = gas
-# Flag : CFLAGS
-# Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags"
-PORT_CFLAGS = -O0 -g
-FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)"
-CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\"
-#Flag : LFLAGS_END
-# Define any libraries needed for linking or other flags that should come at the end of the link line (e.g. linker scripts).
-# Note : On certain platforms, the default clock_gettime implementation is supported but requires linking of librt.
-SEPARATE_COMPILE=1
-# Flag : SEPARATE_COMPILE
-# You must also define below how to create an object file, and how to link.
-OBJOUT = -o
-LFLAGS =
-ASFLAGS =
-OFLAG = -o
-COUT = -c
-
-LFLAGS_END =
-# Flag : PORT_SRCS
-# Port specific source files can be added here
-# You may also need cvt.c if the fcvt functions are not provided as intrinsics by your compiler!
-PORT_SRCS = $(PORT_DIR)/core_portme.c $(PORT_DIR)/ee_printf.c
-vpath %.c $(PORT_DIR)
-vpath %.s $(PORT_DIR)
-
-# Flag : LOAD
-# For a simple port, we assume self hosted compile and run, no load needed.
-
-# Flag : RUN
-# For a simple port, we assume self hosted compile and run, simple invocation of the executable
-
-LOAD = echo "Please set LOAD to the process of loading the executable to the flash"
-RUN = echo "Please set LOAD to the process of running the executable (e.g. via jtag, or board reset)"
-
-OEXT = .o
-EXE = .bin
-
-$(OPATH)$(PORT_DIR)/%$(OEXT) : %.c
- $(CC) $(CFLAGS) $(XCFLAGS) $(COUT) $< $(OBJOUT) $@
-
-$(OPATH)%$(OEXT) : %.c
- $(CC) $(CFLAGS) $(XCFLAGS) $(COUT) $< $(OBJOUT) $@
-
-$(OPATH)$(PORT_DIR)/%$(OEXT) : %.s
- $(AS) $(ASFLAGS) $< $(OBJOUT) $@
-
-# Target : port_pre% and port_post%
-# For the purpose of this simple port, no pre or post steps needed.
-
-.PHONY : port_prebuild port_postbuild port_prerun port_postrun port_preload port_postload
-port_pre% port_post% :
-
-# FLAG : OPATH
-# Path to the output folder. Default - current folder.
-OPATH = ./
-MKDIR = mkdir -p
-
diff --git a/sw/app/coremark/barebones/cvt.c b/sw/app/coremark/barebones/cvt.c
deleted file mode 100644
index 333e8ea..0000000
--- a/sw/app/coremark/barebones/cvt.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-#include <math.h>
-#define CVTBUFSIZE 80
-static char CVTBUF[CVTBUFSIZE];
-
-static char *
-cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int eflag)
-{
- int r2;
- double fi, fj;
- char * p, *p1;
-
- if (ndigits < 0)
- ndigits = 0;
- if (ndigits >= CVTBUFSIZE - 1)
- ndigits = CVTBUFSIZE - 2;
- r2 = 0;
- *sign = 0;
- p = &buf[0];
- if (arg < 0)
- {
- *sign = 1;
- arg = -arg;
- }
- arg = modf(arg, &fi);
- p1 = &buf[CVTBUFSIZE];
-
- if (fi != 0)
- {
- p1 = &buf[CVTBUFSIZE];
- while (fi != 0)
- {
- fj = modf(fi / 10, &fi);
- *--p1 = (int)((fj + .03) * 10) + '0';
- r2++;
- }
- while (p1 < &buf[CVTBUFSIZE])
- *p++ = *p1++;
- }
- else if (arg > 0)
- {
- while ((fj = arg * 10) < 1)
- {
- arg = fj;
- r2--;
- }
- }
- p1 = &buf[ndigits];
- if (eflag == 0)
- p1 += r2;
- *decpt = r2;
- if (p1 < &buf[0])
- {
- buf[0] = '\0';
- return buf;
- }
- while (p <= p1 && p < &buf[CVTBUFSIZE])
- {
- arg *= 10;
- arg = modf(arg, &fj);
- *p++ = (int)fj + '0';
- }
- if (p1 >= &buf[CVTBUFSIZE])
- {
- buf[CVTBUFSIZE - 1] = '\0';
- return buf;
- }
- p = p1;
- *p1 += 5;
- while (*p1 > '9')
- {
- *p1 = '0';
- if (p1 > buf)
- ++*--p1;
- else
- {
- *p1 = '1';
- (*decpt)++;
- if (eflag == 0)
- {
- if (p > buf)
- *p = '0';
- p++;
- }
- }
- }
- *p = '\0';
- return buf;
-}
-
-char *
-ecvt(double arg, int ndigits, int *decpt, int *sign)
-{
- return cvt(arg, ndigits, decpt, sign, CVTBUF, 1);
-}
-
-char *
-ecvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
-{
- return cvt(arg, ndigits, decpt, sign, buf, 1);
-}
-
-char *
-fcvt(double arg, int ndigits, int *decpt, int *sign)
-{
- return cvt(arg, ndigits, decpt, sign, CVTBUF, 0);
-}
-
-char *
-fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
-{
- return cvt(arg, ndigits, decpt, sign, buf, 0);
-}
diff --git a/sw/app/coremark/barebones/ee_printf.c b/sw/app/coremark/barebones/ee_printf.c
deleted file mode 100644
index 88d8a62..0000000
--- a/sw/app/coremark/barebones/ee_printf.c
+++ /dev/null
@@ -1,700 +0,0 @@
-/*
-Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC)
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-#include <coremark.h>
-#include <stdarg.h>
-
-#define ZEROPAD (1 << 0) /* Pad with zero */
-#define SIGN (1 << 1) /* Unsigned/signed long */
-#define PLUS (1 << 2) /* Show plus */
-#define SPACE (1 << 3) /* Spacer */
-#define LEFT (1 << 4) /* Left justified */
-#define HEX_PREP (1 << 5) /* 0x */
-#define UPPERCASE (1 << 6) /* 'ABCDEF' */
-
-#define is_digit(c) ((c) >= '0' && (c) <= '9')
-
-static char * digits = "0123456789abcdefghijklmnopqrstuvwxyz";
-static char * upper_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-static ee_size_t strnlen(const char *s, ee_size_t count);
-
-static ee_size_t
-strnlen(const char *s, ee_size_t count)
-{
- const char *sc;
- for (sc = s; *sc != '\0' && count--; ++sc)
- ;
- return sc - s;
-}
-
-static int
-skip_atoi(const char **s)
-{
- int i = 0;
- while (is_digit(**s))
- i = i * 10 + *((*s)++) - '0';
- return i;
-}
-
-static char *
-number(char *str, long num, int base, int size, int precision, int type)
-{
- char c, sign, tmp[66];
- char *dig = digits;
- int i;
-
- if (type & UPPERCASE)
- dig = upper_digits;
- if (type & LEFT)
- type &= ~ZEROPAD;
- if (base < 2 || base > 36)
- return 0;
-
- c = (type & ZEROPAD) ? '0' : ' ';
- sign = 0;
- if (type & SIGN)
- {
- if (num < 0)
- {
- sign = '-';
- num = -num;
- size--;
- }
- else if (type & PLUS)
- {
- sign = '+';
- size--;
- }
- else if (type & SPACE)
- {
- sign = ' ';
- size--;
- }
- }
-
- if (type & HEX_PREP)
- {
- if (base == 16)
- size -= 2;
- else if (base == 8)
- size--;
- }
-
- i = 0;
-
- if (num == 0)
- tmp[i++] = '0';
- else
- {
- while (num != 0)
- {
- tmp[i++] = dig[((unsigned long)num) % (unsigned)base];
- num = ((unsigned long)num) / (unsigned)base;
- }
- }
-
- if (i > precision)
- precision = i;
- size -= precision;
- if (!(type & (ZEROPAD | LEFT)))
- while (size-- > 0)
- *str++ = ' ';
- if (sign)
- *str++ = sign;
-
- if (type & HEX_PREP)
- {
- if (base == 8)
- *str++ = '0';
- else if (base == 16)
- {
- *str++ = '0';
- *str++ = digits[33];
- }
- }
-
- if (!(type & LEFT))
- while (size-- > 0)
- *str++ = c;
- while (i < precision--)
- *str++ = '0';
- while (i-- > 0)
- *str++ = tmp[i];
- while (size-- > 0)
- *str++ = ' ';
-
- return str;
-}
-
-static char *
-eaddr(char *str, unsigned char *addr, int size, int precision, int type)
-{
- char tmp[24];
- char *dig = digits;
- int i, len;
-
- if (type & UPPERCASE)
- dig = upper_digits;
- len = 0;
- for (i = 0; i < 6; i++)
- {
- if (i != 0)
- tmp[len++] = ':';
- tmp[len++] = dig[addr[i] >> 4];
- tmp[len++] = dig[addr[i] & 0x0F];
- }
-
- if (!(type & LEFT))
- while (len < size--)
- *str++ = ' ';
- for (i = 0; i < len; ++i)
- *str++ = tmp[i];
- while (len < size--)
- *str++ = ' ';
-
- return str;
-}
-
-static char *
-iaddr(char *str, unsigned char *addr, int size, int precision, int type)
-{
- char tmp[24];
- int i, n, len;
-
- len = 0;
- for (i = 0; i < 4; i++)
- {
- if (i != 0)
- tmp[len++] = '.';
- n = addr[i];
-
- if (n == 0)
- tmp[len++] = digits[0];
- else
- {
- if (n >= 100)
- {
- tmp[len++] = digits[n / 100];
- n = n % 100;
- tmp[len++] = digits[n / 10];
- n = n % 10;
- }
- else if (n >= 10)
- {
- tmp[len++] = digits[n / 10];
- n = n % 10;
- }
-
- tmp[len++] = digits[n];
- }
- }
-
- if (!(type & LEFT))
- while (len < size--)
- *str++ = ' ';
- for (i = 0; i < len; ++i)
- *str++ = tmp[i];
- while (len < size--)
- *str++ = ' ';
-
- return str;
-}
-
-#if HAS_FLOAT
-
-char * ecvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf);
-char * fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf);
-static void ee_bufcpy(char *d, char *s, int count);
-
-void
-ee_bufcpy(char *pd, char *ps, int count)
-{
- char *pe = ps + count;
- while (ps != pe)
- *pd++ = *ps++;
-}
-
-static void
-parse_float(double value, char *buffer, char fmt, int precision)
-{
- int decpt, sign, exp, pos;
- char *digits = NULL;
- char cvtbuf[80];
- int capexp = 0;
- int magnitude;
-
- if (fmt == 'G' || fmt == 'E')
- {
- capexp = 1;
- fmt += 'a' - 'A';
- }
-
- if (fmt == 'g')
- {
- digits = ecvtbuf(value, precision, &decpt, &sign, cvtbuf);
- magnitude = decpt - 1;
- if (magnitude < -4 || magnitude > precision - 1)
- {
- fmt = 'e';
- precision -= 1;
- }
- else
- {
- fmt = 'f';
- precision -= decpt;
- }
- }
-
- if (fmt == 'e')
- {
- digits = ecvtbuf(value, precision + 1, &decpt, &sign, cvtbuf);
-
- if (sign)
- *buffer++ = '-';
- *buffer++ = *digits;
- if (precision > 0)
- *buffer++ = '.';
- ee_bufcpy(buffer, digits + 1, precision);
- buffer += precision;
- *buffer++ = capexp ? 'E' : 'e';
-
- if (decpt == 0)
- {
- if (value == 0.0)
- exp = 0;
- else
- exp = -1;
- }
- else
- exp = decpt - 1;
-
- if (exp < 0)
- {
- *buffer++ = '-';
- exp = -exp;
- }
- else
- *buffer++ = '+';
-
- buffer[2] = (exp % 10) + '0';
- exp = exp / 10;
- buffer[1] = (exp % 10) + '0';
- exp = exp / 10;
- buffer[0] = (exp % 10) + '0';
- buffer += 3;
- }
- else if (fmt == 'f')
- {
- digits = fcvtbuf(value, precision, &decpt, &sign, cvtbuf);
- if (sign)
- *buffer++ = '-';
- if (*digits)
- {
- if (decpt <= 0)
- {
- *buffer++ = '0';
- *buffer++ = '.';
- for (pos = 0; pos < -decpt; pos++)
- *buffer++ = '0';
- while (*digits)
- *buffer++ = *digits++;
- }
- else
- {
- pos = 0;
- while (*digits)
- {
- if (pos++ == decpt)
- *buffer++ = '.';
- *buffer++ = *digits++;
- }
- }
- }
- else
- {
- *buffer++ = '0';
- if (precision > 0)
- {
- *buffer++ = '.';
- for (pos = 0; pos < precision; pos++)
- *buffer++ = '0';
- }
- }
- }