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/msp430
    from Rev 200 to Rev 211
    Reverse comparison

Rev 200 → Rev 211

/copydata.c File deleted
/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);
/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)
/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
/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.
/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;
/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);
}
}
/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 ++;
}
}
/mylib/cprintf.h
0,0 → 1,158
void cprintf(const char *, ...);

powered by: WebSVN 2.1.0

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