OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc2/] [or1ksim/] [peripheral/] [ps2kbd.c] - Diff between revs 997 and 1308

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 997 Rev 1308
/* ps2kbd.c -- Very simple (and limited) PS/2 keyboard simulation
/* ps2kbd.c -- Very simple (and limited) PS/2 keyboard simulation
   Copyright (C) 2002 Marko Mlinar, markom@opencores.org
   Copyright (C) 2002 Marko Mlinar, markom@opencores.org
 
 
This file is part of OpenRISC 1000 Architectural Simulator.
This file is part of OpenRISC 1000 Architectural Simulator.
 
 
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
(at your option) any later version.
 
 
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
GNU General Public License for more details.
 
 
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include "ps2kbd.h"
#include "ps2kbd.h"
#include "sim-config.h"
#include "sim-config.h"
#include "abstract.h"
#include "abstract.h"
#include "sched.h"
#include "sched.h"
 
#include "pic.h"
 
 
/* ASCII to scan code conversion table */
/* ASCII to scan code conversion table */
const static struct {
const static struct {
  /* Whether shift must be pressed */
  /* Whether shift must be pressed */
  unsigned char shift;
  unsigned char shift;
  /* Scan code to be generated */
  /* Scan code to be generated */
  unsigned char code;
  unsigned char code;
} scan_table [128] = {
} scan_table [128] = {
/* 0 - 15 */
/* 0 - 15 */
{0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
{0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
{0, 0x0E}, {0, 0x0F}, {0, 0x1C}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
{0, 0x0E}, {0, 0x0F}, {0, 0x1C}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
/* 16 - 31 */
/* 16 - 31 */
{0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
{0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
{0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x01}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
{0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x01}, {0, 0x00}, {0, 0x00}, {0, 0x00}, {0, 0x00},
/* 32 - 47 */
/* 32 - 47 */
{0, 0x39}, {1, 0x02}, {1, 0x28}, {1, 0x04}, {1, 0x05}, {1, 0x06}, {1, 0x08}, {0, 0x28},
{0, 0x39}, {1, 0x02}, {1, 0x28}, {1, 0x04}, {1, 0x05}, {1, 0x06}, {1, 0x08}, {0, 0x28},
{1, 0x0A}, {1, 0x0B}, {1, 0x09}, {1, 0x0D}, {0, 0x33}, {0, 0x0C}, {0, 0x34}, {0, 0x35},
{1, 0x0A}, {1, 0x0B}, {1, 0x09}, {1, 0x0D}, {0, 0x33}, {0, 0x0C}, {0, 0x34}, {0, 0x35},
/* 48 - 63 */
/* 48 - 63 */
{0, 0x0B}, {0, 0x02}, {0, 0x03}, {0, 0x04}, {0, 0x05}, {0, 0x06}, {0, 0x07}, {0, 0x08},
{0, 0x0B}, {0, 0x02}, {0, 0x03}, {0, 0x04}, {0, 0x05}, {0, 0x06}, {0, 0x07}, {0, 0x08},
{0, 0x09}, {0, 0x0A}, {1, 0x27}, {0, 0x27}, {1, 0x33}, {0, 0x0D}, {1, 0x34}, {1, 0x35},
{0, 0x09}, {0, 0x0A}, {1, 0x27}, {0, 0x27}, {1, 0x33}, {0, 0x0D}, {1, 0x34}, {1, 0x35},
/* 64 - 79 */
/* 64 - 79 */
{1, 0x03}, {1, 0x1E}, {1, 0x30}, {1, 0x2E}, {1, 0x20}, {1, 0x12}, {1, 0x21}, {1, 0x22},
{1, 0x03}, {1, 0x1E}, {1, 0x30}, {1, 0x2E}, {1, 0x20}, {1, 0x12}, {1, 0x21}, {1, 0x22},
{1, 0x23}, {1, 0x17}, {1, 0x24}, {1, 0x25}, {1, 0x26}, {1, 0x32}, {1, 0x31}, {1, 0x18},
{1, 0x23}, {1, 0x17}, {1, 0x24}, {1, 0x25}, {1, 0x26}, {1, 0x32}, {1, 0x31}, {1, 0x18},
/* 80 - 95 */
/* 80 - 95 */
{1, 0x19}, {1, 0x10}, {1, 0x13}, {1, 0x1F}, {1, 0x14}, {1, 0x16}, {1, 0x2F}, {1, 0x11},
{1, 0x19}, {1, 0x10}, {1, 0x13}, {1, 0x1F}, {1, 0x14}, {1, 0x16}, {1, 0x2F}, {1, 0x11},
{1, 0x2D}, {1, 0x15}, {1, 0x2C}, {0, 0x1A}, {0, 0x2B}, {0, 0x1B}, {1, 0x07}, {1, 0x0C},
{1, 0x2D}, {1, 0x15}, {1, 0x2C}, {0, 0x1A}, {0, 0x2B}, {0, 0x1B}, {1, 0x07}, {1, 0x0C},
/* 96 - 111 */
/* 96 - 111 */
{0, 0x29}, {0, 0x1E}, {0, 0x30}, {0, 0x2E}, {0, 0x20}, {0, 0x12}, {0, 0x21}, {0, 0x22},
{0, 0x29}, {0, 0x1E}, {0, 0x30}, {0, 0x2E}, {0, 0x20}, {0, 0x12}, {0, 0x21}, {0, 0x22},
{0, 0x23}, {0, 0x17}, {0, 0x24}, {0, 0x25}, {0, 0x26}, {0, 0x32}, {0, 0x31}, {0, 0x18},
{0, 0x23}, {0, 0x17}, {0, 0x24}, {0, 0x25}, {0, 0x26}, {0, 0x32}, {0, 0x31}, {0, 0x18},
/* 112 - 127 */
/* 112 - 127 */
{0, 0x19}, {0, 0x10}, {0, 0x13}, {0, 0x1F}, {0, 0x14}, {0, 0x16}, {0, 0x2F}, {0, 0x11},
{0, 0x19}, {0, 0x10}, {0, 0x13}, {0, 0x1F}, {0, 0x14}, {0, 0x16}, {0, 0x2F}, {0, 0x11},
{0, 0x2D}, {0, 0x15}, {0, 0x2C}, {1, 0x1A}, {1, 0x2B}, {1, 0x1B}, {1, 0x29}, {0, 0x00}
{0, 0x2D}, {0, 0x15}, {0, 0x2C}, {1, 0x1A}, {1, 0x2B}, {1, 0x1B}, {1, 0x29}, {0, 0x00}
};
};
 
 
/* Temporary buffer to store incoming scan codes */
/* Temporary buffer to store incoming scan codes */
static unsigned char kbd_buf[KBD_MAX_BUF] = {0};
static unsigned char kbd_buf[KBD_MAX_BUF] = {0};
 
 
/* Number of scan codes in buffer */
/* Number of scan codes in buffer */
static unsigned long kbd_buf_count = 0;
static unsigned long kbd_buf_count = 0;
static unsigned long kbd_buf_head = 0;
static unsigned long kbd_buf_head = 0;
static unsigned long kbd_buf_tail = 0;
static unsigned long kbd_buf_tail = 0;
 
 
/* Input stream */
/* Input stream */
static FILE *kbd_rxfs = NULL;
static FILE *kbd_rxfs = NULL;
 
 
/* Controller Command (write into 0x64) */
/* Controller Command (write into 0x64) */
static int kbd_ccmd;
static int kbd_ccmd;
 
 
/* Keyboard Command (write into 0x60) */
/* Keyboard Command (write into 0x60) */
static unsigned char kbd_kcmd;
static unsigned char kbd_kcmd;
 
 
/* Controller Command Byte */
/* Controller Command Byte */
static unsigned char kbd_ccmdbyte;
static unsigned char kbd_ccmdbyte;
 
 
/* Keyboard response pending */
/* Keyboard response pending */
static unsigned long kbd_kresp;
static unsigned long kbd_kresp;
 
 
/* Keyboard slowdown factor */
/* Keyboard slowdown factor */
static long kbd_slowdown;
static long kbd_slowdown;
 
 
static void kbd_put (unsigned char c)
static void kbd_put (unsigned char c)
{
{
  if (kbd_buf_count >= KBD_MAX_BUF) {
  if (kbd_buf_count >= KBD_MAX_BUF) {
    fprintf (stderr, "WARNING: Keyboard buffer overflow.\n");
    fprintf (stderr, "WARNING: Keyboard buffer overflow.\n");
  } else {
  } else {
    kbd_buf[kbd_buf_head] = c;
    kbd_buf[kbd_buf_head] = c;
    kbd_buf_head = (kbd_buf_head + 1) % KBD_MAX_BUF;
    kbd_buf_head = (kbd_buf_head + 1) % KBD_MAX_BUF;
    kbd_buf_count++;
    kbd_buf_count++;
  }
  }
}
}
 
 
/* Decodes ascii code c into multiple scan codes, placed into buf, length is returned */
/* Decodes ascii code c into multiple scan codes, placed into buf, length is returned */
static void scan_decode (unsigned char c)
static void scan_decode (unsigned char c)
{
{
  /* Do not handle special characters and extended ascii */
  /* Do not handle special characters and extended ascii */
  if (c >= 128 || !scan_table[c].code)
  if (c >= 128 || !scan_table[c].code)
    return;
    return;
 
 
  /* Make shift? */
  /* Make shift? */
  if (scan_table[c].shift) kbd_put (0x2a);
  if (scan_table[c].shift) kbd_put (0x2a);
  /* Make char */
  /* Make char */
  kbd_put (scan_table[c].code);
  kbd_put (scan_table[c].code);
  /* Break char */
  /* Break char */
  kbd_put (scan_table[c].code | 0x80);
  kbd_put (scan_table[c].code | 0x80);
  /* Break shift? */
  /* Break shift? */
  if (scan_table[c].shift) kbd_put (0xaa);
  if (scan_table[c].shift) kbd_put (0xaa);
}
}
 
 
/* Write a register */
/* Write a register */
void kbd_write8 (unsigned long addr, unsigned long value)
void kbd_write8 (unsigned long addr, unsigned long value)
{
{
  int a = (addr - config.kbd.baseaddr);
  int a = (addr - config.kbd.baseaddr);
  switch (a) {
  switch (a) {
    case KBD_CTRL:
    case KBD_CTRL:
      kbd_ccmd = value & 0xff;
      kbd_ccmd = value & 0xff;
      if (kbd_ccmd == KBD_CCMD_RCB)
      if (kbd_ccmd == KBD_CCMD_RCB)
          kbd_kresp = 0x1;
          kbd_kresp = 0x1;
      if (kbd_ccmd == KBD_CCMD_ST1)
      if (kbd_ccmd == KBD_CCMD_ST1)
          kbd_kresp = 0x1;
          kbd_kresp = 0x1;
      if (kbd_ccmd == KBD_CCMD_ST2)
      if (kbd_ccmd == KBD_CCMD_ST2)
          kbd_kresp = 0x1;
          kbd_kresp = 0x1;
      if (kbd_ccmd == KBD_CCMD_DKI)
      if (kbd_ccmd == KBD_CCMD_DKI)
        kbd_ccmdbyte |= KBD_CCMDBYTE_EN;
        kbd_ccmdbyte |= KBD_CCMDBYTE_EN;
      if (kbd_ccmd == KBD_CCMD_EKI)
      if (kbd_ccmd == KBD_CCMD_EKI)
        kbd_ccmdbyte &= ~KBD_CCMDBYTE_EN;
        kbd_ccmdbyte &= ~KBD_CCMDBYTE_EN;
      if (config.sim.verbose)
      if (config.sim.verbose)
        PRINTF("kbd_write8(%x) %x\n", addr, value);
        PRINTF("kbd_write8(%lx) %lx\n", addr, value);
      break;
      break;
    case KBD_DATA:
    case KBD_DATA:
      if (kbd_ccmd == KBD_CCMD_WCB) {
      if (kbd_ccmd == KBD_CCMD_WCB) {
        kbd_ccmdbyte = value & 0xff;
        kbd_ccmdbyte = value & 0xff;
        kbd_ccmd = 0x00;
        kbd_ccmd = 0x00;
      } else
      } else
        kbd_kcmd = value & 0xff;
        kbd_kcmd = value & 0xff;
      if (kbd_kcmd == KBD_KCMD_DK)
      if (kbd_kcmd == KBD_KCMD_DK)
        kbd_ccmdbyte |= KBD_CCMDBYTE_EN;
        kbd_ccmdbyte |= KBD_CCMDBYTE_EN;
      if (kbd_kcmd == KBD_KCMD_EK)
      if (kbd_kcmd == KBD_KCMD_EK)
        kbd_ccmdbyte &= ~KBD_CCMDBYTE_EN;
        kbd_ccmdbyte &= ~KBD_CCMDBYTE_EN;
      kbd_kresp = 0x1;
      kbd_kresp = 0x1;
      kbd_ccmd = 0x00;
      kbd_ccmd = 0x00;
      if (config.sim.verbose)
      if (config.sim.verbose)
        PRINTF("kbd_write8(%x) %x\n", addr, value);
        PRINTF("kbd_write8(%lx) %lx\n", addr, value);
      break;
      break;
    default:
    default:
      fprintf (stderr, "Write out of keyboard space (0x%08x)!\n", addr);
      fprintf (stderr, "Write out of keyboard space (0x%08lx)!\n", addr);
      runtime.sim.cont_run = 0;
      runtime.sim.cont_run = 0;
      break;
      break;
  }
  }
}
}
 
 
/* Read a register */
/* Read a register */
unsigned long kbd_read8 (unsigned long addr)
unsigned long kbd_read8 (unsigned long addr)
{
{
  int a = (addr - config.kbd.baseaddr);
  int a = (addr - config.kbd.baseaddr);
  switch (a) {
  switch (a) {
    case KBD_CTRL: {
    case KBD_CTRL: {
      unsigned long c = 0x0;
      unsigned long c = 0x0;
      if (kbd_kresp || kbd_buf_count)
      if (kbd_kresp || kbd_buf_count)
        c |= KBD_STATUS_OBF;
        c |= KBD_STATUS_OBF;
      c |= kbd_ccmdbyte & KBD_CCMDBYTE_SYS;
      c |= kbd_ccmdbyte & KBD_CCMDBYTE_SYS;
      c |= KBD_STATUS_INH;
      c |= KBD_STATUS_INH;
      if (config.sim.verbose)
      if (config.sim.verbose)
        PRINTF("kbd_read8(%x) %x\n", addr, c);
        PRINTF("kbd_read8(%lx) %lx\n", addr, c);
      return c;
      return c;
    }
    }
    case KBD_DATA:
    case KBD_DATA:
      if (kbd_ccmd) {
      if (kbd_ccmd) {
        unsigned long rc;
        unsigned long rc;
        if (kbd_ccmd == KBD_CCMD_RCB)
        if (kbd_ccmd == KBD_CCMD_RCB)
          rc = kbd_ccmdbyte;
          rc = kbd_ccmdbyte;
        if (kbd_ccmd == KBD_CCMD_ST1)
        if (kbd_ccmd == KBD_CCMD_ST1)
          rc = 0x55;
          rc = 0x55;
        if (kbd_ccmd == KBD_CCMD_ST2)
        if (kbd_ccmd == KBD_CCMD_ST2)
          rc = 0x00;
          rc = 0x00;
        kbd_ccmd = 0x00;
        kbd_ccmd = 0x00;
        kbd_kresp = 0x0;
        kbd_kresp = 0x0;
        if (config.sim.verbose)
        if (config.sim.verbose)
          PRINTF("kbd_read8(%x) %x\n", addr, rc);
          PRINTF("kbd_read8(%lx) %lx\n", addr, rc);
        return rc;
        return rc;
      }
      }
      else if (kbd_kresp) {
      else if (kbd_kresp) {
        unsigned long rc;
        unsigned long rc;
        if (kbd_kresp == 0x2) {
        if (kbd_kresp == 0x2) {
          kbd_kresp = 0x0;
          kbd_kresp = 0x0;
          rc = KBD_KRESP_RSTOK;
          rc = KBD_KRESP_RSTOK;
        } else if (kbd_kcmd == KBD_KCMD_RST) {
        } else if (kbd_kcmd == KBD_KCMD_RST) {
          kbd_kresp = 0x2;
          kbd_kresp = 0x2;
          rc = KBD_KRESP_ACK;
          rc = KBD_KRESP_ACK;
        } else if (kbd_kcmd == KBD_KCMD_ECHO) {
        } else if (kbd_kcmd == KBD_KCMD_ECHO) {
          kbd_kresp = 0x0;
          kbd_kresp = 0x0;
          rc = KBD_KRESP_ECHO;
          rc = KBD_KRESP_ECHO;
        } else {
        } else {
          kbd_kresp = 0x0;
          kbd_kresp = 0x0;
          rc = KBD_KRESP_ACK;
          rc = KBD_KRESP_ACK;
        }
        }
        kbd_kcmd = 0x00;
        kbd_kcmd = 0x00;
        if (config.sim.verbose)
        if (config.sim.verbose)
          PRINTF("kbd_read8(%x) %x\n", addr, rc);
          PRINTF("kbd_read8(%lx) %lx\n", addr, rc);
        return rc;
        return rc;
      } else if (kbd_buf_count) {
      } else if (kbd_buf_count) {
        unsigned long c = kbd_buf[kbd_buf_tail];
        unsigned long c = kbd_buf[kbd_buf_tail];
        kbd_buf_tail = (kbd_buf_tail + 1) % KBD_MAX_BUF;
        kbd_buf_tail = (kbd_buf_tail + 1) % KBD_MAX_BUF;
        kbd_buf_count--;
        kbd_buf_count--;
        kbd_kresp = 0x0;
        kbd_kresp = 0x0;
        if (config.sim.verbose)
        if (config.sim.verbose)
          PRINTF("kbd_read8(%x) %x\n", addr, c);
          PRINTF("kbd_read8(%lx) %lx\n", addr, c);
        return c;
        return c;
      }
      }
      kbd_kresp = 0x0;
      kbd_kresp = 0x0;
      if (config.sim.verbose)
      if (config.sim.verbose)
        PRINTF("kbd_read8(%x) fifo empty\n", addr);
        PRINTF("kbd_read8(%lx) fifo empty\n", addr);
      return 0;
      return 0;
    default:
    default:
      fprintf (stderr, "Read out of keyboard space (0x%08x)!\n", addr);
      fprintf (stderr, "Read out of keyboard space (0x%08lx)!\n", addr);
      runtime.sim.cont_run = 0;
      runtime.sim.cont_run = 0;
      return 0;
      return 0;
  }
  }
}
}
 
 
 
 
/* Simulation hook. Must be called every couple of clock cycles to simulate incomming data. */
/* Simulation hook. Must be called every couple of clock cycles to simulate incomming data. */
void kbd_job(int param)
void kbd_job(int param)
{
{
  int c;
  int c;
  int kbd_int = 0;
  int kbd_int = 0;
  /* Check if there is something waiting, and decode it into kdb_buf */
  /* Check if there is something waiting, and decode it into kdb_buf */
  if((c = fgetc(kbd_rxfs)) != EOF) {
  if((c = fgetc(kbd_rxfs)) != EOF) {
    scan_decode (c);
    scan_decode (c);
  }
  }
  kbd_int = kbd_kresp || kbd_buf_count;
  kbd_int = kbd_kresp || kbd_buf_count;
  kbd_int = kbd_kresp || kbd_buf_count ? kbd_ccmdbyte & KBD_CCMDBYTE_INT : 0;
  kbd_int = kbd_kresp || kbd_buf_count ? kbd_ccmdbyte & KBD_CCMDBYTE_INT : 0;
  if (config.sim.verbose && kbd_int)
  if (config.sim.verbose && kbd_int)
    PRINTF("Keyboard Interrupt.... kbd_kresp %x  kbd_buf_count %x \n", kbd_kresp, kbd_buf_count);
    PRINTF("Keyboard Interrupt.... kbd_kresp %lx  kbd_buf_count %lx \n",
 
           kbd_kresp, kbd_buf_count);
  if (kbd_int) report_interrupt(config.kbd.irq);
  if (kbd_int) report_interrupt(config.kbd.irq);
  SCHED_ADD(kbd_job, 0, runtime.sim.cycles + kbd_slowdown);
  SCHED_ADD(kbd_job, 0, runtime.sim.cycles + kbd_slowdown);
}
}
 
 
/* Reset all VGAs */
/* Reset all VGAs */
void kbd_reset ()
void kbd_reset ()
{
{
  if (config.kbd.enabled) {
  if (config.kbd.enabled) {
    kbd_buf_count = 0;
    kbd_buf_count = 0;
    kbd_buf_head = 0;
    kbd_buf_head = 0;
    kbd_buf_tail = 0;
    kbd_buf_tail = 0;
    kbd_kresp = 0x0;
    kbd_kresp = 0x0;
    kbd_ccmdbyte = 0x65; /* We reset into default normal operation. */
    kbd_ccmdbyte = 0x65; /* We reset into default normal operation. */
    register_memoryarea(config.kbd.baseaddr, KBD_SPACE, 1, 0, kbd_read8, kbd_write8);
    register_memoryarea(config.kbd.baseaddr, KBD_SPACE, 1, 0, kbd_read8, kbd_write8);
 
 
    if (!(kbd_rxfs = fopen(config.kbd.rxfile, "r"))
    if (!(kbd_rxfs = fopen(config.kbd.rxfile, "r"))
     && !(kbd_rxfs = fopen(config.kbd.rxfile, "r+"))) {
     && !(kbd_rxfs = fopen(config.kbd.rxfile, "r+"))) {
      fprintf (stderr, "WARNING: Keyboard has problems with RX file stream.\n");
      fprintf (stderr, "WARNING: Keyboard has problems with RX file stream.\n");
      config.kbd.enabled = 0;
      config.kbd.enabled = 0;
    }
    }
    kbd_slowdown = (long) ((config.sim.system_kfreq * 1000.) / KBD_BAUD_RATE);
    kbd_slowdown = (long) ((config.sim.system_kfreq * 1000.) / KBD_BAUD_RATE);
    if (kbd_slowdown <= 0) kbd_slowdown = 1;
    if (kbd_slowdown <= 0) kbd_slowdown = 1;
    if (config.kbd.enabled) SCHED_ADD(kbd_job, 0, runtime.sim.cycles + kbd_slowdown);
    if (config.kbd.enabled) SCHED_ADD(kbd_job, 0, runtime.sim.cycles + kbd_slowdown);
  }
  }
}
}
 
 
 
 
void kbd_info()
void kbd_info()
{
{
        PRINTF("kbd_kcmd: %x\n", kbd_kcmd);
        PRINTF("kbd_kcmd: %x\n", kbd_kcmd);
        PRINTF("kbd_ccmd: %x\n", kbd_ccmd);
        PRINTF("kbd_ccmd: %x\n", kbd_ccmd);
        PRINTF("kbd_ccmdbyte: %x\n", kbd_ccmdbyte);
        PRINTF("kbd_ccmdbyte: %x\n", kbd_ccmdbyte);
        PRINTF("kbd_kresp: %x\n", kbd_kresp);
        PRINTF("kbd_kresp: %lx\n", kbd_kresp);
        PRINTF("kbd_buf_count: %x\n", kbd_buf_count);
        PRINTF("kbd_buf_count: %lx\n", kbd_buf_count);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.