Commit graph

420 commits

Author SHA1 Message Date
Mark Pizzolato
4dbac410da SCP: Added const declarations to various APIs to reflect the appropriate usage. Moved parameter values for run_cmd and exdep_cmd to scp.h 2014-10-26 14:52:22 -07:00
Mark Emmer
f6e750471a SCP: Fix SEND <dev>:line when after=nn and delay=nn not specified
For a command like:  SEND MUX:0 "abc"
in which a device is specified but there are no after=nn and delay=nn parameters, the code neglected to update cptr, resulting in an illegal argument error condition.
2014-10-26 13:42:49 -06:00
Mark Pizzolato
b4fb149b8d SCP: Fix help text for expect command. 2014-10-25 15:21:55 -07:00
Mark Pizzolato
e8358703be SCP: Fix NOEXPECT to actually delete a single indicated expect rule. Allow expect actions to be provided. Fix match buffer management when expect regular expressions are in use. 2014-10-25 11:14:36 -07:00
Mark Pizzolato
ebf4e0cb64 SCP: Add support for legacy form of console expect and send string commands (from Dave Bryan) 2014-10-23 05:58:43 -07:00
Mark Pizzolato
3256c10c77 General cleanup migrate to using sim_printf vs separate calls to printf and fprintf(sim_log). 2014-10-22 17:12:14 -07:00
Mark Pizzolato
bff7521c56 SCP: Migrate more output written to sim_log to use sim_printf. 2014-10-22 13:25:42 -07:00
Mark Pizzolato
6c5a700191 SCP: Added numeric value comparisons to IF and ASSERT compares.
Compare operations will do a literal compare of basic string values unless the all of each string contains numeric data.  If numeric data is there then a numeric comparison will be made.  For example:

	If "+1" == "1" echo equal

will display equal, while the simple string comparison will be not-equal.
2014-10-22 11:54:08 -07:00
Mark Pizzolato
1f9d21ad2e SCP: Added IF command and string comparision behaviors to the ASSERT and IF command operations. 2014-10-22 11:28:28 -07:00
Mark Pizzolato
916bab3c2a SCP: Cleaned up help for EXPECT and SEND commands. Added optional case insensitive match option to regular expression EXPECT rules. 2014-10-22 11:27:38 -07:00
Mark Pizzolato
5a4bbbad8d SCP: Extended EXPECT and SEND to have more flexible activation delays
- EXPECT will now tolerate a HALTAFTER=n parameter which delay the simulator stopping execution for n instructions.  Unpredictable behavior will happen if multiple EXPECT conditions see matching data before the first actualy halt occurs.
- SEND has an AFTER=n argument which delays the initial stuffed data from being input for at least n instructions.  It also has a DELAY=m argument which specifies the minimum number of instructions which must execute between stuffed input data.
- Changed run_cmd() to no longer clear pending breakpoint actions before starting instruction execution.
- Added a -Q switch to the commands which dispatch through run_cmd() (RUN, STEP, NEXT, GO, BOOT, etc.).  This switch will suppress status output when execution stops.  This will allow sequences of breakpoint action commands to silently execute when needed.
2014-10-20 16:47:33 -07:00
Mark Pizzolato
5af6210ed9 SCP: Add RegEx support to EXPECT string processing 2014-10-20 04:42:25 -07:00
Mark Pizzolato
ddc29fb2c9 SCP: Added debugging support for EXPECT and SEND activities. Fixed SEND buffer queuing bug. 2014-10-17 11:34:06 -07:00
Mark Pizzolato
02e90de6a4 SCP: Added EXPECT and SEND commands to react to data from and inject data into the simulated console port (and other MUX ports)
Ideas based on Dave Bryan's console halt efforts.

	sim> SEND {<mux>:line} {DELAY=n,}"string"

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
Delay is optional and once set persists for subsequent SEND operations to the same device.  Delay defaults to 1000.  The DELAY value is a minimum number of instructions which must execute before the next character in the provided string will be injected to the console port.  The DELAY value has effect between the characters delivered as well.  "string" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).

Each device (console, and each line in each mux) has a separate value for DELAY.

An arbitrary number of 'expect' conditions can be defined.  The command syntax is:

              sim> EXPECT {<mux>:line} {[cnt]} "matchstring" {actioncommand {; actioncommand ...}}

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
"matchstring" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).  The quotes used can be single or double quotes, but the closing quote must match the opening quote.  The match string might be extended to allow the use of perl style regular expressions in the "matchstring" when a -R switch is specified on the command line.

              sim> EXPECT "Enter Color: "  SEND "Red\r"; g

A specific 'expect' condition can be removed with:

              sim> NOEXPECT {<mux>:line} "matchstring"

All 'expect' conditions can be removed with:

              sim> NOEXPECT {<mux>:line}

'expect' conditions can be examined with:

              sim> SHOW EXPECT {<mux>:line}

Expect rules are one-shots (i.e. they disappear once a match has occurred) unless they are explicitly described as persistent with the -P switch.
The -C switch is available when defining expect rules.  The effect of a rule defined with the -C flag is that when an expect match occurs for that rule, ALL rules are cleared for that device (console or <mux>:line).
2014-10-14 10:49:24 -07:00
Mark Pizzolato
d0865d37f5 SCP: Fix recently revised breakpoint setup to behave properly breakpoint action is NULL 2014-10-11 04:19:15 -07:00
Mark Pizzolato
0b1050853e SCP: Allow for the potential of a breakpoint action to remove the establishing breakpoint while still completing pending actions 2014-10-10 08:03:22 -07:00
Mark Pizzolato
f355749eb5 SCP: Provide a way to display an arbitrary buffer contents as hex in debug output 2014-09-17 09:08:12 -07:00
Mark Pizzolato
1e0b83ca10 SCP: Avoid building sim_video code when it isn't used by a simulator.
This results in smaller simulator binaries.
2014-09-16 11:05:31 -07:00
Mark Pizzolato
b8dc8f01b5 SCP: Fix to have sim_printf expand newlines to CRLF when writing to stdout with the simulator running. Allow sim_debug to be called with a NULL device pointer and return producing no output. 2014-09-16 09:18:57 -07:00
Mark Pizzolato
2c0cedcc9c PDP11, VAX: Added ability to set the size of RAUSER devices to be n binary MB (1024*1024) with the -B switch. Added SHOW -B to display drive capacities in binary MB using the SHOW -B switch. 2014-05-16 15:13:56 -07:00
Mark Pizzolato
f4771affe7 SCP: Fix SET VERIFY which didn't work while processing command procedures 2014-05-16 05:49:42 -07:00
Mark Pizzolato
e8114cf088 SCP: Fix errant display of NEXT warning on first STEP command. From Peter Schorn
Better display in SHOW VERSION of full compiler name on OSX when using the clang LLVM compilers
Change stray non-ascii quote characters in comments.
2014-04-18 04:58:27 -07:00
Mark Pizzolato
92e3acb2f3 SCP: Added the rest of the NEXT command repeat count support. 2014-04-17 13:17:14 -07:00
Mark Pizzolato
7fc8922a48 SCP: Added a repeat count for the NEXT command 2014-04-17 13:07:01 -07:00
Mark Pizzolato
8f3e6438a3 SCP: Added the NEXT command. This command provides the ability for a simulator to step over subroutine calls. 2014-04-14 14:22:18 -07:00
Mark Pizzolato
e63fbdce49 SCP: Fix SHOW DEBUG device debug flags output for devices which may have debug settings which set multiple flags. 2014-04-02 04:49:33 -07:00
Mark Pizzolato
6ce8d99cd8 SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.

Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
2014-03-28 08:20:05 -07:00
Mark Pizzolato
98ac7af6fa PDP11, VAX: Fix differencing virtual disk corruption during creation problems 2014-03-16 01:11:35 -07:00
Mark Pizzolato
9022de500d SCP: Removed the irrelevant sim_deb_PC variable since it duplicates the role sim_PC simulator variable. 2014-03-05 12:53:32 -08:00
Mark Pizzolato
02cb5c2d88 Compiler suggested cleanups.
Mostly silencing noise warnings, but bugs were found in sim_console.c and pdp11_dmc.c
2014-02-14 17:07:45 -08:00
Mark Pizzolato
59d0602b0d PDP8: Add device buffer flush capability and keep track of data written state in the device buffer. Fixes #87
Finishing the last DECtape device which was missed when this functionality was added to pdp11_dt, pdp18b_dt and pdp8_dt
in commits: 2934112a70 and c9e8121c16

Cleaned up the pdp11, pdp18b and other pdp8 implementations to make backporting cleaner.
Made sure that buffer flushing happens correctly when simulation returns to the sim> prompt.
2014-02-12 21:08:18 -08:00
Mark Pizzolato
9068ea0e8e SCP: Fleshing out more of the hierarchical help content. 2014-02-11 14:24:45 -08:00
Mark Pizzolato
545aa85677 SCP: Cleaned up the hierarchical help APIs to follow the same indentation style used in the rest of scp.c. Fixed the help prompt to avoid adding an extra level to the prompt when the current level has no children. 2014-02-10 17:25:07 -08:00
Mark Pizzolato
afcbea251d SCP: Add SHOW -C BREAK to display the currently defined breakpoints as commands which can be used to redefine them later.
Note: This excludes the possibility of there being a -C breakpoint type.  Since there are potentially 26 different breakpoint types, this exclusion is not likely to have a significant impact.
2014-02-07 06:32:21 -08:00
Mark Pizzolato
8d09ebec8b Compiler indicated cleanups to Fix #105 2014-02-05 13:44:36 -08:00
Mark Pizzolato
da134ebb2a SCP: Added detailed help (including switches) for SET DEBUG command and an auto flush of the debug output when instruction execution stops. 2014-02-04 15:45:26 -08:00
Mark Pizzolato
eaae19463c SCP: Initial merge of old style single line help with hierarchical help 2014-02-01 07:04:44 -08:00
Mark Pizzolato
18451806b7 SCP: Added default simulator specific initialization file to be in the current working directory if one isn't found where the simulator binary is located (suggested by Jordi Guillaumes Pons in #101). 2014-01-23 05:15:54 -08:00
Mark Pizzolato
c64aabf51f SCP: Fix for %DATE_WW% and %DATE_WYYYY% computation on the first days of a year after a leap year. 2014-01-16 07:40:35 -08:00
Mark Pizzolato
e1b0a416a9 SCP: Generalized DATE and TIME variable insertion adding support for ISO 8601 date values. Inspired by Christian Gauger-Cosgrove.
ISO 8601 support without requiring C99 strftime functionality.

          %DATE%                yyyy-mm-dd
          %TIME%                 hh:mm:ss
          %DATETIME%       yyyy-mm-ddThh:mm:ss
          %LDATE%               mm/dd/yy (Locale Formatted)
          %LTIME%               hh:mm:ss am/pm (Locale Formatted)
          %CTIME%               Www Mmm dd hh:mm:ss yyyy (Locale Formatted)
          %DATE_YYYY%     yyyy              (0000-9999)
          %DATE_YY%          yy                  (00-99)
          %DATE_MM%       mm               (01-12)
          %DATE_DD%         dd                  (01-31)
          %DATE_WW%       ww                 (01-53)     ISO 8601 week number
          %DATE_WYYYY%  yyyy              (0000-9999) ISO 8601 week year number
          %DATE_D%            d                    (1-7)       ISO 8601 day of week
          %DATE_JJJ%           jjj                   (001-366) day of year
          %TIME_HH%         hh                  (00-23)
          %TIME_MM%        mm               (00-59)
          %TIME_SS%            ss                  (00-59)
2014-01-11 11:13:25 -08:00
Mark Pizzolato
fd4a3acbad Avoid NULL pointer dereference when examining a device with no units. #95 2014-01-09 12:03:51 -08:00
Mark Pizzolato
2ea8a0a30f SCP: Changed command processing variable insertion to format %DATE% as yyyy-mm-dd instead of yyyy/mm/dd and added %STIME% to produce hh_mm_ss. 2014-01-08 12:47:33 -08:00
Mark Pizzolato
2bb502ee64 SCP: Static Analyzer cleanups suggested by Peter Schorn 2013-12-27 07:08:17 -08:00
Mark Pizzolato
7b3e508627 ETHER: Added capability to build working networking support without pcap packet transport (i.e. only using one of the other available packet transports: VDE, TAP, UDP, etc.) 2013-12-19 09:45:51 -08:00
Mark Pizzolato
00afa58bc4 SCP: Added hierarchical help capability (from Timothe Litt) 2013-11-22 06:08:03 -08:00
Mark Pizzolato
e65aa904e7 SCP: Fix various missing log output 2013-11-20 15:09:43 -08:00
Mark Pizzolato
2e85e74699 SCP: Various cleanups.
- Avoid assignments of void * values.  Cast all memory allocation return values to appropriate types.
- Add output to sim_log where missing in various places.
- Fixed issue with lost file positions after a restore for devices which leverage the UNIT_SEQ flag.
2013-11-20 09:13:27 -08:00
Mark Pizzolato
864f0e0d37 SCP: Show device options can be more flexibly formatted and optionally not display anything. 2013-11-16 18:14:09 -08:00
Mark Pizzolato
600d6f5962 SCP: Added a mechanism to allow debugging output to display PC values for simulators which don't have a simple register which contains the PC value. 2013-11-14 10:41:49 -08:00
Mark Pizzolato
b4b274c446 More compiler warnings 2013-11-05 16:55:30 -08:00