old-cross-binutils/sim/mips/sky-vu0.c
Frank Ch. Eigler f0bb94cd67 * Major endianness fixes on sky code today. The milestone sample and existing
PKE tests run identically on SPARC/Solaris and x86/Linux.

	* sky-pke.c (pke_io_{read,write}_buffer): Endianness fixes aka
 	"E-fixes" in register and FIFO read/writes.
	(pke_code_{pkemscalf,pkemscal}): E-fixes in VU CIA setting.
	(pke_code_{mpg,unpack}): E-fixes in VU memory & tracking updates.
	(pke_code_direct): E-fixes in GPUIF FIFO stuffing.

	* sky-pke.h (PKE_MEM_WRITE): E-fixes in trace file writing.

	* sky-vu0.c (vu0_attach): Allocate micro/data memory with zalloc
 	to guarantee sufficient (16-byte) alignment.

	* sky-vu1.c (vu1_attach): Ditto.
	(vu1_io_read_register_window): *PARTIAL* E-fixes in register accesses.

	* sky-libvpe.c (gif_write): E-fixes in GPUIF FIFO stuffing.

	* sky-gpuif.c (gif_io_{read,write}_buffer): E-fixes in
 	register and FIFO read/writes.

	* sky-dma.c (do_dma_transfer_tag): E-fixes in tag reading.
1998-02-27 21:52:40 +00:00

89 lines
2.1 KiB
C

/* Copyright (C) 1998, Cygnus Solutions
*/
#include "sim-main.h"
#include "sky-device.h"
#include "sky-vu0.h"
static char* vu0_mem0_buffer = 0;
static char* vu0_mem1_buffer = 0;
void
vu0_issue(void)
{
}
static int
vu0_io_read_buffer(device *me,
void *dest,
int space,
address_word addr,
unsigned nr_bytes,
sim_cpu *processor,
sim_cia cia)
{
printf("%s: Read!\n", me->name);
return nr_bytes;
}
static int
vu0_io_write_buffer(device *me,
const void *source,
int space,
address_word addr,
unsigned nr_bytes,
sim_cpu *processor,
sim_cia cia)
{
printf("%s: Write!\n", me->name);
return nr_bytes;
}
device vu0_device =
{
"vu0",
&vu0_io_read_buffer,
&vu0_io_write_buffer
};
void
vu0_attach(SIM_DESC sd)
{
sim_core_attach (sd,
NULL,
0 /*level*/,
access_read_write,
0 /*space ???*/,
VU0_REGISTER_WINDOW_START,
VU0_REGISTER_WINDOW_SIZE /*nr_bytes*/,
0 /*modulo*/,
&vu0_device,
NULL /*buffer*/);
vu0_mem0_buffer = zalloc(VU0_MEM0_SIZE);
sim_core_attach (sd,
NULL,
0 /*level*/,
access_read_write,
0 /*space ???*/,
VU0_MEM0_WINDOW_START,
VU0_MEM0_SIZE /*nr_bytes*/,
0 /*modulo*/,
0 /*device*/,
vu0_mem0_buffer /*buffer*/);
vu0_mem1_buffer = zalloc(VU0_MEM1_SIZE);
sim_core_attach (sd,
NULL,
0 /*level*/,
access_read_write,
0 /*space ???*/,
VU0_MEM1_WINDOW_START,
VU0_MEM1_SIZE /*nr_bytes*/,
0 /*modulo*/,
0 /*device*/,
vu0_mem1_buffer /*buffer*/);
}