summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 55d7fd4)
raw | patch | inline | side by side (parent: 55d7fd4)
author | John Godbey <j-godbey@ti.com> | |
Fri, 29 Apr 2016 20:31:49 +0000 (16:31 -0400) | ||
committer | John Godbey <j-godbey@ti.com> | |
Fri, 29 Apr 2016 20:31:49 +0000 (16:31 -0400) |
Signed-off-by: John Godbey <j-godbey@ti.com>
AM572x/armv7/bios/dhry.cfg | patch | blob | history | |
dhry.h | patch | blob | history | |
dhry_1.c | patch | blob | history | |
makefile | patch | blob | history |
index fbc487f284cf940539153d1cdacdf838fe975a9b..5aa39c935ae46a2c7ec664c680d9b8ecafd5a58f 100644 (file)
var Memory = xdc.useModule('xdc.runtime.Memory')
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
-//var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
-//var SysMin = xdc.useModule('xdc.runtime.SysMin');
-var LoggerBuf = xdc.useModule('ti.sysbios.smp.LoggerBuf');
-var SysMin = xdc.useModule('ti.sysbios.smp.SysMin');
+var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
+var SysMin = xdc.useModule('xdc.runtime.SysMin');
+//var LoggerBuf = xdc.useModule('ti.sysbios.smp.LoggerBuf');
+//var SysMin = xdc.useModule('ti.sysbios.smp.SysMin');
xdc.useModule('xdc.runtime.Timestamp');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
-BIOS.smpEnabled = true;
+BIOS.smpEnabled = false;
Posix = xdc.useModule('ti.sysbios.posix.Settings');
Posix.supportsMutexPriority = true;
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
System.SupportProxy = SysMin;
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
-var Core = xdc.useModule('ti.sysbios.family.arm.a15.smp.Core');
-Core.useSkernelCmd = false; /* Set to false if running in CCS and using gel files to wake-up secondary cores */
+var Core = xdc.useModule('ti.sysbios.family.arm.a15.Core');
+//var Core = xdc.useModule('ti.sysbios.family.arm.a15.smp.Core');
+//Core.useSkernelCmd = false; /* Set to false if running in CCS and using gel files to wake-up secondary cores */
Core.numCores = 2;
//var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
//Timestamp.SupportProxy = xdc.useModule('ti.sysbios.timers.timer64.TimestampProvider');
-//var Cache = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
-var Cache = xdc.useModule('ti.sysbios.family.arm.a15.smp.Cache');
+var Cache = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
+//var Cache = xdc.useModule('ti.sysbios.family.arm.a15.smp.Cache');
var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
// Enable the cache
// Enable the MMU (Required for L1/L2 data caching)
Mmu.enableMMU = true;
+// descriptor attribute structure
+var peripheralAttrs = new Mmu.DescriptorAttrs();
+
+Mmu.initDescAttrsMeta(peripheralAttrs);
+
+peripheralAttrs.type = Mmu.DescriptorType_BLOCK; // BLOCK descriptor
+peripheralAttrs.noExecute = true; // not executable
+peripheralAttrs.accPerm = 0; // read/write at PL1
+peripheralAttrs.attrIndx = 1; // MAIR0 Byte1 describes
+ // memory attributes for
+ // each BLOCK MMU entry
+
+// Define the base address of the 2 MB page
+// the peripheral resides in.
+var peripheralBaseAddrs = [
+ { base: 0x4ae00000, size: 0x00100000 }, // PRM
+ { base: 0x51000000, size: 0x00800000 }, // pcie_ss1 regs
+ { base: 0x51800000, size: 0x01000000 }, // pcie_ss2 regs
+ { base: 0x20000000, size: 0x10000000 }, // pcie_ss1 data
+ { base: 0x30000000, size: 0x10000000 }, // pcie_ss2 data
+ /* Following registers for IODELAY/PINMUX */
+ { base: 0x4844a000, size: 0x00001000 },
+ { base: 0x48447000, size: 0x00001000 },
+ { base: 0x4a002000, size: 0x00001000 },
+ { base: 0x43300000, size: 0x00300000 }
+];
+
+// Configure the corresponding MMU page descriptor accordingly
+for (var i =0; i < peripheralBaseAddrs.length; i++)
+{
+ for (var j = 0; j < peripheralBaseAddrs[i].size; j += 0x200000)
+ {
+ var addr = peripheralBaseAddrs[i].base + j;
+ Mmu.setSecondLevelDescMeta(addr, addr, peripheralAttrs);
+ }
+}
+
+/* ================ Driver configuration ================ */
+
+var socType = "am572x";
+
+/* Load the osal package -- required by board & interrupt example */
+var osType = "tirtos"
+var Osal = xdc.loadPackage('ti.osal');
+Osal.Settings.osType = osType;
+
+/* Load the I2C package - required by board */
+var I2c = xdc.loadPackage('ti.drv.i2c');
+
+/* Load the uart package -- required by board */
+var Uart = xdc.loadPackage('ti.drv.uart');
+Uart.Settings.socType = socType;
+
+/* Load the gpio package */
+var Gpio = xdc.loadPackage('ti.drv.gpio');
+Gpio.Settings.socType = socType;
+
+/* Load the Board package and set the board name */
+var Board = xdc.loadPackage('ti.board');
+Board.Settings.boardName = "idkAM572x";
+
+/*use CSL package*/
+var Csl = xdc.loadPackage('ti.csl');
+Csl.Settings.deviceType = socType;
index d819c28b89edbfb3d751182ca39a66d4943c4b76..b63374ca9fefb6d3700d9f19caf7be995797af58 100644 (file)
--- a/dhry.h
+++ b/dhry.h
#endif
#endif
+/* Set up printf */
+#include <xdc/runtime/System.h>
+#define Console_printf System_printf
+
+/* Enable the below macro to have prints on the IO Console */
+#if !defined(SOC_AM572x) && !defined(SOC_AM571x) && !defined(SOC_K2G) && \
+ !defined(__ARM_ARCH_7A__)
+/* AM57x and K2G always use UART for all cores. Also all ARM use UART */
+#define IO_CONSOLE
+#endif
+
#define Mic_secs_Per_Second 1000000.0
/* Berkeley UNIX C returns process times in seconds/HZ */
diff --git a/dhry_1.c b/dhry_1.c
index 5bb07506722a218a91067a48a25e323001fc738b..97d021fded6fc8ba68fc441dd3458942b542dc67 100644 (file)
--- a/dhry_1.c
+++ b/dhry_1.c
#include "dhry.h"
#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
#ifdef BIOS_POSIX
/* BIOS6 include */
#include <xdc/runtime/System.h>
#include <ti/sysbios/posix/pthread.h>
+#if defined(SOC_AM572x) || defined(SOC_AM571x) || defined(SOC_K2G) || (__ARM_ARCH_7A__)
+#include "ti/board/board.h"
+#endif
#else
#include <pthread.h>
#include <sys/time.h>
#endif
+#ifndef IO_CONSOLE
+#include <ti/drv/uart/UART_stdio.h>
+#endif
#ifdef BIOS_POSIX
#ifdef _TMS320C6X
Boolean Reg = true;
#endif
-
+int DHRY_printf(const char *format, ...)
+{
+ int retval;
+ va_list args;
+ va_start(args, format);
+
+#ifdef BIOS_POSIX
+#ifndef IO_CONSOLE
+ {
+ char buf[80];
+ size_t len = 80;
+ retval = System_vsnprintf (buf, len, format, args);
+ UART_puts (buf, retval);
+ }
+#else
+ retval = System_vprintf(format, args);
+#endif
+#else
+ retval = vprintf(format, args);
+#endif
+
+ va_end(args);
+ return retval;
+}
/* end of variables for time measurement */
void check (const char *str, int err)
{
if (err != 0)
{
- printf ("%s: %d: %s\n", str, err, strerror(err));
+ DHRY_printf ("%s: %d: %s\n", str, err, strerror(err));
exit(1);
}
}
#ifdef MSC_CLOCK
extern clock_t clock();
#define Too_Small_Time (2*HZ)
-#endif
-
-#ifdef BIOS_POSIX
-#define printf System_printf
#endif
/* Initializations */
/* overflow may occur for this array element. */
#ifdef VERBOSE
- printf ("\n");
- printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
- printf ("\n");
+ DHRY_printf ("\n");
+ DHRY_printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
+ DHRY_printf ("\n");
#endif
#ifdef VERBOSE
if (Reg)
{
- printf ("Program compiled with 'register' attribute\n");
- printf ("\n");
+ DHRY_printf ("Program compiled with 'register' attribute\n");
+ DHRY_printf ("\n");
}
else
{
- printf ("Program compiled without 'register' attribute\n");
- printf ("\n");
+ DHRY_printf ("Program compiled without 'register' attribute\n");
+ DHRY_printf ("\n");
}
#endif
#ifdef VERBOSE
- printf ("Please give the number of runs through the benchmark: ");
+ DHRY_printf ("Please give the number of runs through the benchmark: ");
{
int n;
scanf ("%d", &n);
Number_Of_Runs = n;
}
- printf ("\n");
+ DHRY_printf ("\n");
#endif
Number_Of_Runs = threadInst->numIterations;
#ifdef VERBOSE
- printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
+ DHRY_printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
#endif
/***************/
#endif
#ifdef VERBOSE
- printf ("Execution ends\n");
- printf ("\n");
- printf ("Final values of the variables used in the benchmark:\n");
- printf ("\n");
- printf ("Int_Glob: %d\n", inst.Int_Glob);
- printf (" should be: %d\n", 5);
- printf ("Bool_Glob: %d\n", inst.Bool_Glob);
- printf (" should be: %d\n", 1);
- printf ("Ch_1_Glob: %c\n", inst.Ch_1_Glob);
- printf (" should be: %c\n", 'A');
- printf ("Ch_2_Glob: %c\n", inst.Ch_2_Glob);
- printf (" should be: %c\n", 'B');
- printf ("Arr_1_Glob[8]: %d\n", inst.Arr_1_Glob[8]);
- printf (" should be: %d\n", 7);
- printf ("Arr_2_Glob[8][7]: %d\n", inst.Arr_2_Glob[8][7]);
- printf (" should be: Number_Of_Runs + 10\n");
- printf ("Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) inst.Ptr_Glob->Ptr_Comp);
- printf (" should be: (implementation-dependent)\n");
- printf (" Discr: %d\n", inst.Ptr_Glob->Discr);
- printf (" should be: %d\n", 0);
- printf (" Enum_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Enum_Comp);
- printf (" should be: %d\n", 2);
- printf (" Int_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Int_Comp);
- printf (" should be: %d\n", 17);
- printf (" Str_Comp: %s\n", inst.Ptr_Glob->variant.var_1.Str_Comp);
- printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
- printf ("Next_Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) inst.Next_Ptr_Glob->Ptr_Comp);
- printf (" should be: (implementation-dependent), same as above\n");
- printf (" Discr: %d\n", inst.Next_Ptr_Glob->Discr);
- printf (" should be: %d\n", 0);
- printf (" Enum_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Enum_Comp);
- printf (" should be: %d\n", 1);
- printf (" Int_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Int_Comp);
- printf (" should be: %d\n", 18);
- printf (" Str_Comp: %s\n",
+ DHRY_printf ("Execution ends\n");
+ DHRY_printf ("\n");
+ DHRY_printf ("Final values of the variables used in the benchmark:\n");
+ DHRY_printf ("\n");
+ DHRY_printf ("Int_Glob: %d\n", inst.Int_Glob);
+ DHRY_printf (" should be: %d\n", 5);
+ DHRY_printf ("Bool_Glob: %d\n", inst.Bool_Glob);
+ DHRY_printf (" should be: %d\n", 1);
+ DHRY_printf ("Ch_1_Glob: %c\n", inst.Ch_1_Glob);
+ DHRY_printf (" should be: %c\n", 'A');
+ DHRY_printf ("Ch_2_Glob: %c\n", inst.Ch_2_Glob);
+ DHRY_printf (" should be: %c\n", 'B');
+ DHRY_printf ("Arr_1_Glob[8]: %d\n", inst.Arr_1_Glob[8]);
+ DHRY_printf (" should be: %d\n", 7);
+ DHRY_printf ("Arr_2_Glob[8][7]: %d\n", inst.Arr_2_Glob[8][7]);
+ DHRY_printf (" should be: Number_Of_Runs + 10\n");
+ DHRY_printf ("Ptr_Glob->\n");
+ DHRY_printf (" Ptr_Comp: %d\n", (int) inst.Ptr_Glob->Ptr_Comp);
+ DHRY_printf (" should be: (implementation-dependent)\n");
+ DHRY_printf (" Discr: %d\n", inst.Ptr_Glob->Discr);
+ DHRY_printf (" should be: %d\n", 0);
+ DHRY_printf (" Enum_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Enum_Comp);
+ DHRY_printf (" should be: %d\n", 2);
+ DHRY_printf (" Int_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Int_Comp);
+ DHRY_printf (" should be: %d\n", 17);
+ DHRY_printf (" Str_Comp: %s\n", inst.Ptr_Glob->variant.var_1.Str_Comp);
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
+ DHRY_printf ("Next_Ptr_Glob->\n");
+ DHRY_printf (" Ptr_Comp: %d\n", (int) inst.Next_Ptr_Glob->Ptr_Comp);
+ DHRY_printf (" should be: (implementation-dependent), same as above\n");
+ DHRY_printf (" Discr: %d\n", inst.Next_Ptr_Glob->Discr);
+ DHRY_printf (" should be: %d\n", 0);
+ DHRY_printf (" Enum_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Enum_Comp);
+ DHRY_printf (" should be: %d\n", 1);
+ DHRY_printf (" Int_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Int_Comp);
+ DHRY_printf (" should be: %d\n", 18);
+ DHRY_printf (" Str_Comp: %s\n",
inst.Next_Ptr_Glob->variant.var_1.Str_Comp);
- printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
- printf ("Int_1_Loc: %d\n", Int_1_Loc);
- printf (" should be: %d\n", 5);
- printf ("Int_2_Loc: %d\n", Int_2_Loc);
- printf (" should be: %d\n", 13);
- printf ("Int_3_Loc: %d\n", Int_3_Loc);
- printf (" should be: %d\n", 7);
- printf ("Enum_Loc: %d\n", Enum_Loc);
- printf (" should be: %d\n", 1);
- printf ("Str_1_Loc: %s\n", Str_1_Loc);
- printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
- printf ("Str_2_Loc: %s\n", Str_2_Loc);
- printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
- printf ("\n");
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
+ DHRY_printf ("Int_1_Loc: %d\n", Int_1_Loc);
+ DHRY_printf (" should be: %d\n", 5);
+ DHRY_printf ("Int_2_Loc: %d\n", Int_2_Loc);
+ DHRY_printf (" should be: %d\n", 13);
+ DHRY_printf ("Int_3_Loc: %d\n", Int_3_Loc);
+ DHRY_printf (" should be: %d\n", 7);
+ DHRY_printf ("Enum_Loc: %d\n", Enum_Loc);
+ DHRY_printf (" should be: %d\n", 1);
+ DHRY_printf ("Str_1_Loc: %s\n", Str_1_Loc);
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
+ DHRY_printf ("Str_2_Loc: %s\n", Str_2_Loc);
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
+ DHRY_printf ("\n");
#else
if (inst.Int_Glob != 5) {
- printf ("Int_Glob: %d\n", inst.Int_Glob);
- printf (" should be: %d\n", 5);
+ DHRY_printf ("Int_Glob: %d\n", inst.Int_Glob);
+ DHRY_printf (" should be: %d\n", 5);
error = 1;
}
if (inst.Bool_Glob != 1) {
- printf ("Bool_Glob: %d\n", inst.Bool_Glob);
- printf (" should be: %d\n", 1);
+ DHRY_printf ("Bool_Glob: %d\n", inst.Bool_Glob);
+ DHRY_printf (" should be: %d\n", 1);
error = 1;
}
if (inst.Ch_1_Glob != 'A')
{
- printf ("Ch_1_Glob: %c\n", inst.Ch_1_Glob);
- printf (" should be: %c\n", 'A');
+ DHRY_printf ("Ch_1_Glob: %c\n", inst.Ch_1_Glob);
+ DHRY_printf (" should be: %c\n", 'A');
error = 1;
}
if (inst.Ch_2_Glob != 'B')
{
- printf ("Ch_2_Glob: %c\n", inst.Ch_2_Glob);
- printf (" should be: %c\n", 'B');
+ DHRY_printf ("Ch_2_Glob: %c\n", inst.Ch_2_Glob);
+ DHRY_printf (" should be: %c\n", 'B');
error = 1;
}
if (inst.Arr_1_Glob[8] != 7)
{
- printf ("Arr_1_Glob[8]: %d\n", inst.Arr_1_Glob[8]);
- printf (" should be: %d\n", 7);
+ DHRY_printf ("Arr_1_Glob[8]: %d\n", inst.Arr_1_Glob[8]);
+ DHRY_printf (" should be: %d\n", 7);
error = 1;
}
if (inst.Arr_2_Glob[8][7] != Number_Of_Runs + 10)
{
- printf ("Arr_2_Glob[8][7]: %d\n", inst.Arr_2_Glob[8][7]);
- printf (" should be: Number_Of_Runs + 10\n");
+ DHRY_printf ("Arr_2_Glob[8][7]: %d\n", inst.Arr_2_Glob[8][7]);
+ DHRY_printf (" should be: Number_Of_Runs + 10\n");
error = 1;
}
#ifdef VERBOSE
- printf ("Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
- printf (" should be: (implementation-dependent)\n");
+ DHRY_printf ("Ptr_Glob->\n");
+ DHRY_printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
+ DHRY_printf (" should be: (implementation-dependent)\n");
#endif
if (inst.Ptr_Glob->Discr != 0)
{
- printf (" Discr: %d\n", inst.Ptr_Glob->Discr);
- printf (" should be: %d\n", 0);
+ DHRY_printf (" Discr: %d\n", inst.Ptr_Glob->Discr);
+ DHRY_printf (" should be: %d\n", 0);
error = 1;
}
if (inst.Ptr_Glob->variant.var_1.Enum_Comp != 2)
{
- printf (" Enum_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Enum_Comp);
- printf (" should be: %d\n", 2);
+ DHRY_printf (" Enum_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Enum_Comp);
+ DHRY_printf (" should be: %d\n", 2);
error = 1;
}
if (inst.Ptr_Glob->variant.var_1.Int_Comp != 17)
{
- printf (" Int_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Int_Comp);
- printf (" should be: %d\n", 17);
+ DHRY_printf (" Int_Comp: %d\n", inst.Ptr_Glob->variant.var_1.Int_Comp);
+ DHRY_printf (" should be: %d\n", 17);
error = 1;
}
if (strcmp(inst.Ptr_Glob->variant.var_1.Str_Comp, "DHRYSTONE PROGRAM, SOME STRING") != 0)
{
- printf (" Str_Comp: %s\n", inst.Ptr_Glob->variant.var_1.Str_Comp);
- printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
+ DHRY_printf (" Str_Comp: %s\n", inst.Ptr_Glob->variant.var_1.Str_Comp);
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
error = 1;
}
#ifdef VERBOSE
- printf ("Next_Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
- printf (" should be: (implementation-dependent), same as above\n");
+ DHRY_printf ("Next_Ptr_Glob->\n");
+ DHRY_printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
+ DHRY_printf (" should be: (implementation-dependent), same as above\n");
#endif
if (inst.Next_Ptr_Glob->Discr != 0)
{
- printf (" Discr: %d\n", inst.Next_Ptr_Glob->Discr);
- printf (" should be: %d\n", 0);
+ DHRY_printf (" Discr: %d\n", inst.Next_Ptr_Glob->Discr);
+ DHRY_printf (" should be: %d\n", 0);
error = 1;
}
if (inst.Next_Ptr_Glob->variant.var_1.Enum_Comp != 1)
{
- printf (" Enum_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Enum_Comp);
- printf (" should be: %d\n", 1);
+ DHRY_printf (" Enum_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Enum_Comp);
+ DHRY_printf (" should be: %d\n", 1);
error = 1;
}
if (inst.Next_Ptr_Glob->variant.var_1.Int_Comp != 18)
{
- printf (" Int_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Int_Comp);
- printf (" should be: %d\n", 18);
+ DHRY_printf (" Int_Comp: %d\n", inst.Next_Ptr_Glob->variant.var_1.Int_Comp);
+ DHRY_printf (" should be: %d\n", 18);
error = 1;
}
if (strcmp (inst.Next_Ptr_Glob->variant.var_1.Str_Comp, "DHRYSTONE PROGRAM, SOME STRING") != 0)
{
- printf (" Str_Comp: %s\n",
+ DHRY_printf (" Str_Comp: %s\n",
inst.Next_Ptr_Glob->variant.var_1.Str_Comp);
- printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
error = 1;
}
if (Int_1_Loc != 5)
{
- printf ("Int_1_Loc: %d\n", Int_1_Loc);
- printf (" should be: %d\n", 5);
+ DHRY_printf ("Int_1_Loc: %d\n", Int_1_Loc);
+ DHRY_printf (" should be: %d\n", 5);
error = 1;
}
if (Int_2_Loc != 13)
{
- printf ("Int_2_Loc: %d\n", Int_2_Loc);
- printf (" should be: %d\n", 13);
+ DHRY_printf ("Int_2_Loc: %d\n", Int_2_Loc);
+ DHRY_printf (" should be: %d\n", 13);
error = 1;
}
if (Int_3_Loc != 7)
{
- printf ("Int_3_Loc: %d\n", Int_3_Loc);
- printf (" should be: %d\n", 7);
+ DHRY_printf ("Int_3_Loc: %d\n", Int_3_Loc);
+ DHRY_printf (" should be: %d\n", 7);
error = 1;
}
if (Enum_Loc != 1)
{
- printf ("Enum_Loc: %d\n", Enum_Loc);
- printf (" should be: %d\n", 1);
+ DHRY_printf ("Enum_Loc: %d\n", Enum_Loc);
+ DHRY_printf (" should be: %d\n", 1);
error = 1;
}
if (strcmp (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING") != 0)
{
- printf ("Str_1_Loc: %s\n", Str_1_Loc);
- printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
+ DHRY_printf ("Str_1_Loc: %s\n", Str_1_Loc);
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
error = 1;
}
if (strcmp (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING") != 0)
{
- printf ("Str_2_Loc: %s\n", Str_2_Loc);
- printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
+ DHRY_printf ("Str_2_Loc: %s\n", Str_2_Loc);
+ DHRY_printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
error = 1;
}
#endif
if (error)
{
- printf("Error found\n");
+ DHRY_printf("Error found\n");
exit(1);
}
free(inst.Next_Ptr_Glob);
if (User_Time < Too_Small_Time)
{
#ifdef VERBOSE
- printf ("Measured time too small to obtain meaningful results\n");
- printf ("Please increase number of runs\n");
- printf ("\n");
+ DHRY_printf ("Measured time too small to obtain meaningful results\n");
+ DHRY_printf ("Please increase number of runs\n");
+ DHRY_printf ("\n");
#endif
}
else
/ (float) User_Time;
#endif
#ifdef VERBOSE
- printf ("Microseconds for one run through Dhrystone: ");
- printf ("%6.1f \n", Microseconds);
- printf ("Dhrystones per Second: ");
- printf ("%6.1f \n", Dhrystones_Per_Second);
- printf ("\n");
+ DHRY_printf ("Microseconds for one run through Dhrystone: ");
+ DHRY_printf ("%6.1f \n", Microseconds);
+ DHRY_printf ("Dhrystones per Second: ");
+ DHRY_printf ("%6.1f \n", Dhrystones_Per_Second);
+ DHRY_printf ("\n");
#endif
}
@@ -626,30 +652,30 @@ int thread_create ( void *(start_routine)(void*), void* args, pthread_t *thread)
#endif
err = pthread_attr_init(&attr);
if (err) {
- printf("pthread_attr_init failed: (%s)\n", strerror(err));
+ DHRY_printf("pthread_attr_init failed: (%s)\n", strerror(err));
return err;
}
err = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
if (err) {
- printf("pthread_attr_setdetachstate failed: (%s)\n", strerror(err));
+ DHRY_printf("pthread_attr_setdetachstate failed: (%s)\n", strerror(err));
return err;
}
err = pthread_attr_setstacksize(&attr, DEFAULT_STACK_SIZE);
if (err) {
- printf("pthread_attr_setstacksize failed: (%s)\n", strerror(err));
+ DHRY_printf("pthread_attr_setstacksize failed: (%s)\n", strerror(err));
return err;
}
memset(¶m, 0, sizeof(param));
param.sched_priority = max_priority;
err = pthread_attr_setschedparam(&attr, ¶m);
if (err) {
- printf("pthread_attr_setschedparam failed: (%s)\n", strerror(err));
+ DHRY_printf("pthread_attr_setschedparam failed: (%s)\n", strerror(err));
return err;
}
if (err) return err;
err = pthread_create(thread, &attr, start_routine, args);
if (err) {
- printf("pthread_create failed: (%s)\n", strerror(err));
+ DHRY_printf("pthread_create failed: (%s)\n", strerror(err));
return err;
}
if (err) return err;
float result, prevResult = 1;
threadData_t threadData[MAX_THREADS];
- printf ("Dhrystone Benchmark, Version 2.1+Thread (Language: C)\n");
+ DHRY_printf ("Dhrystone Benchmark, Version 2.1+Thread (Language: C)\n");
- printf ("Stage 1: find good iteration count without threads\n");
+ DHRY_printf ("Stage 1: find good iteration count without threads\n");
do {
- printf("Attempting %d iterations\n", iterations);
+ DHRY_printf("Attempting %d iterations\n", iterations);
result = spawn (threadData, iterations, 0);
if (result < 0) {
iterations *= 2;
}
} while (result < 0);
- printf("dhrystones %d, dmips=%i\n", (int)result, (int)(result/1857));
+ DHRY_printf("dhrystones %d, dmips=%i\n", (int)result, (int)(result/1857));
- printf ("Stage 2: find best number of threads\n");
+ DHRY_printf ("Stage 2: find best number of threads\n");
for (threads = 1; threads <= MAX_THREADS; threads *= 2)
{
- printf ("%d iterations * %d threads\n", iterations, threads);
+ DHRY_printf ("%d iterations * %d threads\n", iterations, threads);
result = spawn (threadData, iterations, threads);
- printf("dhrystones %d, dmips=%i\n", (int)result, (int)(result/1857));
+ DHRY_printf("dhrystones %d, dmips=%i\n", (int)result, (int)(result/1857));
if (result/prevResult < 1.2)
{
break;
prevResult = result;
}
- printf("dhrystone benchmark complete\n");
+ DHRY_printf("dhrystone benchmark complete\n");
#ifdef BIOS_POSIX
//BIOS_exit(0);
#endif
#ifdef BIOS_POSIX
+#if defined(SOC_AM572x) || defined(SOC_AM571x) || defined(SOC_K2G) || defined(__ARM_ARCH_7A__)
+ Board_initCfg boardCfg;
+ boardCfg = BOARD_INIT_UNLOCK_MMR
+#ifndef IO_CONSOLE
+ | BOARD_INIT_UART_STDIO
+ | BOARD_INIT_MODULE_CLOCK
+#if !defined(DEVICE_K2E) && !defined(SOC_K2E)
+ | BOARD_INIT_PINMUX_CONFIG
+#endif
+#endif
+ ;
+ Board_init(boardCfg);
if ((err = thread_create(dhryMainThread, NULL, &threadId)))
{
- printf("thread_create failed: %d\n", err);
+ DHRY_printf("thread_create failed: %d\n", err);
}
-
- printf("Starting BIOS...\n");
+#endif
+ DHRY_printf("Starting BIOS...\n");
BIOS_start();
#else
dhryMainThread(NULL);
{
while (l--) *d++ = *s++;
}
-#endif
\ No newline at end of file
+#endif
+
diff --git a/makefile b/makefile
index 47a3c749c3bbbdabac420fa195dd7869198cb0ac..a5db8245fc3636c5bca5869d2be21bab18fba2e4 100644 (file)
--- a/makefile
+++ b/makefile
#### BIOS-side dependencies ####
#BIOS_INSTALL_PATH ?= $(DEPOT)\bios_n_nn_nn_nn
#XDC_INSTALL_PATH ?= $(DEPOT)\xdctools_n_nn_nn_nn_core
+PDK_INSTALL_PATH ?= $(DEPOT)\pdk_am57xx_n_n_n\packages\r
#### BIOS-side toolchains ####
#TOOLCHAIN_PATH_A15 ?= $(DEPOT)\ccsv6\tools\compiler\gcc-arm-none-eabi-n_n-xxxxqn
endif
endif
endif
-dhry.x: bin/$(SOC)/$(CORE)/$(PROFILE)/dhry.out prune
+dhry.x: bin/$(SOC)/$(CORE)/$(PROFILE)/dhry.out
bin/$(SOC)/$(CORE)/$(PROFILE)/dhry.out: $(objs) $(libs) $(CONFIG)/linker.cmd
@$(ECHO) "#"
@$(ECHO) "# Making $@ ..."
$(RMDIR) bin/$(SOC)/$(CORE)/$(PROFILE)/obj
PKGPATH := $(BIOS_INSTALL_PATH)/packages
-PKGPATH := $(PKGPATH)+$(XDC_INSTALL_PATH)/packages
+PKGPATH := $(PKGPATH)+$(XDC_INSTALL_PATH)/packages+$(PDK_INSTALL_PATH)
# ======== install validation ========
ifeq (install,$(MAKECMDGOALS))