a test can now consist of multiple pdp instructions
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
6e08a9f749
commit
e142b8a979
1 changed files with 19 additions and 12 deletions
31
PDP11/test.c
31
PDP11/test.c
|
@ -71,12 +71,14 @@ void generate_test_values()
|
||||||
test_values[n_test_values++] = 65535;
|
test_values[n_test_values++] = 65535;
|
||||||
}
|
}
|
||||||
|
|
||||||
json_t *generate_test(int *const id, struct mem_t *mem, size_t n_mem)
|
json_t *generate_test(int *const id, struct mem_t *mem, size_t n_mem, int run_n_instructions)
|
||||||
{
|
{
|
||||||
json_t *before = json_object();
|
json_t *before = json_object();
|
||||||
|
|
||||||
json_object_set(before, "PC", json_integer(saved_PC));
|
json_object_set(before, "PC", json_integer(saved_PC));
|
||||||
|
|
||||||
|
json_object_set(before, "run-n-instructions", json_integer(run_n_instructions));
|
||||||
|
|
||||||
json_object_set(before, "stack-0", json_integer(STACKFILE[0]));
|
json_object_set(before, "stack-0", json_integer(STACKFILE[0]));
|
||||||
json_object_set(before, "stack-1", json_integer(STACKFILE[1]));
|
json_object_set(before, "stack-1", json_integer(STACKFILE[1]));
|
||||||
json_object_set(before, "stack-2", json_integer(STACKFILE[2]));
|
json_object_set(before, "stack-2", json_integer(STACKFILE[2]));
|
||||||
|
@ -118,7 +120,9 @@ json_t *generate_test(int *const id, struct mem_t *mem, size_t n_mem)
|
||||||
json_object_set(before, "PSW", json_integer(PSW));
|
json_object_set(before, "PSW", json_integer(PSW));
|
||||||
|
|
||||||
// do
|
// do
|
||||||
int failed = sim_instr() != 0;
|
int failed = 0;
|
||||||
|
for(int k=0; k<run_n_instructions; k++)
|
||||||
|
failed |= sim_instr() != 0;
|
||||||
|
|
||||||
json_t *after = json_object();
|
json_t *after = json_object();
|
||||||
json_object_set(after, "PC", json_integer(saved_PC));
|
json_object_set(after, "PC", json_integer(saved_PC));
|
||||||
|
@ -209,7 +213,7 @@ void produce_set_register(const uint16_t instr, const uint16_t psw, int *const i
|
||||||
|
|
||||||
PSW = psw;
|
PSW = psw;
|
||||||
|
|
||||||
json_t *obj = generate_test(id, mem, 1);
|
json_t *obj = generate_test(id, mem, 1, 1);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
}
|
}
|
||||||
|
@ -242,7 +246,7 @@ void produce_set_register_indirect(const uint16_t instr, const uint16_t psw, int
|
||||||
|
|
||||||
PSW = psw;
|
PSW = psw;
|
||||||
|
|
||||||
json_t *obj = generate_test(id, mem, 2);
|
json_t *obj = generate_test(id, mem, 2, 1);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +297,7 @@ void emit_branch_instructions()
|
||||||
|
|
||||||
PSW = psw_val;
|
PSW = psw_val;
|
||||||
|
|
||||||
json_t *obj = generate_test(&id, mem, 1);
|
json_t *obj = generate_test(&id, mem, 1, 1);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
}
|
}
|
||||||
|
@ -329,7 +333,7 @@ void emit_condition_sets()
|
||||||
|
|
||||||
PSW = psw_val;
|
PSW = psw_val;
|
||||||
|
|
||||||
json_t *obj = generate_test(&id, mem, 1);
|
json_t *obj = generate_test(&id, mem, 1, 1);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
}
|
}
|
||||||
|
@ -408,7 +412,7 @@ void emit_single_operand_instructions()
|
||||||
|
|
||||||
PSW = psw_val;
|
PSW = psw_val;
|
||||||
|
|
||||||
json_t *obj = generate_test(&id, mem, 1);
|
json_t *obj = generate_test(&id, mem, 1, 1);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
}
|
}
|
||||||
|
@ -515,7 +519,7 @@ void emit_misc_operations()
|
||||||
|
|
||||||
PSW = psw_val;
|
PSW = psw_val;
|
||||||
|
|
||||||
json_t *obj = generate_test(&id, mem, 3);
|
json_t *obj = generate_test(&id, mem, 3, 1);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
}
|
}
|
||||||
|
@ -556,7 +560,7 @@ void emit_misc_operations()
|
||||||
|
|
||||||
PSW = 012;
|
PSW = 012;
|
||||||
|
|
||||||
json_t *obj = generate_test(&id, mem, 1);
|
json_t *obj = generate_test(&id, mem, 1, 1);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
|
|
||||||
|
@ -575,7 +579,7 @@ void emit_mov()
|
||||||
|
|
||||||
uint16_t test_vals[] = { 0, 127, 128, 255, 256, 65535 };
|
uint16_t test_vals[] = { 0, 127, 128, 255, 256, 65535 };
|
||||||
|
|
||||||
for(int i=0; i<6; i++) {
|
for(int i=0; i<12; i++) {
|
||||||
init_simh();
|
init_simh();
|
||||||
saved_PC = 0100;
|
saved_PC = 0100;
|
||||||
randomize_registers_all_values();
|
randomize_registers_all_values();
|
||||||
|
@ -584,13 +588,16 @@ void emit_mov()
|
||||||
|
|
||||||
struct mem_t mem[5] = {
|
struct mem_t mem[5] = {
|
||||||
{ 0100, 012700 },
|
{ 0100, 012700 },
|
||||||
{ 0102, test_vals[i] },
|
{ 0102, test_vals[i % 6] },
|
||||||
{ 0104, 012701 },
|
{ 0104, 012701 },
|
||||||
{ 0106, 0 },
|
{ 0106, 0 },
|
||||||
{ 0110, 0110001 }
|
{ 0110, 0110001 }
|
||||||
};
|
};
|
||||||
|
|
||||||
json_t *obj = generate_test(&id, mem, 5);
|
if (i >= 6)
|
||||||
|
mem[4].value = 0010001;
|
||||||
|
|
||||||
|
json_t *obj = generate_test(&id, mem, 5, 3);
|
||||||
if (obj)
|
if (obj)
|
||||||
json_array_append_new(out, obj);
|
json_array_append_new(out, obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue