OpenCores
no use no use 1/1 no use no use
or1ksim changes
by Unknown on Jan 28, 2004
Not available!
Hi Matjaz! Here's my updates to or1ksim. I touched quite a few places, so bear with me :) The changes are, roughly, the following: Port to Mac OS X. Make or1ksim work on little endian platforms. Some fixes. Allow JTAG write access to read-only memory regions. Added "cm" command to copy data inside memory. Not documented in built-in help yet. Funnily, the files from the /cuc directory had DOS-style line endings. I had to change them to UNIX in oder to create the patch. You might need to do same in order to apply the patch. Patch with patch -p6 chris@asics.ws> + Some Additions by Heiko Panther heiko.panther@web.de> + Brief introduction to using GDB based debugging with or1ksim GDB uses the JTAG proxy server included in or1ksim to communicate *************** *** 178,181 **** # C code starts at 0x1000 ! ---------------------- CUT HERE ------------------------- \ No newline at end of file --- 180,197 ---- # C code starts at 0x1000 ! ---------------------- CUT HERE ------------------------- ! ! ! Setting registers ! ! "info spr" commands give info about special purpose registers, "spr" commands set them. ! "info spr" - display the SPR groups ! "info spr " - display SPRs in ! "info spr " - display value in ! "spr " - set to ! ! Breaking for exceptions ! ! You have to set a bit in the Debug Stop Register "dsr" for each exception you want ! to stop on. Use "spr dsr ". diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/bpb/branch_predict.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/bpb/branch_predict.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/bpb/branch_predict.c Fri Aug 23 10:40:04 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/bpb/branch_predict.c Tue Jan 27 15:40:26 2004 *************** *** 105,111 **** /* Did we find our cached branch? */ if (way >= 0) { /* Yes, we did. */ ! mstats.bpb.hit++; for (i = 0; i = 0) { /* Yes, we did. */ ! or1k_mstats.bpb.hit++; for (i = 0; i = 0) { /* Yes, we did. */ ! mstats.btic.hit++; for (i = 0; i = 0) { /* Yes, we did. */ ! or1k_mstats.btic.hit++; for (i = 0; i Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit 0 ;; + *:Darwin:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/config.sub /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/config.sub *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/config.sub Thu Apr 18 12:20:04 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/config.sub Tue Jan 27 15:41:42 2004 *************** *** 745,751 **** | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \ ! | -superux* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -*linux*) --- 745,751 ---- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \ ! | -superux* | -darwin* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -*linux*) diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/configure.in /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/configure.in *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/configure.in Fri Sep 12 12:17:42 2003 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/configure.in Tue Jan 27 15:42:00 2004 *************** *** 53,63 **** AC_HEADER_STAT AC_HEADER_DIRENT AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat) AC_FUNC_STRCOLL AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \ ! sys/ptem.h sys/pte.h sys/stream.h sys/select.h \ termcap.h termios.h termio.h sys/file.h locale.h\ ! net/ethernet.h) dnl check for "long long" (added by Erez) AC_TRY_COMPILE(,[long long ll; unsigned long long ull;],AC_DEFINE(CC_HAS_LONG_LONG)) --- 53,65 ---- AC_HEADER_STAT AC_HEADER_DIRENT AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat) + AC_CHECK_FUNCS(strndup grantpt unlockpt ptsname on_exit) AC_FUNC_STRCOLL AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \ ! sys/ptem.h sys/pte.h sys/stream.h sys/stropts.h sys/select.h \ termcap.h termios.h termio.h sys/file.h locale.h\ ! net/ethernet.h malloc.h) ! AC_C_BIGENDIAN dnl check for "long long" (added by Erez) AC_TRY_COMPILE(,[long long ll; unsigned long long ull;],AC_DEFINE(CC_HAS_LONG_LONG)) *************** *** 229,235 **** cpu/or1k/Makefile cpu/dlx/Makefile debug/Makefile support/Makefile mmu/Makefile peripheral/Makefile tick/Makefile peripheral/channels/Makefile ! pm/Makefile pic/Makefile vapi/Makefile], [ # Makefile uses this timestamp file to record whether config.h is up to date. echo > stamp-h --- 231,237 ---- cpu/or1k/Makefile cpu/dlx/Makefile debug/Makefile support/Makefile mmu/Makefile peripheral/Makefile tick/Makefile peripheral/channels/Makefile ! pm/Makefile pic/Makefile vapi/Makefile extras/Makefile], [ # Makefile uses this timestamp file to record whether config.h is up to date. echo > stamp-h diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cpu/common/coff.h /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cpu/common/coff.h *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cpu/common/coff.h Fri Jan 4 09:39:37 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cpu/common/coff.h Tue Jan 27 15:42:24 2004 *************** *** 1,3 **** --- 1,7 ---- + #if HAVE_CONFIG_H + #include + #endif + /* This file is derived from the GAS 2.1.4 assembler control file. The GAS product is under the GNU Public License, version 2 or later. As such, this file is also under that license. *************** *** 20,42 **** * and the values loaded from the character positions. It also makes it * nice to have it "endian" independent. */ ! /* Load a short int from the following tables with little-endian formats */ ! #define COFF_SHORT_L(ps) ((short)(((unsigned short)((unsigned char)ps[1]) + #endif + + #ifdef WORDS_BIGENDIAN + #define ELF_SHORT_H + #define ELF_LONG_H + #else /* Load a short int from the following tables with big-endian formats */ #define ELF_SHORT_H(ps) ((((unsigned short)(ps) >> 8) & 0xff) |\ (((unsigned short)(ps) > 8) & 0xff00)|\ (((unsigned long)(ps) insn, "addi") == 0) { signed long temp3, temp2, temp1; --- 368,374 ---- temp4 = temp1; if (temp4 == temp1) ! or1k_mstats.byteadd++; } else if (strcmp(cur->insn, "addi") == 0) { signed long temp3, temp2, temp1; *************** *** 382,388 **** temp4 = temp1; if (temp4 == temp1) ! mstats.byteadd++; } else if (strcmp(cur->insn, "addui") == 0) { unsigned long temp3, temp2, temp1; --- 382,388 ---- temp4 = temp1; if (temp4 == temp1) ! or1k_mstats.byteadd++; } else if (strcmp(cur->insn, "addui") == 0) { unsigned long temp3, temp2, temp1; *************** *** 396,402 **** temp4 = temp1; if (temp4 == temp1) ! mstats.byteadd++; } else if (strcmp(cur->insn, "sub") == 0) { signed long temp3, temp2, temp1; --- 396,402 ---- temp4 = temp1; if (temp4 == temp1) ! or1k_mstats.byteadd++; } else if (strcmp(cur->insn, "sub") == 0) { signed long temp3, temp2, temp1; *************** *** 494,504 **** cur->dependsrc1 = cur->op1; if (eval_operand(cur->op1,&breakpoint) == 0) { pctemp = eval_operand(cur->op2,&breakpoint); ! mstats.beqz.taken++; bpb_update(cur->insn_addr, 1); btic_update(pctemp); } else { ! mstats.beqz.nottaken++; bpb_update(cur->insn_addr, 0); btic_update(pc); } --- 494,504 ---- cur->dependsrc1 = cur->op1; if (eval_operand(cur->op1,&breakpoint) == 0) { pctemp = eval_operand(cur->op2,&breakpoint); ! or1k_mstats.beqz.taken++; bpb_update(cur->insn_addr, 1); btic_update(pctemp); } else { ! or1k_mstats.beqz.nottaken++; bpb_update(cur->insn_addr, 0); btic_update(pc); } *************** *** 508,518 **** cur->dependsrc1 = cur->op1; if (eval_operand(cur->op1,&breakpoint) != 0) { pctemp = eval_operand(cur->op2,&breakpoint); ! mstats.bnez.taken++; bpb_update(cur->insn_addr, 1); btic_update(pctemp); } else { ! mstats.bnez.nottaken++; bpb_update(cur->insn_addr, 0); btic_update(pc); } --- 508,518 ---- cur->dependsrc1 = cur->op1; if (eval_operand(cur->op1,&breakpoint) != 0) { pctemp = eval_operand(cur->op2,&breakpoint); ! or1k_mstats.bnez.taken++; bpb_update(cur->insn_addr, 1); btic_update(pctemp); } else { ! or1k_mstats.bnez.nottaken++; bpb_update(cur->insn_addr, 0); btic_update(pc); } diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cpu/or32/generate.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cpu/or32/generate.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cpu/or32/generate.c Wed Mar 6 10:30:47 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cpu/or32/generate.c Tue Jan 27 15:46:09 2004 *************** *** 131,137 **** int output_function (FILE *fo, const char *func_name, int level) { FILE *fi; ! if ((fi = fopen (in_file, "rt")) == NULL) return 1; while (!feof (fi)) { char line[10000], *str = line; fgets (str, sizeof (line), fi); --- 131,140 ---- int output_function (FILE *fo, const char *func_name, int level) { FILE *fi; ! if ((fi = fopen (in_file, "rt")) == NULL) { ! printf("could not open file\n"); ! return 1; ! }; while (!feof (fi)) { char line[10000], *str = line; fgets (str, sizeof (line), fi); *************** *** 165,170 **** --- 168,174 ---- } SHIFT; } while (olevel); + fclose(fi); return 0; } } *************** *** 174,179 **** --- 178,185 ---- SHIFT; fprintf (fo, "%s ();\n", func_name); level--; SHIFT; fprintf (fo, "}"); + + fclose(fi); return 0; } *************** *** 270,276 **** level--; SHIFT; fprintf (fo, "}\n"); if (write_to_reg) { ! SHIFT; fprintf (fo, "reg[0] = 0; /* Repair in case we changed it */\n", i); } level--; SHIFT; fprintf (fo, "}"); --- 276,282 ---- level--; SHIFT; fprintf (fo, "}\n"); if (write_to_reg) { ! SHIFT; fprintf (fo, "reg[0] = 0; /* Repair in case we changed it */\n"); } level--; SHIFT; fprintf (fo, "}"); *************** *** 343,353 **** fprintf (fo, "\n"); SHIFT; fprintf (fo, "/* Not unique: real mask %08x and current mask %08x differ - do final check */\n", ti.insn_mask, cur_mask); SHIFT; fprintf (fo, "if ((insn & 0x%08x) == 0x%08x) ", ti.insn_mask, ti.insn); ! output_call (fo, i, level); fprintf (fo, " else "); ! if (output_call (fo, -1, level)) return 1; } else { ! output_call (fo, i, level - 1); } fprintf (fo, " break;\n"); } --- 349,359 ---- fprintf (fo, "\n"); SHIFT; fprintf (fo, "/* Not unique: real mask %08x and current mask %08x differ - do final check */\n", ti.insn_mask, cur_mask); SHIFT; fprintf (fo, "if ((insn & 0x%08x) == 0x%08x) ", ti.insn_mask, ti.insn); ! if (output_call (fo, i, level)) return 1; // Fail fprintf (fo, " else "); ! if (output_call (fo, -1, level)) return 1; // Fail } else { ! if (output_call (fo, i, level - 1)) return 1; // Fail } fprintf (fo, " break;\n"); } diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cpu/or32/insnset.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cpu/or32/insnset.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cpu/or32/insnset.c Tue Jul 1 22:07:01 2003 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cpu/or32/insnset.c Tue Jan 27 15:46:32 2004 *************** *** 39,45 **** temp4 = temp1; if (temp4 == temp1) ! mstats.byteadd++; } INSTRUCTION (l_addc) { signed long temp1, temp2, temp3; --- 39,45 ---- temp4 = temp1; if (temp4 == temp1) ! or1k_mstats.byteadd++; } INSTRUCTION (l_addc) { signed long temp1, temp2, temp3; *************** *** 62,68 **** temp4 = temp1; if (temp4 == temp1) ! mstats.byteadd++; } INSTRUCTION (l_sw) { int old_cyc = 0; --- 62,68 ---- temp4 = temp1; if (temp4 == temp1) ! or1k_mstats.byteadd++; } INSTRUCTION (l_sw) { int old_cyc = 0; *************** *** 227,233 **** if (config.bpb.enabled) { int fwd = (eval_operand32(0, &breakpoint) >= pc) ? 1 : 0; IFF (config.cpu.dependstats) current->func_unit = it_branch; ! mstats.bf[flag][fwd]++; bpb_update(current->insn_addr, flag); } if (flag) { --- 227,233 ---- if (config.bpb.enabled) { int fwd = (eval_operand32(0, &breakpoint) >= pc) ? 1 : 0; IFF (config.cpu.dependstats) current->func_unit = it_branch; ! or1k_mstats.bf[flag][fwd]++; bpb_update(current->insn_addr, flag); } if (flag) { *************** *** 242,248 **** if (config.bpb.enabled) { int fwd = (eval_operand32(0, &breakpoint) >= pc) ? 1 : 0; IFF (config.cpu.dependstats) current->func_unit = it_branch; ! mstats.bnf[!flag][fwd]++; bpb_update(current->insn_addr, flag == 0); } if (flag == 0) { --- 242,248 ---- if (config.bpb.enabled) { int fwd = (eval_operand32(0, &breakpoint) >= pc) ? 1 : 0; IFF (config.cpu.dependstats) current->func_unit = it_branch; ! or1k_mstats.bnf[!flag][fwd]++; bpb_update(current->insn_addr, flag == 0); } if (flag == 0) { diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cuc/adv.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cuc/adv.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cuc/adv.c Thu Aug 8 10:50:05 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cuc/adv.c Tue Jan 27 15:46:47 2004 *************** *** 41,47 **** static unsigned long mask (unsigned long c) { ! if (c) return (1 = 0); --- 48,55 ---- 1, 1}; /* returns log2(x) */ ! /* Call this log2_int, because there is a library function named log2 */ ! int log2_int (unsigned long x) { int c = 0; assert (x >= 0); diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cuc/cuc.h /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cuc/cuc.h *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cuc/cuc.h Wed Jan 28 09:18:56 2004 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cuc/cuc.h Wed Jan 28 09:18:24 2004 *************** *** 209,217 **** extern FILE *flog; /* returns log2(x) */ ! /* ! int log2 (unsigned long x); ! */ /* Loads from file into global array insn */ int cuc_load (char *in_fn); --- 209,215 ---- extern FILE *flog; /* returns log2(x) */ ! int log2_int (unsigned long x); /* Loads from file into global array insn */ int cuc_load (char *in_fn); diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cuc/verilog.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cuc/verilog.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/cuc/verilog.c Wed Jan 28 09:18:51 2004 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/cuc/verilog.c Wed Jan 28 09:18:20 2004 *************** *** 253,259 **** if (!co) GEN ("/* NONE */"); if (f->nfdeps) { GEN ("\n/* f. calls */, fstart_o, %sfend_i, fr11_i, ", ! log2 (f->nfdeps) > 0 ? "fid_o, " : ""); for (i = 0; i nfdeps) { GEN ("\n/* f. calls */, fstart_o, %sfend_i, fr11_i, ", ! log2_int (f->nfdeps) > 0 ? "fid_o, " : ""); for (i = 0; i nfdeps) > 0) GEN ("output [%i:0] fid_o;\n", log2(f->nfdeps)); GEN ("output fstart_o;\n"); GEN ("input fend_i;\n"); } --- 308,314 ---- for (i = 1; i nfdeps) > 0) GEN ("output [%i:0] fid_o;\n", log2_int(f->nfdeps)); GEN ("output fstart_o;\n"); GEN ("input fend_i;\n"); } *************** *** 650,656 **** GEN (" if (rst) begin\n"); GEN (" f_stb nfdeps)); GEN (" fstart_o nfdeps)); GEN (" fstart_o nfdeps)) ! GEN (" fid_o nfdeps), func_index (f, f->msched)); for (j = 0; j nfdeps)) ! GEN (" fid_o nfdeps), func_index (f, f->msched)); for (j = 0; j 0 ? " or " : "", t); GEN (")\n"); for (i = 0; i 0 ? " or " : "", t); GEN (")\n"); for (i = 0; i tmp); for (j = 0, first = 1; j nfdeps; j++) if (f->fdeps[j]) GEN (", "); --- 966,981 ---- /* start/end signals */ GEN ("\n\n/* start/end signals */\n"); for (i = 0; i tmp); for (j = 0, first = 1; j nfdeps; j++) if (f->fdeps[j]) GEN (", "); diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/debug/debug_unit.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/debug/debug_unit.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/debug/debug_unit.c Sat Apr 12 05:02:36 2003 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/debug/debug_unit.c Tue Jan 27 15:51:36 2004 *************** *** 207,213 **** int DebugGetRegister(unsigned int address, unsigned long* data) { ! int err; #ifdef DEBUG_JTAG PRINTF("Debug get register %x\n",address); fflush(stdout); --- 207,213 ---- int DebugGetRegister(unsigned int address, unsigned long* data) { ! int err=0; #ifdef DEBUG_JTAG PRINTF("Debug get register %x\n",address); fflush(stdout); *************** *** 223,235 **** break; case JTAG_CHAIN_TRACE: *data = 0; /* Scan chain not yet implemented */ - err = 0; break; case JTAG_CHAIN_DEVELOPMENT: err = get_devint_reg(address,data); break; case JTAG_CHAIN_WISHBONE: ! err = GetWishboneMemory(address,data); break; } #ifdef DEBUG_JTAG --- 223,234 ---- break; case JTAG_CHAIN_TRACE: *data = 0; /* Scan chain not yet implemented */ break; case JTAG_CHAIN_DEVELOPMENT: err = get_devint_reg(address,data); break; case JTAG_CHAIN_WISHBONE: ! err = debug_get_mem(address,data); break; } #ifdef DEBUG_JTAG *************** *** 241,247 **** int DebugSetRegister(unsigned int address,unsigned long data) { ! int err; #ifdef DEBUG_JTAG PRINTF("Debug set register %x lampret@opencores.org + # + # This file is part of OpenRISC 1000 Architectural Simulator. + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + # + + noinst_LIBRARIES = libextras.a + libextras_a_SOURCES = extras.c diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/extras/Makefile.in /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/extras/Makefile.in *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/extras/Makefile.in Thu Jan 1 01:00:00 1970 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/extras/Makefile.in Tue Jan 27 16:15:08 2004 *************** *** 0 **** --- 1,332 ---- + # Makefile.in generated by automake 1.6.3 from Makefile.am. + # @configure_input@ + + # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + # Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + @SET_MAKE@ + + # Makefile -- Makefile for cpu architecture independent simulation + # Copyright (C) 1999 Damjan Lampret, lampret@opencores.org + # + # This file is part of OpenRISC 1000 Architectural Simulator. + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + # + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + top_builddir = .. + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ + install_sh_DATA = $(install_sh) -c -m 644 + install_sh_PROGRAM = $(install_sh) -c + install_sh_SCRIPT = $(install_sh) -c + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + INSTALL_HEADER = $(INSTALL_DATA) + transform = @program_transform_name@ + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + build_alias = @build_alias@ + build_triplet = @build@ + host_alias = @host_alias@ + host_triplet = @host@ + target_alias = @target_alias@ + target_triplet = @target@ + + EXEEXT = @EXEEXT@ + OBJEXT = @OBJEXT@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + AMTAR = @AMTAR@ + AR = @AR@ + ARFLAGS = @ARFLAGS@ + AWK = @AWK@ + BUILD_DIR = @BUILD_DIR@ + CC = @CC@ + CFLAGS = @CFLAGS@ + CPU_ARCH = @CPU_ARCH@ + DEPDIR = @DEPDIR@ + INCLUDES = @INCLUDES@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + LOCAL_CFLAGS = @LOCAL_CFLAGS@ + LOCAL_DEFS = @LOCAL_DEFS@ + LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ + MAKE_SHELL = @MAKE_SHELL@ + PACKAGE = @PACKAGE@ + RANLIB = @RANLIB@ + STRIP = @STRIP@ + SUMVERSION = @SUMVERSION@ + TERMCAP_LIB = @TERMCAP_LIB@ + VERSION = @VERSION@ + am__include = @am__include@ + am__quote = @am__quote@ + host = @host@ + host_cpu = @host_cpu@ + host_os = @host_os@ + install_sh = @install_sh@ + + noinst_LIBRARIES = libextras.a + libextras_a_SOURCES = extras.c + subdir = extras + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h + CONFIG_CLEAN_FILES = + LIBRARIES = $(noinst_LIBRARIES) + + libextras_a_AR = $(AR) cru + libextras_a_LIBADD = + am_libextras_a_OBJECTS = extras.$(OBJEXT) + libextras_a_OBJECTS = $(am_libextras_a_OBJECTS) + + DEFS = @DEFS@ + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) + CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + depcomp = $(SHELL) $(top_srcdir)/depcomp + am__depfiles_maybe = depfiles + @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/extras.Po + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + CCLD = $(CC) + LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + DIST_SOURCES = $(libextras_a_SOURCES) + DIST_COMMON = Makefile.am Makefile.in + SOURCES = $(libextras_a_SOURCES) + + all: all-am + + .SUFFIXES: + .SUFFIXES: .c .o .obj + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu extras/Makefile + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + + clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + libextras.a: $(libextras_a_OBJECTS) $(libextras_a_DEPENDENCIES) + -rm -f libextras.a + $(libextras_a_AR) libextras.a $(libextras_a_OBJECTS) $(libextras_a_LIBADD) + $(RANLIB) libextras.a + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + + distclean-compile: + -rm -f *.tab.c + + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extras.Po@am__quote@ + + distclean-depend: + -rm -rf ./$(DEPDIR) + + .c.o: + @AMDEP_TRUE@ source='$n) len=n; + + char *new = (char *) malloc (len + 1); + + if (new == NULL) + return NULL; + + new[len] = ''; + return (char *) memcpy (new, s, len); + } + + #endif diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/extras/extras.h /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/extras/extras.h *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/extras/extras.h Thu Jan 1 01:00:00 1970 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/extras/extras.h Tue Jan 27 16:15:08 2004 *************** *** 0 **** --- 1,10 ---- + #ifndef __STRNDUP__ + #define __STRNDUP__ + + #include "stdlib.h" + + #if !defined(HAVE_STRNDUP) + char * strndup (const char *s, size_t n); + #endif + + #endif \ No newline at end of file diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/mprofiler.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/mprofiler.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/mprofiler.c Fri Aug 23 10:38:34 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/mprofiler.c Tue Jan 27 15:52:40 2004 *************** *** 20,27 **** /* Command line utility, that displays profiling information, generated by or1ksim. (use --mprofile option at command line, when running or1ksim. */ #include ! #include #include "support/profile.h" #include "mprofiler.h" #include "sim-config.h" --- 20,33 ---- /* Command line utility, that displays profiling information, generated by or1ksim. (use --mprofile option at command line, when running or1ksim. */ + #if HAVE_CONFIG_H + #include + #endif + #include ! #if HAVE_MALLOC_H ! #include /* calloc, free */ ! #endif #include "support/profile.h" #include "mprofiler.h" #include "sim-config.h" diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/channel.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/channel.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/channel.c Sun Mar 30 03:42:07 2003 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/channel.c Tue Jan 27 15:53:05 2004 *************** *** 19,31 **** --- 19,43 ---- along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #if HAVE_CONFIG_H + #include + #endif + #define _GNU_SOURCE /* for strndup */ #include /* perror */ #include /* exit */ + + #if HAVE_MALLOC_H #include /* calloc, free */ + #endif + #include /* strndup, strcmp, strlen, strchr */ #include /* errno */ + + #ifndef HAVE_STRNDUP + #include "extras/extras.h" + #endif #include "channel.h" diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/fd.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/fd.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/fd.c Fri Oct 25 19:41:09 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/fd.c Tue Jan 27 15:53:14 2004 *************** *** 19,30 **** --- 19,36 ---- along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #if HAVE_CONFIG_H + #include + #endif + #include /* struct timeval */ #include /* fd_set */ #include /* perror */ #include /* atoi */ #include /* read, write, select */ + #if HAVE_MALLOC_H #include /* calloc, free */ + #endif #include /* strchr */ #include /* errno */ diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/file.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/file.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/file.c Fri Oct 25 19:41:09 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/file.c Tue Jan 27 15:53:21 2004 *************** *** 19,30 **** along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define _GNU_SOURCE /* for strndup */ #include /* open() */ #include /* open() */ #include /* open() */ ! #include /* calloc(), free() */ #include /* strndup(), strchr() */ #include /* errno */ #include /* close() */ --- 19,36 ---- along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + #if HAVE_CONFIG_H + #include + #endif + #define _GNU_SOURCE /* for strndup */ #include /* open() */ #include /* open() */ #include /* open() */ ! #if HAVE_MALLOC_H ! #include /* calloc, free */ ! #endif #include /* strndup(), strchr() */ #include /* errno */ #include /* close() */ diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/generic.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/generic.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/generic.c Fri Oct 25 19:41:09 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/generic.c Tue Jan 27 15:53:27 2004 *************** *** 19,25 **** along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ ! #include /* free */ #include /* errno */ --- 19,32 ---- along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ ! #if HAVE_CONFIG_H ! #include ! #endif ! ! #if HAVE_MALLOC_H ! #include /* calloc, free */ ! #endif ! #include /* errno */ diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/xterm.c /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/xterm.c *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/peripheral/channels/xterm.c Sat Apr 12 04:52:10 2003 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/peripheral/channels/xterm.c Tue Jan 27 15:54:39 2004 *************** *** 26,31 **** --- 26,35 ---- * They are suppose to be reserved for the compiler * as explained in C standards. */ + #if HAVE_CONFIG_H + #include + #endif + #define _XOPEN_SOURCE /* grantpt() and al. */ #define _GNU_SOURCE /* on_exit */ *************** *** 38,44 **** --- 42,50 ---- #include /* strchr() */ #ifndef __CYGWIN__ + #if HAVE_SYS_STROPTS_H #include /* grantpt(), unlockpt() */ + #endif #include /* basename() */ #endif /* __CYGWIN__ */ *************** *** 109,117 **** retval->fds.fdin = -1; retval->fds.fdout = -1; retval->pid = -1; /* reset cause exit(1), leaving an xterm opened */ on_exit(xterm_exit, retval); ! i = 2; arglist = (char*)input; retval->argv = malloc(sizeof(char*) * MAX_XTERM_ARGS); --- 115,126 ---- retval->fds.fdin = -1; retval->fds.fdout = -1; retval->pid = -1; + + #if defined(HAS_ON_EXIT) /* reset cause exit(1), leaving an xterm opened */ on_exit(xterm_exit, retval); ! #endif ! i = 2; arglist = (char*)input; retval->argv = malloc(sizeof(char*) * MAX_XTERM_ARGS); *************** *** 136,141 **** --- 145,151 ---- static int xterm_open(void * data) { + #if defined(HAS_GRANTPT) && defined(HAS_UNLOCKPT) && defined(HAS_PTSNAME) struct xterm_channel * xt = data; int master, retval; char * slavename; *************** *** 166,172 **** xt->fds.fdout = xt->fds.fdin = open(slavename, O_RDWR); if(xt->fds.fdout fds.fdin, I_PUSH, "ptem"); if(retval fds.fdout = xt->fds.fdin = open(slavename, O_RDWR); if(xt->fds.fdout fds.fdin, TRUNCATED
or1ksim changes
by Unknown on Jan 30, 2004
Not available!
Heiko Panther heiko.panther@web.de> writes:
Hi Matjaz!

Here's my updates to or1ksim. I touched quite a few places, so bear
with me :) The changes are, roughly, the following:

Port to Mac OS X.
Make or1ksim work on little endian platforms.
Some fixes.
Allow JTAG write access to read-only memory regions.
Added "cm" command to copy data inside memory. Not documented in
built-in help yet.

Funnily, the files from the /cuc directory had DOS-style line
endings. I had to change them to UNIX in oder to create the patch. You
might need to do same in order to apply the patch. Patch with

patch -p6
from the directory containing or1ksim. Be sure to do automake,
autoconf, configure since I added a directory.

I tested the changes under Redhat Linux 7.0 on my x86 box too.

If you'd like to discuss the stuff I changed, join me on #opencores!
Also for gcc-related discussion :)

Heiko
Why not just get the current version of cvs version of config.sub and config.guess out of GNU cvs[1]? Jim [1] http://savannah.gnu.org/cvs/?group=config
diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/config.guess /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/config.guess *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/config.guess Thu Aug 29 12:26:52 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/config.guess Tue Jan 27 15:41:30 2004 *************** *** 883,888 **** --- 883,895 ---- # says Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit 0 ;; + *:Darwin:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -Ncr /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/config.sub /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/config.sub *** /Users/hpanther/DevCurrent/OR1000/or1ksim-clean/or1ksim/config.sub Thu Apr 18 12:20:04 2002 --- /Users/hpanther/DevCurrent/OR1000/or1ksim-changed/or1ksim/config.sub Tue Jan 27 15:41:42 2004 *************** *** 745,751 **** | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \ ! | -superux* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -*linux*) --- 745,751 ---- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \ ! | -superux* | -darwin* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -*linux*)



or1ksim changes
by Unknown on Jan 31, 2004
Not available!

Why not just get the current version of cvs version of config.sub and config.guess out of GNU cvs[1]? [1] http://savannah.gnu.org/cvs/?group=config

Will do. To tell the truth, I was looking for an official source for
these scripts, but couldn't find any.

Thanks-
Heiko

or1ksim changes
by Unknown on Feb 1, 2004
Not available!
Heiko Panther heiko.panther@web.de> writes:
> Why not just get the current version of cvs version of config.sub and > config.guess out of GNU cvs[1]? > [1] http://savannah.gnu.org/cvs/?group=config >
Will do. To tell the truth, I was looking for an official source for these scripts, but couldn't find any. Thanks- Heiko _______________________________________________ http://www.opencores.org/mailman/listinfo/openrisc


The official source is ftp.gnu.org/gnu/config . However, copies of these
files have not made it there since the cracks on the GNU servers. So,
the cvs copy is the official source of those files.

Jim

no use no use 1/1 no use no use
© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.