BESM6: Added TTY interrupt insertion in the idle loop.

This commit is contained in:
Leo Broukhis 2015-01-04 02:28:07 -08:00
parent c2975c8e0e
commit a7f05ac40c
4 changed files with 9 additions and 9 deletions

View file

@ -1427,17 +1427,15 @@ void cpu_one_inst ()
/* Не находимся ли мы в цикле "ЖДУ" диспака? */
if (RUU == 047 && PC == 04440 && RK == 067704440) {
/* Притормаживаем выполнение каждой команды холостого цикла,
* чтобы быстрее обрабатывались прерывания: ускоряются
* терминалы и АЦПУ. */
delay = sim_interval;
/* Если периферия простаивает, освобождаем процессор
* до следующего тика таймера. */
if (vt_is_idle() &&
printer_is_idle() && fs_is_idle()) {
check_initial_setup ();
sim_idle (0, TRUE);
} else if (sim_activate_time(tty_unit) > 1000*MSEC/300) {
/* Insert a TTY interrupt if a regular one is too far away */
sim_activate_abs(tty_unit, 0);
}
}
}

View file

@ -127,6 +127,7 @@ enum {
#define CLK_DELAY 4000 /* Uncalibrated instructions per clock tick */
extern UNIT cpu_unit;
extern UNIT tty_unit[];
extern t_value memory [MEMSIZE];
extern t_value pult [8];
extern uint32 PC, RAU, RUU;
@ -398,6 +399,7 @@ t_value besm6_unpack (t_value val, t_value mask);
#define GRP_CHAN5_FREE 00000000400000000LL /* 27 */
#define GRP_CHAN6_FREE 00000000200000000LL /* 26 */
#define GRP_CHAN7_FREE 00000000100000000LL /* 25 */
#define GRP_SERIAL 00000000001000000LL /* 19 */
#define GRP_WATCHDOG 00000000000002000LL /* 11 */
#define GRP_SLOW_CLK 00000000000001000LL /* 10 */
/* Внутренние: */

View file

@ -172,7 +172,7 @@ t_stat vt_clk (UNIT * this)
/* Телетайпы работают на 10 бод */
static int clk_divider = 1<<29;
GRP |= MGRP & BBIT(19);
GRP |= MGRP & GRP_SERIAL;
/* Опрашиваем сокеты на приём. */
tmxr_poll_rx (&tty_desc);
@ -1137,7 +1137,6 @@ void vt_receive()
}
if (tty_typed[num] < 0) {
/* TODO: обработать исключение от "неоператорского" терминала */
// sim_interval = 0;
break;
}
if (tty_typed[num] <= 0177) {
@ -1148,7 +1147,7 @@ void vt_receive()
tty_instate[num] = 1;
TTY_IN |= mask; /* start bit */
GRP |= GRP_TTY_START; /* не используется ? */
MGRP |= BBIT(19); /* для терминалов по методу МГУ */
MGRP |= GRP_SERIAL; /* для терминалов по методу МГУ */
vt_receiving |= mask;
}
break;

View file

@ -1,5 +1,6 @@
set -n console log=log.txt
set console debug=log
set cpu idle
;set cpu debug
;set mmu debug
;set drum debug
@ -40,7 +41,7 @@ attach tty1 /dev/tty
; Режимы по вкусу
;
;set tty1 jcuken,authbs
set tty1 authbs
set tty1 qwerty,authbs
set -n tty1 log=tty1.txt
;