From 6bb0d30e1b65000c99b44bea21b898a2c5f2bf85 Mon Sep 17 00:00:00 2001 From: Jean-Yves Lefort Date: Sun, 19 Mar 2006 22:43:05 +0000 Subject: Add gpsim. gpsim is a full-featured software simulator for Microchip PIC microcontrollers distributed under the GNU General Public License. gpsim has been designed to be as accurate as possible. Accuracy includes the entire PIC - from the core to the I/O pins and including ALL of the internal peripherals. Thus it's possible to create stimuli and tie them to the I/O pins and test the PIC the same PIC the same way you would in the real world. gpsim has been designed to be as fast as possible. Real time simulation speeds of 20Mhz pics are possible. A 'goto $' program runs at the same speed as a 25Mhz pic when simulated on my 400Mhz PII Linux Box. Of course, as you add stimuli and begin interacting with peripherals, the performance drops. But it's still fast! gpsim has been designed to be as useful as possible (at least that's the intent - honest). The standard simulation paradigm including breakpoints, single stepping, disassembling, memory inspect & change, and so on has been implemented. In addition, gpsim supports many debugging features that are only available with in-circuit emulators. For example, a continuous trace buffer tracks every action of the simulator (whether you want it or not). Also, it's possible to set read and write break points on values (e.g. break if a specific value is read from or written to a register). WWW: http://www.dattalo.com/gnupic/gpsim.html PR: ports/94436 Submitted by: Jose Alonso Cardenas Marquez --- devel/Makefile | 1 + devel/gpsim/Makefile | 47 +++++++ devel/gpsim/distinfo | 3 + devel/gpsim/files/4patch-cli_input.cc | 32 +++++ devel/gpsim/files/patch-src_os__dependent.cc | 11 ++ devel/gpsim/pkg-descr | 24 ++++ devel/gpsim/pkg-plist | 183 +++++++++++++++++++++++++++ 7 files changed, 301 insertions(+) create mode 100644 devel/gpsim/Makefile create mode 100644 devel/gpsim/distinfo create mode 100644 devel/gpsim/files/4patch-cli_input.cc create mode 100644 devel/gpsim/files/patch-src_os__dependent.cc create mode 100644 devel/gpsim/pkg-descr create mode 100644 devel/gpsim/pkg-plist diff --git a/devel/Makefile b/devel/Makefile index 84a5aabfb20d..3ce2d3b39104 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -349,6 +349,7 @@ SUBDIR += gorm SUBDIR += gpc SUBDIR += gperf + SUBDIR += gpsim SUBDIR += gputils SUBDIR += gsoap SUBDIR += gstreamer-plugins-gconf diff --git a/devel/gpsim/Makefile b/devel/gpsim/Makefile new file mode 100644 index 000000000000..a537bd2d763e --- /dev/null +++ b/devel/gpsim/Makefile @@ -0,0 +1,47 @@ +# New ports collection makefile for: gpsim +# Date created: 2006-03-13 +# Whom: Jose Alonso Cardenas Marquez +# +# $FreeBSD$ +# + +PORTNAME= gpsim +PORTVERSION= 0.21.11 +CATEGORIES= devel +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} + +MAINTAINER= acardenas@bsd.org.pe +COMMENT= A software simulator for Microchip PIC microcontrollers + +LIB_DEPENDS= popt.0:${PORTSDIR}/devel/popt \ + gtkextra-x11-2.0.1:${PORTSDIR}/x11-toolkits/gtkextra2 +RUN_DEPENDS= gpasm:${PORTSDIR}/devel/gputils + +USE_X_PREFIX= yes +GNU_CONFIGURE= yes +USE_GCC= 3.4+ +INSTALLS_SHLIB= yes +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" +CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} + +.include + +.if ${OSVERSION} < 500000 +EXTRA_PATCHES= ${FILESDIR}/4patch-* +.endif + +post-install: +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +.for FILE in AUTHORS ChangeLog PROCESSORS README* doc/gpsim.pdf + ${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR} +.endfor +.endif + + ${MKDIR} ${EXAMPLESDIR} + cd ${WRKSRC}/examples && \ + ${FIND} * -type d -exec ${MKDIR} "${EXAMPLESDIR}/{}" \; && \ + ${FIND} -E * -type f -iregex ".*\.(asm|stc|inc)" -exec ${INSTALL_DATA} "{}" "${EXAMPLESDIR}/{}" \; + +.include diff --git a/devel/gpsim/distinfo b/devel/gpsim/distinfo new file mode 100644 index 000000000000..76cffafdee11 --- /dev/null +++ b/devel/gpsim/distinfo @@ -0,0 +1,3 @@ +MD5 (gpsim-0.21.11.tar.gz) = 2acd268dc2dd69d1ad687253bde8dd21 +SHA256 (gpsim-0.21.11.tar.gz) = 65d1a6a867cf0ee9a030e89b928d633ce7019b275b2683d6126fe8597e87fe84 +SIZE (gpsim-0.21.11.tar.gz) = 1218332 diff --git a/devel/gpsim/files/4patch-cli_input.cc b/devel/gpsim/files/4patch-cli_input.cc new file mode 100644 index 000000000000..856e5c367214 --- /dev/null +++ b/devel/gpsim/files/4patch-cli_input.cc @@ -0,0 +1,32 @@ +--- cli/input.cc.orig Wed Aug 31 05:57:33 2005 ++++ cli/input.cc Sun Mar 19 20:35:44 2006 +@@ -49,7 +49,6 @@ + // temp fix to over come 23jan05 changes to configure script that prevent + // readline from being found on older systems. + #define HAVE_READLINE +-#define HAVE_NSCLEAN_READLINE + + #endif + +@@ -899,7 +898,7 @@ + win32_fd_to_raw(fileno(stdin)); + #endif + +- rl_getc_function = gpsim_rl_getc; ++ rl_getc_function = (Function *) gpsim_rl_getc; + channel = g_io_channel_unix_new (fileno(stdin)); + + #ifdef _WIN32 +@@ -915,10 +914,10 @@ + #else + g_io_add_watch (channel, G_IO_IN, keypressed, NULL); + #endif +- rl_callback_handler_install (prompt, have_line); ++ rl_callback_handler_install ((char *) prompt, (VFunction *) have_line); + + /* Tell the completer that we want a crack first. */ +- rl_attempted_completion_function = gpsim_completion; ++ rl_attempted_completion_function = (CPPFunction *) gpsim_completion; + + #endif //HAVE_READLINE + } diff --git a/devel/gpsim/files/patch-src_os__dependent.cc b/devel/gpsim/files/patch-src_os__dependent.cc new file mode 100644 index 000000000000..30547a4fd047 --- /dev/null +++ b/devel/gpsim/files/patch-src_os__dependent.cc @@ -0,0 +1,11 @@ +--- src/os_dependent.cc.orig Thu Aug 25 23:57:41 2005 ++++ src/os_dependent.cc Sun Mar 19 20:45:54 2006 +@@ -349,7 +349,7 @@ + + char * get_error_message() { + #ifndef _WIN32 +- return dlerror(); ++ return (char *) dlerror(); + #else + return g_win32_error_message(GetLastError()); + #endif diff --git a/devel/gpsim/pkg-descr b/devel/gpsim/pkg-descr new file mode 100644 index 000000000000..bf1b4e8b503c --- /dev/null +++ b/devel/gpsim/pkg-descr @@ -0,0 +1,24 @@ +gpsim is a full-featured software simulator for Microchip PIC microcontrollers +distributed under the GNU General Public License. + +gpsim has been designed to be as accurate as possible. Accuracy includes the +entire PIC - from the core to the I/O pins and including ALL of the internal +peripherals. Thus it's possible to create stimuli and tie them to the I/O pins +and test the PIC the same PIC the same way you would in the real world. + +gpsim has been designed to be as fast as possible. Real time simulation speeds +of 20Mhz pics are possible. A 'goto $' program runs at the same speed as a +25Mhz pic when simulated on my 400Mhz PII Linux Box. Of course, as you add +stimuli and begin interacting with peripherals, the performance drops. But +it's still fast! + +gpsim has been designed to be as useful as possible (at least that's the +intent - honest). The standard simulation paradigm including breakpoints, +single stepping, disassembling, memory inspect & change, and so on has been +implemented. In addition, gpsim supports many debugging features that are only +available with in-circuit emulators. For example, a continuous trace buffer +tracks every action of the simulator (whether you want it or not). Also, it's +possible to set read and write break points on values (e.g. break if a +specific value is read from or written to a register). + +WWW: http://www.dattalo.com/gnupic/gpsim.html diff --git a/devel/gpsim/pkg-plist b/devel/gpsim/pkg-plist new file mode 100644 index 000000000000..2bcd3374b699 --- /dev/null +++ b/devel/gpsim/pkg-plist @@ -0,0 +1,183 @@ +bin/gpsim +include/eXdbm/eXdbm.h +include/eXdbm/eXdbmErrors.h +include/eXdbm/eXdbmTypes.h +include/gpsim/12bit-instructions.h +include/gpsim/12bit-processors.h +include/gpsim/14bit-instructions.h +include/gpsim/14bit-processors.h +include/gpsim/14bit-registers.h +include/gpsim/14bit-tmrs.h +include/gpsim/16bit-instructions.h +include/gpsim/16bit-processors.h +include/gpsim/16bit-registers.h +include/gpsim/16bit-tmrs.h +include/gpsim/attributes.h +include/gpsim/bit.h +include/gpsim/bitlog.h +include/gpsim/breakpoints.h +include/gpsim/bytelog.h +include/gpsim/cmd_gpsim.h +include/gpsim/cmd_manager.h +include/gpsim/cod.h +include/gpsim/eeprom.h +include/gpsim/errors.h +include/gpsim/exports.h +include/gpsim/expr.h +include/gpsim/fopen-path.h +include/gpsim/gpsim_classes.h +include/gpsim/gpsim_def.h +include/gpsim/gpsim_interface.h +include/gpsim/gpsim_object.h +include/gpsim/gpsim_time.h +include/gpsim/i2c-ee.h +include/gpsim/icd.h +include/gpsim/intcon.h +include/gpsim/interface.h +include/gpsim/ioports.h +include/gpsim/lxt_write.h +include/gpsim/modules.h +include/gpsim/operator.h +include/gpsim/p12x.h +include/gpsim/p16f62x.h +include/gpsim/p16f87x.h +include/gpsim/p16x5x.h +include/gpsim/p16x6x.h +include/gpsim/p16x7x.h +include/gpsim/p16x8x.h +include/gpsim/p17c75x.h +include/gpsim/p18x.h +include/gpsim/packages.h +include/gpsim/pic-instructions.h +include/gpsim/pic-packages.h +include/gpsim/pic-processor.h +include/gpsim/pic-registers.h +include/gpsim/picdis.h +include/gpsim/pie.h +include/gpsim/pir.h +include/gpsim/processor.h +include/gpsim/program_files.h +include/gpsim/protocol.h +include/gpsim/pthread-wrap.h +include/gpsim/registers.h +include/gpsim/sim_context.h +include/gpsim/ssp.h +include/gpsim/stimuli.h +include/gpsim/stimulus_orb.h +include/gpsim/symbol.h +include/gpsim/symbol_orb.h +include/gpsim/tmr0.h +include/gpsim/trace.h +include/gpsim/trace_orb.h +include/gpsim/trigger.h +include/gpsim/ttoken.h +include/gpsim/uart.h +include/gpsim/value.h +include/gpsim/xref.h +lib/libgpsim.a +lib/libgpsim.la +lib/libgpsim.so +lib/libgpsim.so.0 +lib/libgpsim_eXdbm.a +lib/libgpsim_eXdbm.la +lib/libgpsim_eXdbm.so +lib/libgpsim_eXdbm.so.0 +lib/libgpsim_modules.a +lib/libgpsim_modules.la +lib/libgpsim_modules.so +lib/libgpsim_modules.so.0 +lib/libgpsimcli.a +lib/libgpsimcli.la +lib/libgpsimcli.so +lib/libgpsimcli.so.0 +lib/libgpsimgui.a +lib/libgpsimgui.la +lib/libgpsimgui.so +lib/libgpsimgui.so.0 +%%PORTDOCS%%%%DOCSDIR%%/AUTHORS +%%PORTDOCS%%%%DOCSDIR%%/ChangeLog +%%PORTDOCS%%%%DOCSDIR%%/PROCESSORS +%%PORTDOCS%%%%DOCSDIR%%/README +%%PORTDOCS%%%%DOCSDIR%%/README.EXAMPLES +%%PORTDOCS%%%%DOCSDIR%%/README.MODULES +%%PORTDOCS%%%%DOCSDIR%%/gpsim.pdf +%%EXAMPLESDIR%%/12bit/p12c508_test.stc +%%EXAMPLESDIR%%/12bit/p12c509_test.asm +%%EXAMPLESDIR%%/12bit/pcl_test_12bit.asm +%%EXAMPLESDIR%%/12bit/p12c508_test.asm +%%EXAMPLESDIR%%/12bit/p12_it.asm +%%EXAMPLESDIR%%/12bit/gpio_stim.stc +%%EXAMPLESDIR%%/12bit/p12x.inc +%%EXAMPLESDIR%%/14bit/vertical_adder.asm +%%EXAMPLESDIR%%/14bit/p16f877_test2.stc +%%EXAMPLESDIR%%/14bit/p16c64_pwm.asm +%%EXAMPLESDIR%%/14bit/portc_stim.stc +%%EXAMPLESDIR%%/14bit/p16c64_test.stc +%%EXAMPLESDIR%%/14bit/async_stim.stc +%%EXAMPLESDIR%%/14bit/eetest.asm +%%EXAMPLESDIR%%/14bit/sync_stim.stc +%%EXAMPLESDIR%%/14bit/usart_14.asm +%%EXAMPLESDIR%%/14bit/p16c74_pwm.stc +%%EXAMPLESDIR%%/14bit/ap.stc +%%EXAMPLESDIR%%/14bit/iopin_stim.stc +%%EXAMPLESDIR%%/14bit/t.stc +%%EXAMPLESDIR%%/14bit/p16c65_pwm.stc +%%EXAMPLESDIR%%/14bit/wdt_test.asm +%%EXAMPLESDIR%%/14bit/loop_test.asm +%%EXAMPLESDIR%%/14bit/iopin_stim.asm +%%EXAMPLESDIR%%/14bit/p16c64_ccp.asm +%%EXAMPLESDIR%%/14bit/module_test.stc +%%EXAMPLESDIR%%/14bit/p16c64_pwm.stc +%%EXAMPLESDIR%%/14bit/usart.stc +%%EXAMPLESDIR%%/14bit/p16c64_tmr1.asm +%%EXAMPLESDIR%%/14bit/async_stim2.stc +%%EXAMPLESDIR%%/14bit/p16f877_test2.asm +%%EXAMPLESDIR%%/14bit/pcl_test.asm +%%EXAMPLESDIR%%/14bit/stim_test.asm +%%EXAMPLESDIR%%/14bit/p16c64_ccp.stc +%%EXAMPLESDIR%%/14bit/dtmf.stc +%%EXAMPLESDIR%%/14bit/it.asm +%%EXAMPLESDIR%%/14bit/twist.asm +%%EXAMPLESDIR%%/14bit/p16c74_test.stc +%%EXAMPLESDIR%%/14bit/async_pulse.stc +%%EXAMPLESDIR%%/14bit/sine.asm +%%EXAMPLESDIR%%/14bit/p16f877_test.asm +%%EXAMPLESDIR%%/14bit/p16c71_test.asm +%%EXAMPLESDIR%%/14bit/p16c74_test.asm +%%EXAMPLESDIR%%/14bit/analog_stim2.stc +%%EXAMPLESDIR%%/14bit/pulse_measure.asm +%%EXAMPLESDIR%%/14bit/p16c65_pwm.asm +%%EXAMPLESDIR%%/14bit/mod_test.asm +%%EXAMPLESDIR%%/14bit/bcd.asm +%%EXAMPLESDIR%%/14bit/ioport_stim.stc +%%EXAMPLESDIR%%/14bit/time_test.stc +%%EXAMPLESDIR%%/14bit/p16c64_test.asm +%%EXAMPLESDIR%%/14bit/analog_stim.stc +%%EXAMPLESDIR%%/16bit/p18.asm +%%EXAMPLESDIR%%/16bit/indtest18.asm +%%EXAMPLESDIR%%/16bit/it18.asm +%%EXAMPLESDIR%%/16bit/mul.asm +%%EXAMPLESDIR%%/16bit/bt18.asm +%%EXAMPLESDIR%%/16bit/calltest18.asm +%%EXAMPLESDIR%%/16bit/p18c242_test.asm +%%EXAMPLESDIR%%/modules/mod_test/mod_test.stc +%%EXAMPLESDIR%%/modules/mod_test/mod_test.asm +%%EXAMPLESDIR%%/projects/stack_test/stack_test.asm +%%EXAMPLESDIR%%/projects/stack_test/stack_test.stc +%%EXAMPLESDIR%%/projects/p16f628_test/f628.stc +%%EXAMPLESDIR%%/projects/p16f628_test/f628.asm +%%EXAMPLESDIR%%/projects/digital_stim/digital_stim.stc +%%EXAMPLESDIR%%/projects/digital_stim/digital_stim.asm +@dirrm include/eXdbm +@dirrm include/gpsim +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrm %%EXAMPLESDIR%%/12bit +@dirrm %%EXAMPLESDIR%%/14bit +@dirrm %%EXAMPLESDIR%%/16bit +@dirrm %%EXAMPLESDIR%%/modules/mod_test +@dirrm %%EXAMPLESDIR%%/modules +@dirrm %%EXAMPLESDIR%%/projects/stack_test +@dirrm %%EXAMPLESDIR%%/projects/p16f628_test +@dirrm %%EXAMPLESDIR%%/projects/digital_stim +@dirrm %%EXAMPLESDIR%%/projects +@dirrm %%EXAMPLESDIR%% -- cgit v1.2.3