BESM6: Working calibrated clock which also supports idling

BESM6: Single instruction calibration and step cleanup
This commit is contained in:
Mark Pizzolato 2015-01-01 20:08:23 -08:00 committed by Leo Broukhis
parent 76cdf0fd10
commit bd50637b18
4 changed files with 14 additions and 22 deletions

View file

@ -1494,7 +1494,6 @@ t_stat sim_instr (void)
/* Restore register state */ /* Restore register state */
PC = PC & BITS(15); /* mask PC */ PC = PC & BITS(15); /* mask PC */
sim_cancel_step (); /* defang SCP step */
mmu_setup (); /* copy RP to TLB */ mmu_setup (); /* copy RP to TLB */
/* An internal interrupt or user intervention */ /* An internal interrupt or user intervention */
@ -1688,13 +1687,7 @@ t_stat sim_instr (void)
redraw_panel = 0; redraw_panel = 0;
} }
if (delay < 1) sim_interval -= 1; /* count down instructions */
delay = 1;
sim_interval -= delay; /* count down delay */
if (sim_step && (--sim_step <= 0)) { /* do step count */
besm6_draw_panel();
return SCPE_STOP;
}
} }
} }
@ -1729,7 +1722,7 @@ t_stat fast_clk (UNIT * this)
} }
UNIT clocks[] = { UNIT clocks[] = {
{ UDATA(fast_clk, 0, 0), CLK_DELAY }, /* 40 р, 50 Гц */ { UDATA(fast_clk, UNIT_IDLE, 0), CLK_DELAY }, /* 40 р, 50 Гц */
}; };
t_stat clk_reset (DEVICE * dev) t_stat clk_reset (DEVICE * dev)

View file

@ -121,7 +121,7 @@ enum {
/* /*
* Считаем, что моделируеммая машина имеет опорную частоту 10 МГц. * Считаем, что моделируеммая машина имеет опорную частоту 10 МГц.
*/ */
#define USEC 10 /* одна микросекунда - десять тактов */ #define USEC 1 /* одна микросекунда - десять тактов */
#define MSEC (1000*USEC) /* одна миллисекунда */ #define MSEC (1000*USEC) /* одна миллисекунда */
#define CLK_TPS 250 /* Fast Clock Ticks Per Second (every 4ms) */ #define CLK_TPS 250 /* Fast Clock Ticks Per Second (every 4ms) */
#define CLK_DELAY 4000 /* Uncalibrated instructions per clock tick */ #define CLK_DELAY 4000 /* Uncalibrated instructions per clock tick */

View file

@ -161,8 +161,8 @@ t_stat tty_reset (DEVICE *dptr)
/* Готовность устройства в READY2 инверсная, а устройство всегда готово */ /* Готовность устройства в READY2 инверсная, а устройство всегда готово */
/* Провоцируем передачу */ /* Провоцируем передачу */
PRP |= CONS_CAN_PRINT[0] | CONS_CAN_PRINT[1]; PRP |= CONS_CAN_PRINT[0] | CONS_CAN_PRINT[1];
return sim_activate (tty_unit, 1000*MSEC/300); //return sim_activate_after (tty_unit, 1000*MSEC/300);
// return sim_clock_coschedule (tty_unit, 5*tmr_poll); return sim_clock_coschedule (tty_unit, tmr_poll);
} }
/* 19 р ГРП, 300 Гц */ /* 19 р ГРП, 300 Гц */
@ -225,8 +225,8 @@ t_stat vt_clk (UNIT * this)
/* Опрашиваем сокеты на передачу. */ /* Опрашиваем сокеты на передачу. */
tmxr_poll_tx (&tty_desc); tmxr_poll_tx (&tty_desc);
return sim_activate (tty_unit, 1000*MSEC/300); // return sim_activate_after (tty_unit, 1000*MSEC/300);
// return sim_clock_coschedule (this, 5*tmr_poll); return sim_clock_coschedule (this, tmr_poll);
} }
t_stat tty_setmode (UNIT *u, int32 val, char *cptr, void *desc) t_stat tty_setmode (UNIT *u, int32 val, char *cptr, void *desc)
@ -996,8 +996,9 @@ int vt_getc (int num)
} else { } else {
/* Ввод с клавиатуры. */ /* Ввод с клавиатуры. */
c = sim_poll_kbd(); c = sim_poll_kbd();
if (c == SCPE_STOP) if (c == SCPE_STOP) {
return 0400; /* прерывание */ return 0400; /* прерывание */
}
if (! (c & SCPE_KFLAG)) if (! (c & SCPE_KFLAG))
return -1; return -1;
} }
@ -1136,7 +1137,7 @@ void vt_receive()
} }
if (tty_typed[num] < 0) { if (tty_typed[num] < 0) {
/* TODO: обработать исключение от "неоператорского" терминала */ /* TODO: обработать исключение от "неоператорского" терминала */
sim_interval = 0; // sim_interval = 0;
break; break;
} }
if (tty_typed[num] <= 0177) { if (tty_typed[num] <= 0177) {

View file

@ -1,5 +1,4 @@
! rm -f log.txt set -n console log=log.txt
set console log=log.txt
set console debug=log set console debug=log
;set cpu debug ;set cpu debug
;set mmu debug ;set mmu debug
@ -9,9 +8,8 @@ set console debug=log
; ;
; Приводим барабаны в исходное состояние. ; Приводим барабаны в исходное состояние.
; ;
! rm -f drum1x.bin drum2x.bin attach -n drum0 drum1x.bin
attach drum0 drum1x.bin attach -n drum1 drum2x.bin
attach drum1 drum2x.bin
; ;
; Создаем рабочий диск. ; Создаем рабочий диск.
@ -43,7 +41,7 @@ attach tty1 /dev/tty
; ;
;set tty1 jcuken,authbs ;set tty1 jcuken,authbs
set tty1 authbs set tty1 authbs
set tty1 log=tty1.txt set -n tty1 log=tty1.txt
; ;
; Разрешаем подключение пользователей по telnet, порт 4199. ; Разрешаем подключение пользователей по telnet, порт 4199.