Generate testset using simh
Some checks are pending
Build / cmake-builds (push) Waiting to run
Build / makefile (macos-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (macos-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (macos-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (macos-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (macos-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (macos-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
Build / makefile (ubuntu-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (ubuntu-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (ubuntu-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (ubuntu-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
Some checks are pending
Build / cmake-builds (push) Waiting to run
Build / makefile (macos-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (macos-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (macos-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (macos-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (macos-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (macos-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
Build / makefile (ubuntu-latest, besm6 imlac tt2500 microvax3900 microvax1 rtvax1000 vaxstation3100m76 vaxstation4000m60) (push) Waiting to run
Build / makefile (ubuntu-latest, id16 id32 sds lgp h316 cdc1700 swtp6800mp-a swtp6800mp-a2 tx-0 ssem b5500 sage pdq3 alpha) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax2 vax730 vax750 vax780 vax8200 vax8600 microvax2000 infoserver100 infoserver150vxt microvax3100 microvax3100e vaxstation3100m30 vaxstation3100m38) (push) Waiting to run
Build / makefile (ubuntu-latest, microvax3100m80 vaxstation4000vlc infoserver1000 nova eclipse hp2100 hp3000 i1401 i1620 s3 altair altairz80 gri i7094) (push) Waiting to run
Build / makefile (ubuntu-latest, pdp1 pdp4 pdp6 pdp7 pdp8 pdp9 pdp10 pdp10-ka pdp10-ki pdp10-kl pdp10-ks pdp11 pdp15 vax) (push) Waiting to run
Build / makefile (ubuntu-latest, scelbi 3b2 i701 i704 i7010 i7070 i7080 i7090 sigma uc15 i650 sel32 intel-mds ibm1130) (push) Waiting to run
This commit is contained in:
parent
b036821a68
commit
3671049405
5 changed files with 166 additions and 9 deletions
|
@ -104,3 +104,64 @@ add_simulator(uc15
|
||||||
LABEL PDP11
|
LABEL PDP11
|
||||||
PKG_FAMILY pdp11_family
|
PKG_FAMILY pdp11_family
|
||||||
TEST uc15)
|
TEST uc15)
|
||||||
|
|
||||||
|
add_simulator(pdp11-validator-gen
|
||||||
|
SOURCES
|
||||||
|
test.c
|
||||||
|
pdp11_fp.c
|
||||||
|
pdp11_cpu.c
|
||||||
|
pdp11_dz.c
|
||||||
|
pdp11_cis.c
|
||||||
|
pdp11_lp.c
|
||||||
|
pdp11_rk.c
|
||||||
|
pdp11_rl.c
|
||||||
|
pdp11_rp.c
|
||||||
|
pdp11_rx.c
|
||||||
|
pdp11_stddev.c
|
||||||
|
pdp11_sys.c
|
||||||
|
pdp11_tc.c
|
||||||
|
pdp11_tm.c
|
||||||
|
pdp11_ts.c
|
||||||
|
pdp11_io.c
|
||||||
|
pdp11_rq.c
|
||||||
|
pdp11_tq.c
|
||||||
|
pdp11_pclk.c
|
||||||
|
pdp11_ry.c
|
||||||
|
pdp11_pt.c
|
||||||
|
pdp11_hk.c
|
||||||
|
pdp11_xq.c
|
||||||
|
pdp11_xu.c
|
||||||
|
pdp11_vh.c
|
||||||
|
pdp11_rh.c
|
||||||
|
pdp11_tu.c
|
||||||
|
pdp11_cpumod.c
|
||||||
|
pdp11_cr.c
|
||||||
|
pdp11_rf.c
|
||||||
|
pdp11_dl.c
|
||||||
|
pdp11_ta.c
|
||||||
|
pdp11_rc.c
|
||||||
|
pdp11_kg.c
|
||||||
|
pdp11_ke.c
|
||||||
|
pdp11_dc.c
|
||||||
|
pdp11_dmc.c
|
||||||
|
pdp11_kmc.c
|
||||||
|
pdp11_dup.c
|
||||||
|
pdp11_rs.c
|
||||||
|
pdp11_vt.c
|
||||||
|
pdp11_td.c
|
||||||
|
pdp11_io_lib.c
|
||||||
|
pdp11_rom.c
|
||||||
|
pdp11_ch.c
|
||||||
|
pdp11_dh.c
|
||||||
|
pdp11_ng.c
|
||||||
|
pdp11_daz.c
|
||||||
|
pdp11_tv.c
|
||||||
|
pdp11_mb.c
|
||||||
|
pdp11_rr.c
|
||||||
|
INCLUDES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
DEFINES
|
||||||
|
VM_PDP11
|
||||||
|
LABEL PDP11
|
||||||
|
PKG_FAMILY pdp11_family
|
||||||
|
TEST pdp11)
|
||||||
|
|
|
@ -855,9 +855,9 @@ while (reason == 0) {
|
||||||
STACKFILE[cm] = SP;
|
STACKFILE[cm] = SP;
|
||||||
saved_PC = PC & 0177777;
|
saved_PC = PC & 0177777;
|
||||||
pcq_r->qptr = pcq_p; /* update pc q ptr */
|
pcq_r->qptr = pcq_p; /* update pc q ptr */
|
||||||
set_r_display (rs, cm);
|
//set_r_display (rs, cm);
|
||||||
|
|
||||||
reason = sim_process_event (); /* process events */
|
//reason = sim_process_event (); /* process events */
|
||||||
|
|
||||||
/* restore simh register contents into running variables */
|
/* restore simh register contents into running variables */
|
||||||
PC = saved_PC;
|
PC = saved_PC;
|
||||||
|
@ -872,7 +872,8 @@ while (reason == 0) {
|
||||||
MMR0 = MMR0 | MMR0_IC; /* usually on */
|
MMR0 = MMR0 | MMR0_IC; /* usually on */
|
||||||
|
|
||||||
trap_req = calc_ints (ipl, trap_req); /* recalc int req */
|
trap_req = calc_ints (ipl, trap_req); /* recalc int req */
|
||||||
continue;
|
//continue;
|
||||||
|
break;
|
||||||
} /* end if sim_interval */
|
} /* end if sim_interval */
|
||||||
|
|
||||||
if (trap_req) { /* check traps, ints */
|
if (trap_req) { /* check traps, ints */
|
||||||
|
@ -894,7 +895,8 @@ while (reason == 0) {
|
||||||
} /* end else t */
|
} /* end else t */
|
||||||
if (trapea == 0) { /* nothing to do? */
|
if (trapea == 0) { /* nothing to do? */
|
||||||
trap_req = calc_ints (ipl, 0); /* recalculate */
|
trap_req = calc_ints (ipl, 0); /* recalculate */
|
||||||
continue; /* back to fetch */
|
break;
|
||||||
|
//continue; /* back to fetch */
|
||||||
} /* end if trapea */
|
} /* end if trapea */
|
||||||
|
|
||||||
/* Process a trap or interrupt
|
/* Process a trap or interrupt
|
||||||
|
@ -944,7 +946,8 @@ while (reason == 0) {
|
||||||
if ((cm == MD_KER) && (SP < (STKLIM + STKL_Y)) &&
|
if ((cm == MD_KER) && (SP < (STKLIM + STKL_Y)) &&
|
||||||
(trapnum != TRAP_V_RED) && (trapnum != TRAP_V_YEL))
|
(trapnum != TRAP_V_RED) && (trapnum != TRAP_V_YEL))
|
||||||
set_stack_trap (SP);
|
set_stack_trap (SP);
|
||||||
continue; /* end if traps */
|
break;
|
||||||
|
//continue; /* end if traps */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fetch and decode next instruction */
|
/* Fetch and decode next instruction */
|
||||||
|
@ -2433,6 +2436,7 @@ while (reason == 0) {
|
||||||
else setTRAP (TRAP_ILL);
|
else setTRAP (TRAP_ILL);
|
||||||
break; /* end case 017 */
|
break; /* end case 017 */
|
||||||
} /* end switch op */
|
} /* end switch op */
|
||||||
|
break;
|
||||||
} /* end main loop */
|
} /* end main loop */
|
||||||
|
|
||||||
/* Simulation halted */
|
/* Simulation halted */
|
||||||
|
|
86
PDP11/test.c
Normal file
86
PDP11/test.c
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
#include <jansson.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "pdp11_defs.h"
|
||||||
|
#include "sim_defs.h"
|
||||||
|
|
||||||
|
//extern t_stat sim_brk_init(void);
|
||||||
|
//extern t_stat sim_brk_set(t_addr loc, int32 sw, int32 ncnt, CONST char *act);
|
||||||
|
extern t_stat sim_instr();
|
||||||
|
//extern uint32 sim_brk_summ;
|
||||||
|
extern void PWriteW(int32 data, int32 addr);
|
||||||
|
extern int32 REGFILE[6][2];
|
||||||
|
extern int32 STACKFILE[4];
|
||||||
|
extern int32 saved_PC;
|
||||||
|
extern int32 PSW;
|
||||||
|
extern t_stat cpu_reset(DEVICE *dptr);
|
||||||
|
extern DEVICE cpu_dev;
|
||||||
|
|
||||||
|
void produce_validation_tests()
|
||||||
|
{
|
||||||
|
json_t *out = json_array();
|
||||||
|
|
||||||
|
for(int i=0; i<65536; i++) {
|
||||||
|
json_t *before = json_object();
|
||||||
|
|
||||||
|
cpu_reset(&cpu_dev);
|
||||||
|
|
||||||
|
saved_PC = 0100;
|
||||||
|
json_object_set(before, "PC", json_integer(saved_PC));
|
||||||
|
|
||||||
|
json_t *memory = json_array();
|
||||||
|
json_t *mem_i = json_object();
|
||||||
|
json_object_set(mem_i, "0100", json_integer(i));
|
||||||
|
json_array_append_new(memory, mem_i);
|
||||||
|
json_object_set(before, "memory", memory);
|
||||||
|
PWriteW(i, saved_PC);
|
||||||
|
uint16_t data1 = rand() & 0xffff;
|
||||||
|
uint16_t data2 = rand() & 0xffff;
|
||||||
|
json_object_set(mem_i, "0102", json_integer(data1));
|
||||||
|
PWriteW(data1, saved_PC + 2);
|
||||||
|
json_object_set(mem_i, "0104", json_integer(data2));
|
||||||
|
PWriteW(data2, saved_PC + 4);
|
||||||
|
|
||||||
|
for(int k=0; k<6; k++) {
|
||||||
|
char name[16];
|
||||||
|
|
||||||
|
sprintf(name, "reg-%d.%d", k, 0);
|
||||||
|
REGFILE[k][0] = rand() & 0xffff;
|
||||||
|
json_object_set(before, name, json_integer(REGFILE[k][0]));
|
||||||
|
|
||||||
|
sprintf(name, "reg-%d.%d", k, 1);
|
||||||
|
REGFILE[k][1] = rand() & 0xffff;
|
||||||
|
json_object_set(before, name, json_integer(REGFILE[k][1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
json_object_set(before, "PSW", json_integer(PSW));
|
||||||
|
|
||||||
|
// do
|
||||||
|
sim_instr();
|
||||||
|
|
||||||
|
json_t *after = json_object();
|
||||||
|
json_object_set(after, "PC", json_integer(saved_PC));
|
||||||
|
|
||||||
|
for(int k=0; k<6; k++) {
|
||||||
|
char name[16];
|
||||||
|
|
||||||
|
sprintf(name, "reg-%d.%d", k, 0);
|
||||||
|
json_object_set(after, name, json_integer(REGFILE[k][0]));
|
||||||
|
|
||||||
|
sprintf(name, "reg-%d.%d", k, 1);
|
||||||
|
json_object_set(after, name, json_integer(REGFILE[k][1]));
|
||||||
|
}
|
||||||
|
|
||||||
|
json_object_set(after, "PSW", json_integer(PSW));
|
||||||
|
|
||||||
|
json_t *collection = json_object();
|
||||||
|
json_object_set(collection, "before", before);
|
||||||
|
json_object_set(collection, "after", after);
|
||||||
|
|
||||||
|
json_array_append_new(out, collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE *fh = fopen("testset.json", "w");
|
||||||
|
json_dumpf(out, fh, JSON_INDENT(2));
|
||||||
|
fclose(fh);
|
||||||
|
}
|
|
@ -102,6 +102,7 @@ function(build_simcore _targ)
|
||||||
simh_regexp
|
simh_regexp
|
||||||
os_features
|
os_features
|
||||||
thread_lib
|
thread_lib
|
||||||
|
jansson
|
||||||
)
|
)
|
||||||
|
|
||||||
# Ensure that sim_rev.h picks up .git-commit-id.h if the git command is
|
# Ensure that sim_rev.h picks up .git-commit-id.h if the git command is
|
||||||
|
@ -357,7 +358,7 @@ function(add_unit_test _targ)
|
||||||
simh_executable_template(${UNIT_TARGET} "${ARGN}")
|
simh_executable_template(${UNIT_TARGET} "${ARGN}")
|
||||||
cmake_parse_arguments(SIMH "FEATURE_INT64;FEATURE_FULL64;BUILDROMS;FEATURE_VIDEO,FEATURE_DISPLAY"
|
cmake_parse_arguments(SIMH "FEATURE_INT64;FEATURE_FULL64;BUILDROMS;FEATURE_VIDEO,FEATURE_DISPLAY"
|
||||||
"SOURCE_DIR;LABEL"
|
"SOURCE_DIR;LABEL"
|
||||||
"DEFINES;INCLUDES;SOURCES"
|
"DEFINES;INCLUDES;SOURCES"
|
||||||
${ARGN})
|
${ARGN})
|
||||||
|
|
||||||
target_link_libraries(${UNIT_TARGET} PUBLIC unittest)
|
target_link_libraries(${UNIT_TARGET} PUBLIC unittest)
|
||||||
|
|
11
scp.c
11
scp.c
|
@ -2917,7 +2917,7 @@ if (!sim_quiet) {
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
show_version (stdout, NULL, NULL, 0, NULL);
|
show_version (stdout, NULL, NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
sim_timer_precalibrate_execution_rate ();
|
//sim_timer_precalibrate_execution_rate ();
|
||||||
show_version (stdnul, NULL, NULL, 1, NULL); /* Quietly set SIM_OSTYPE */
|
show_version (stdnul, NULL, NULL, 1, NULL); /* Quietly set SIM_OSTYPE */
|
||||||
#if defined (HAVE_PCRE_H)
|
#if defined (HAVE_PCRE_H)
|
||||||
setenv ("SIM_REGEX_TYPE", "PCRE", 1); /* Publish regex type */
|
setenv ("SIM_REGEX_TYPE", "PCRE", 1); /* Publish regex type */
|
||||||
|
@ -2971,8 +2971,10 @@ if (docmdp) {
|
||||||
}
|
}
|
||||||
if (SCPE_BARE_STATUS(stat) == SCPE_OPENERR) /* didn't exist/can't open? */
|
if (SCPE_BARE_STATUS(stat) == SCPE_OPENERR) /* didn't exist/can't open? */
|
||||||
stat = SCPE_OK;
|
stat = SCPE_OK;
|
||||||
if (SCPE_BARE_STATUS(stat) != SCPE_EXIT)
|
extern void produce_validation_tests();
|
||||||
process_stdin_commands (SCPE_BARE_STATUS(stat), argv, FALSE);
|
produce_validation_tests();
|
||||||
|
//if (SCPE_BARE_STATUS(stat) != SCPE_EXIT)
|
||||||
|
// process_stdin_commands (SCPE_BARE_STATUS(stat), argv, FALSE);
|
||||||
|
|
||||||
cleanup_and_exit:
|
cleanup_and_exit:
|
||||||
|
|
||||||
|
@ -7788,6 +7790,7 @@ t_stat ssh_break_one (FILE *st, int32 flg, t_addr lo, int32 cnt, CONST char *apt
|
||||||
{
|
{
|
||||||
if (!sim_brk_types)
|
if (!sim_brk_types)
|
||||||
return sim_messagef (SCPE_NOFNC, "No breakpoint support in this simulator\n");
|
return sim_messagef (SCPE_NOFNC, "No breakpoint support in this simulator\n");
|
||||||
|
printf("%d %d %d %s\n", flg, lo, cnt, aptr);
|
||||||
switch (flg) {
|
switch (flg) {
|
||||||
|
|
||||||
case SSH_ST:
|
case SSH_ST:
|
||||||
|
@ -12496,6 +12499,8 @@ t_stat sim_brk_set (t_addr loc, int32 sw, int32 ncnt, CONST char *act)
|
||||||
{
|
{
|
||||||
BRKTAB *bp;
|
BRKTAB *bp;
|
||||||
|
|
||||||
|
printf("sim_brk_set: %d, %d, %d, %s\n", loc, sw, ncnt, act);
|
||||||
|
|
||||||
if ((sw == 0) || (sw == BRK_TYP_DYN_STEPOVER))
|
if ((sw == 0) || (sw == BRK_TYP_DYN_STEPOVER))
|
||||||
sw |= sim_brk_dflt;
|
sw |= sim_brk_dflt;
|
||||||
if (~sim_brk_types & sw) {
|
if (~sim_brk_types & sw) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue