Commit | Line | Data |
---|---|---|
aea481da DE |
1 | /* Copyright (C) 1998, Cygnus Solutions |
2 | ||
3 | */ | |
4 | ||
5 | #include "sim-main.h" | |
6 | ||
803f52b9 DE |
7 | #include "sky-device.h" |
8 | #include "sky-vu0.h" | |
aea481da | 9 | |
f0bb94cd FCE |
10 | static char* vu0_mem0_buffer = 0; |
11 | static char* vu0_mem1_buffer = 0; | |
12 | ||
aea481da DE |
13 | |
14 | void | |
52793fab | 15 | vu0_issue(void) |
aea481da DE |
16 | { |
17 | } | |
18 | ||
52793fab | 19 | static int |
aea481da DE |
20 | vu0_io_read_buffer(device *me, |
21 | void *dest, | |
22 | int space, | |
23 | address_word addr, | |
24 | unsigned nr_bytes, | |
25 | sim_cpu *processor, | |
26 | sim_cia cia) | |
27 | { | |
28 | printf("%s: Read!\n", me->name); | |
29 | return nr_bytes; | |
30 | } | |
31 | ||
52793fab | 32 | static int |
aea481da DE |
33 | vu0_io_write_buffer(device *me, |
34 | const void *source, | |
35 | int space, | |
36 | address_word addr, | |
37 | unsigned nr_bytes, | |
38 | sim_cpu *processor, | |
39 | sim_cia cia) | |
40 | { | |
41 | printf("%s: Write!\n", me->name); | |
42 | return nr_bytes; | |
43 | } | |
44 | ||
45 | device vu0_device = | |
46 | { | |
47 | "vu0", | |
48 | &vu0_io_read_buffer, | |
49 | &vu0_io_write_buffer | |
50 | }; | |
51 | ||
52 | void | |
53 | vu0_attach(SIM_DESC sd) | |
54 | { | |
55 | sim_core_attach (sd, | |
56 | NULL, | |
57 | 0 /*level*/, | |
58 | access_read_write, | |
59 | 0 /*space ???*/, | |
60 | VU0_REGISTER_WINDOW_START, | |
61 | VU0_REGISTER_WINDOW_SIZE /*nr_bytes*/, | |
62 | 0 /*modulo*/, | |
63 | &vu0_device, | |
64 | NULL /*buffer*/); | |
65 | ||
f0bb94cd | 66 | vu0_mem0_buffer = zalloc(VU0_MEM0_SIZE); |
aea481da DE |
67 | sim_core_attach (sd, |
68 | NULL, | |
69 | 0 /*level*/, | |
70 | access_read_write, | |
71 | 0 /*space ???*/, | |
72 | VU0_MEM0_WINDOW_START, | |
73 | VU0_MEM0_SIZE /*nr_bytes*/, | |
74 | 0 /*modulo*/, | |
75 | 0 /*device*/, | |
f0bb94cd | 76 | vu0_mem0_buffer /*buffer*/); |
aea481da | 77 | |
f0bb94cd | 78 | vu0_mem1_buffer = zalloc(VU0_MEM1_SIZE); |
aea481da DE |
79 | sim_core_attach (sd, |
80 | NULL, | |
81 | 0 /*level*/, | |
82 | access_read_write, | |
83 | 0 /*space ???*/, | |
84 | VU0_MEM1_WINDOW_START, | |
85 | VU0_MEM1_SIZE /*nr_bytes*/, | |
86 | 0 /*modulo*/, | |
87 | 0 /*device*/, | |
f0bb94cd | 88 | vu0_mem1_buffer /*buffer*/); |
aea481da | 89 | } |