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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [vga.c] - Diff between revs 1350 and 1358

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1350 Rev 1358
Line 16... Line 16...
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 <stdio.h>
#include <stdio.h>
 
#include <string.h>
 
 
#include "config.h"
#include "config.h"
 
 
#ifdef HAVE_INTTYPES_H
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#include <inttypes.h>
Line 259... Line 260...
      register_memoryarea(config.vgas[i].baseaddr, VGA_ADDR_SPACE, 4, 0, vga_read32, vga_write32);
      register_memoryarea(config.vgas[i].baseaddr, VGA_ADDR_SPACE, 4, 0, vga_read32, vga_write32);
    SCHED_ADD(vga_job, i, runtime.sim.cycles + config.vgas[i].refresh_rate);
    SCHED_ADD(vga_job, i, runtime.sim.cycles + config.vgas[i].refresh_rate);
  }
  }
}
}
 
 
 No newline at end of file
 No newline at end of file
 
/*----------------------------------------------------[ VGA Configuration ]---*/
 
void vga_nvgas(union param_val val, void *dat)
 
{
 
  if (val.int_val >= 0 && val.int_val < MAX_VGAS)
 
    config.nvgas = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid number of devices.");
 
}
 
 
 
void vga_baseaddr(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.nvgas)
 
    config.vgas[current_device].baseaddr = val.addr_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void vga_irq(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.nvgas)
 
    config.vgas[current_device].irq = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void vga_refresh_rate(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.nvgas)
 
    config.vgas[current_device].refresh_rate = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void vga_filename(union param_val val, void *dat)
 
{
 
  if (current_device >= 0 && current_device < config.nvgas)
 
    strcpy (config.vgas[current_device].filename, val.str_val);
 
  else
 
    CONFIG_ERROR("invalid device number.");
 
}
 
 
 
void reg_vga_sec(void)
 
{
 
  struct config_section *sec = reg_config_sec("vga", NULL, NULL);
 
 
 
  reg_config_param(sec, "nvgas", paramt_int, vga_nvgas);
 
  reg_config_param(sec, "device", paramt_int, change_device);
 
  reg_config_param(sec, "baseaddr", paramt_addr, vga_baseaddr);
 
  reg_config_param(sec, "irq", paramt_int, vga_irq);
 
  reg_config_param(sec, "refresh_rate", paramt_int, vga_refresh_rate);
 
  reg_config_param(sec, "filename", paramt_str, vga_filename);
 
  reg_config_param(sec, "enddevice", paramt_none, end_device);
 
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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