OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openmsp430/trunk/core/sim/rtl_sim/src-c/coremark_v1.0
    from Rev 202 to Rev 211
    Reverse comparison

Rev 202 → Rev 211

/msp430/copydata.c File deleted
/msp430/linker.msp430.x
5,12 → 5,8
sfr : ORIGIN = 0x0000, LENGTH = 0x0010
peripheral_8bit : ORIGIN = 0x0010, LENGTH = 0x00f0
peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100
 
/* ram (wx) : ORIGIN = 0x0200, LENGTH = 0x2800 /* 10kB */
/* rom (rx) : ORIGIN = 0x4000, LENGTH = 0xC000-0x20 /* 48kB */
 
ram (wx) : ORIGIN = 0x0200, LENGTH = 0x1400 /* 5kB */
rom (rx) : ORIGIN = 0x2800, LENGTH = 0xD800-0x20 /* 54kB */
ram (wx) : ORIGIN = 0x0200, LENGTH = 0x2800 /* 10kB */
rom (rx) : ORIGIN = 0x4000, LENGTH = 0xC000-0x20 /* 48kB */
vectors : ORIGIN = 0xffe0, LENGTH = 0x0020
}
REGION_ALIAS("REGION_TEXT", rom);
/msp430/omsp_func.h
40,7 → 40,8
//----------------------------------------------------------
// SPECIAL FUNCTION REGISTERS
//----------------------------------------------------------
#define IE1 (*(volatile unsigned char *) 0x0000)
#define IE1_set_wdtie() __asm__ __volatile__ ("bis.b #0x01, &0x0000")
//#define IE1 (*(volatile unsigned char *) 0x0000)
#define IFG1 (*(volatile unsigned char *) 0x0002)
 
#define CPU_ID_LO (*(volatile unsigned char *) 0x0004)
/msp430/linker.msp430-elf.x
41,10 → 41,8
SFR : ORIGIN = 0x0000, LENGTH = 0x0010
PERIPHERAL_8BIT : ORIGIN = 0x0010, LENGTH = 0x00F0
PERIPHERAL_16BIT : ORIGIN = 0x0100, LENGTH = 0x0100
/* RAM : ORIGIN = 0x0200, LENGTH = 0x2800 /* 10kB */
/* ROM (rx) : ORIGIN = 0x4000, LENGTH = 0xC000-0x20 /* 48kB */
RAM : ORIGIN = 0x0200, LENGTH = 0x1400 /* 5kB */
ROM (rx) : ORIGIN = 0x2800, LENGTH = 0xD800-0x20 /* 54kB */
RAM : ORIGIN = 0x0200, LENGTH = 0x2800 /* 10kB */
ROM (rx) : ORIGIN = 0x4000, LENGTH = 0xC000-0x20 /* 48kB */
VECT1 : ORIGIN = 0xFFE0, LENGTH = 0x0002
VECT2 : ORIGIN = 0xFFE2, LENGTH = 0x0002
VECT3 : ORIGIN = 0xFFE4, LENGTH = 0x0002
/msp430/core_portme.mak
33,7 → 33,7
 
# Flag : PORT_SRCS
# Port specific source files can be added here
PORT_SRCS = $(PORT_DIR)/core_portme.c $(PORT_DIR)/omsp_func.c $(PORT_DIR)/copydata.c
PORT_SRCS = $(PORT_DIR)/core_portme.c $(PORT_DIR)/omsp_func.c $(PORT_DIR)/mylib/copydata.c $(PORT_DIR)/mylib/cprintf.c
 
# Flag : LOAD
# For a simple port, we assume self hosted compile and run, no load needed.
/msp430/omsp_func.c
39,7 → 39,8
// putChar function //
// (Send a byte to the Port-1) //
//--------------------------------------------------//
int putchar (int txdata) {
//int putchar (int txdata) {
int tty_putc (int txdata) {
 
// Write the output character to the Port-1
P1OUT = txdata;
/msp430/mylib/copydata.c
0,0 → 1,15
#include <stdint.h>
#include <string.h>
 
extern char __datastart;
extern char __romdatastart;
extern char __romdatacopysize;
static void* const datastart=&__datastart;
static void* const romdatastart=&__romdatastart;
static uint16_t const romdatacopysize=(uint16_t)&__romdatacopysize;
 
__attribute__((constructor)) void __data_move() {
if (datastart!=romdatastart) {
memmove(datastart,romdatastart,romdatacopysize);
}
}
/msp430/mylib/cprintf.c
0,0 → 1,158
#include <stdarg.h>
 
#include "cprintf.h"
 
typedef unsigned char byte;
 
static char hex[] = "0123456789abcdef";
 
void
cput_nibble (int n)
{
tty_putc (hex[n&0x0f]);
}
 
void
cput_hex_byte (int n)
{
cput_nibble (n >> 4);
cput_nibble (n);
}
 
void
cput_binary_byte (int n)
{
int i;
for (i=7; i>=0; i--)
tty_putc((n & (1<<i)) ? '1' : '0');
}
 
void
cput_hex_word (int n)
{
cput_hex_byte (n >> 8);
cput_hex_byte (n);
}
 
void
cput_hex_long (long int n)
{
cput_hex_byte (n >> 24);
cput_hex_byte (n >> 16);
cput_hex_byte (n >> 8);
cput_hex_byte (n);
}
 
void
cput_hex_block (char *block, int n)
{
int i = 0;
while (n)
{
cput_hex_byte (*block++);
if (--n == 0)
break;
i++;
if ((i & 7) == 0)
tty_putc (' ');
else
tty_putc (':');
}
}
 
void
cput_nibble_block (char *block, int n)
{
int i = 0;
while (n)
{
cput_nibble (*block);
if (--n == 0)
break;
i++;
if ((i & 7) == 0)
tty_putc (' ');
}
}
 
void
cput_number (int n)
{
char buf[20];
int i = 0;
if (n < 0)
{
tty_putc ('-');
n = -n;
}
while (n > 9)
{
buf[i++] = (n%10) + '0';
n /= 10;
}
buf[i++] = (n%10) + '0';
while (i > 0)
tty_putc (buf[--i]);
}
 
void
cprintf (const char *fmt, ...)
{
va_list v;
int i;
char *s;
 
va_start (v, fmt);
 
while (*fmt)
{
if (*fmt != '%')
tty_putc (*fmt);
else
switch (*++fmt)
{
case '%':
tty_putc ('%');
break;
case 'c':
i = va_arg (v, int);
tty_putc(i);
break;
case 'd':
i = va_arg (v, int);
cput_number(i);
break;
case 'b':
i = va_arg (v, int);
cput_hex_byte (i);
break;
case 'B':
i = va_arg (v, int);
cput_binary_byte (i);
break;
case 'w':
i = va_arg (v, int);
cput_hex_word (i);
break;
case 'l':
i = va_arg (v, int);
cput_hex_long (i);
break;
case 'x':
s = va_arg (v, char *);
i = va_arg (v, int);
cput_hex_block (s, i);
break;
case 'n':
s = va_arg (v, char *);
i = va_arg (v, int);
cput_nibble_block (s, i);
break;
case 's':
s = va_arg (v, char *);
tty_putc (s);
break;
}
fmt ++;
}
}
/msp430/mylib/cprintf.h
0,0 → 1,158
void cprintf(const char *, ...);
/coremark.h
1,21 → 1,21
/*
Author : Shay Gal-On, EEMBC
 
This file is part of EEMBC(R) and CoreMark(TM), which are Copyright (C) 2009
All rights reserved.
This file is part of EEMBC(R) and CoreMark(TM), which are Copyright (C) 2009
All rights reserved.
 
EEMBC CoreMark Software is a product of EEMBC and is provided under the terms of the
CoreMark License that is distributed with the official EEMBC COREMARK Software release.
If you received this EEMBC CoreMark Software without the accompanying CoreMark License,
you must discontinue use and download the official release from www.coremark.org.
CoreMark License that is distributed with the official EEMBC COREMARK Software release.
If you received this EEMBC CoreMark Software without the accompanying CoreMark License,
you must discontinue use and download the official release from www.coremark.org.
 
Also, if you are publicly displaying scores generated from the EEMBC CoreMark software,
Also, if you are publicly displaying scores generated from the EEMBC CoreMark software,
make sure that you are in compliance with Run and Reporting rules specified in the accompanying readme.txt file.
 
EEMBC
EEMBC
4354 Town Center Blvd. Suite 114-200
El Dorado Hills, CA, 95762
*/
El Dorado Hills, CA, 95762
*/
/* Topic: Description
This file contains declarations of the various benchmark functions.
*/
23,7 → 23,7
/* Configuration: TOTAL_DATA_SIZE
Define total size for data algorithms will operate on
*/
#ifndef TOTAL_DATA_SIZE
#ifndef TOTAL_DATA_SIZE
#define TOTAL_DATA_SIZE 2*1000
#endif
 
41,7 → 41,7
#include <stdio.h>
#endif
#if HAS_PRINTF
#define ee_printf printf
#define ee_printf cprintf
#endif
 
/* Actual benchmark execution in iterate */
48,7 → 48,7
void *iterate(void *pres);
 
/* Typedef: secs_ret
For machines that have floating point support, get number of seconds as a double.
For machines that have floating point support, get number of seconds as a double.
Otherwise an unsigned int.
*/
#if HAS_FLOAT
58,12 → 58,12
#endif
 
#if MAIN_HAS_NORETURN
#define MAIN_RETURN_VAL
#define MAIN_RETURN_VAL
#define MAIN_RETURN_TYPE void
#else
#define MAIN_RETURN_VAL 0
#define MAIN_RETURN_TYPE int
#endif
#endif
 
void start_time(void);
void stop_time(void);
130,7 → 130,7
NUM_CORE_STATES
} core_state_e ;
 
 
/* Helper structure to hold results */
typedef struct RESULTS_S {
/* inputs */
165,10 → 165,9
 
/* state benchmark functions */
void core_init_state(ee_u32 size, ee_s16 seed, ee_u8 *p);
ee_u16 core_bench_state(ee_u32 blksize, ee_u8 *memblock,
ee_u16 core_bench_state(ee_u32 blksize, ee_u8 *memblock,
ee_s16 seed1, ee_s16 seed2, ee_s16 step, ee_u16 crc);
 
/* matrix benchmark functions */
ee_u32 core_init_matrix(ee_u32 blksize, void *memblk, ee_s32 seed, mat_params *p);
ee_u16 core_bench_matrix(mat_params *p, ee_s16 seed, ee_u16 crc);
 
/coremark_v1.0.v
59,14 → 59,14
// Check CPU configuration
//---------------------------------------
 
if ((`PMEM_SIZE !== 55296) || (`DMEM_SIZE !== 5120))
if ((`PMEM_SIZE !== 49152) || (`DMEM_SIZE !== 10240))
begin
$display(" ===============================================");
$display("| SIMULATION ERROR |");
$display("| |");
$display("| Core must be configured for: |");
$display("| - 54kB program memory |");
$display("| - 5kB data memory |");
$display("| - 48kB program memory |");
$display("| - 10kB data memory |");
$display(" ===============================================");
$finish;
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.