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

Subversion Repositories aoocs

[/] [aoocs/] [trunk/] [doc/] [doxygen/] [html/] [page_notes.html] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<title>aoOCS: Design notes</title>
6
<link href="tabs.css" rel="stylesheet" type="text/css"/>
7
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
8
</head>
9
<body>
10
<!-- Generated by Doxygen 1.7.2 -->
11
<div class="navigation" id="top">
12
  <div class="tabs">
13
    <ul class="tablist">
14
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
15
      <li><a href="annotated.html"><span>Design&#160;Unit&#160;List</span></a></li>
16
      <li><a href="files.html"><span>Files</span></a></li>
17
    </ul>
18
  </div>
19
  <div class="navpath">
20
    <ul>
21
      <li><a class="el" href="index.html">index</a>      </li>
22
    </ul>
23
  </div>
24
</div>
25
<div class="header">
26
  <div class="headertitle">
27
<h1>Design notes </h1>  </div>
28
</div>
29
<div class="contents">
30
<div class="fragment"><pre class="fragment">/*
31
TODO:
32
- testbench specification
33
- on OpenCores page formating: &lt;p class="cmd"&gt;make all&lt;/p&gt;
34
- WISHBONE datasheet: additional: maximum operand size
35
- ao68000: clean Dn, An RAM
36
*/
37
 
38
/*
39
Agnus: Address Generator Unit
40
    - Chip ram arbiter
41
        - odd clock (?) cycles: custom chips
42
        - even clock (?) cycles: CPU - 68000 can access memory every second clock cycle
43
    - color clocks: 280 ns, 281.94, one memory access cycle
44
        - 2 low resolution pixels 140 ns each
45
        - 4 high resolution pixels 70 ns each
46
        - can be synchronized to external source
47
    - DMA channels
48
    - copper: co-processor
49
        - finite state machine
50
        - executes programmed instruction stream: copper list
51
        - synchronized with video hardware
52
        - 3 states: read instruction, execute instruction, wait for beam position
53
        - reexecution at every new video frame
54
        - instructions: each four bytes
55
            - MOVE: write 16-bit value into chipset hardware register
56
            - WAIT: wait for beam position or blitter operation finish
57
            - SKIP: skip the following istruction if beam position already reached
58
        - each GUI screen can have a different resolution
59
        - S-HAM: sliced-HAM: swith palette on every scanline, improving HAM mode
60
 
61
    - blitter: block image transfer, bit blit
62
        - memory transfer
63
        - logic operation unit
64
        - 3 modes: copy memory block, fill block, line draw
65
            - copies memory images: BLOBS: blitter objects
66
            - copy direction: start-end, end-start
67
            - A,B,C sources -&gt; D destination
68
            - width: multiple of 16 bits, height: in lines, stride: end of line to next line
69
            - barrel shift: 0 to 15 bits
70
            - BLOB: GUI windows
71
        - lines: Bresenham algorithm, single pixel thick
72
            - 16-bit repeating pattern
73
        - fill: each line from right to left
74
            - set pixel: toggle filling mode
75
*/
76
 
77
/*
78
Paula:
79
    - 4 independant DMA channels
80
        - 8-bit PCM: signed, linear, two's complement
81
        - hardware-mixed: two to left, two to right
82
    - every channel has an independent:
83
        - 65 level volume
84
        - frequency: sample rates from 20 kHz to 28867 Hz: time limit for Paula DMA ordered with video timing
85
    - audio hardware: four states machines: each having eight states
86
    - frequency or amplitude modulation
87
    - interrupts
88
    - floppy disk drive
89
        - read and write MFM or GCD data
90
        - DMA or programmed I/O
91
        - sync-on-word - $4489 for MFM
92
        - usage:
93
            - MFM encoding(3-pass) / decoding(1-pass) is usually performed by the blitter
94
            - usually one track at once, not sector-by-sector
95
    - serial port
96
        - programmed I/O only
97
        - no FIFO buffer
98
        - all possible bit rates
99
    - analog joystick
100
*/
101
 
102
/*
103
Audio notes:
104
 
105
- 1 word = 2 samples for every channel - for every line
106
- channel 1,2: left; 0,3: right;
107
- 8-bit signed samples
108
- pointer is word aligned; location and internal pointer, length also copied
109
- length: in words
110
- volume: 6 bits +1 max: 0-none, 63, 64 max
111
- frequency: clock ticks per sample; countdown - when 0 - next sample to DAC; min 123 (PAL), max 65535; when too fast - repeat sample
112
- after stop DMA - replay from start location;
113
- interrupt after copy of location and length is made - at the beginning
114
- modulate higher channel; when on - turn off audio output, even on channel 3; write new value of amplitude or period when countdown
115
    - volume: 7 bits; period: 16 bits; both: alternating volume, period
116
- lowpass filter at 7 kHz; can be disabled; min sampling rate = fmax + 7kHz; 124-256 no aliasing distortion
117
- direct mode: 1 word at a time; interrupt after these two samples; last value stays
118
*/
119
 
120
/* video notes:
121
 
122
640/16=40 fetches, 5 bitplanes x40 = 200 cycles, NTSC: 227.5 total, 226 usable, E0 = 224,
123
always: 4 memory refresh, 3 disk DMA, 4 audio DMA = 11 cycles
124
sometimes: 16 sprite DMA
125
rest: copper, blitter, 68000
126
 
127
68000 PAL: 7.09379 MHz /PAL standard=7.09375MHz/ = 2 cycles = 281.9367 ns = color cycle
128
68000 NTSC: 7.15909 MHz = 2 cycles = 279.3651 ns = color cycle
129
 
130
PAL 15.625kHz = 64 us = 227.00128 color cycles
131
PAL hsync 4.7 us, back 5.65 us, image 52 us, front 1.65 us
132
hsync = 16.67 color cycles
133
vsync = 25*64 us = 1.6 ms
134
 
135
NTSC 15.734kHz =  63.5566 us = 227.5038 color cycles
136
 
137
Displayable: 52 us, Not displayable: 12 us
138
Master PAL oscillator: 28.37516 MHz
139
PAL colorburst: 4.43361875 MHz = 5/4 * 3.546895 MHz /a500plus_sm/
140
7M: 7.09379 MHz - processor
141
C1: 3.546895 MHz - color clock
142
 
143
"Here is the solution I have found based on the ITU-601/656 standards:
144
Clock source: 27MHz.
145
27,000,000 / 429 x 455 = 28,636,363 (NTSC clock, 0 ppm)
146
27,000,000 / 432 x 454 = 28,375,000 (PAL clock, 6 ppm)"
147
http://www.opencircuits.com/Minimig_NTSC
148
 
149
"The PAL TV signal has 283.7516 color subcarrier cycles per scanline, 312.5 scanlines per field,
150
and 50 fields per second, so that gives us a color subcarrier frequency of 283.7516 * 312.5 * 50,
151
which equals 4433618.75 Hz, or 4.43361875 MHz. But the PAL Atari generates 228 color clocks per
152
scanline (the same as the NTSC Atari), and then it converts those 228 color clocks into a PAL signal.
153
Note that the PAL Atari's 228 color clocks per scanline are *not* drawn at the NTSC rate
154
(which is roughly 3579545 Hz). I'm not sure about the PAL Atari numbers, but I *think* that each of the
155
228 color clocks (which are neither NTSC color clocks nor PAL color clocks) have a rate of
156
283.7516 * 312.5 * 50 * 4 / 5 (or four-fifths the rate of a PAL color clock), which equals 3546895 Hz, or 3.546895 MHz.
157
Assuming the above formula is correct, you can calculate the exact PAL Atari framerate as
158
FR = 283.7516 * 312.5 * 50 * 4 / 5 / 228 / SL. So a 312-line frame has a framerate of approximately 49.86076 Hz."
159
http://atari2600.org/pipermail/stella/2008-May/020514.html
160
 
161
Characteristics
162
B,G/PAL
163
Number of lines per picture (frame): 625
164
Field frequency, nominal value (fields/s): 50
165
Line frequency (Hz): 15625±0.0001%
166
Nominal line period (µs): 64
167
Line-blanking interval (µs): 12±0.3
168
"Active" scanlines per field : 287.5 (288)
169
http://lipas.uwasa.fi/~f76998/video/modes/
170
 
171
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
172
 
173
Vertical PAL:
174
Vertical blank: 0 - 29 ($1D)
175
Displayable no LACE: 312.5 - 29 = 283.5 = 283
176
Displayable LACE:    625 - (29*2) = 567
177
Limit VSTART: 0-255
178
Normal VSTART: 44 ($2C) - PAL+NTSC
179
Limit VSTOP /complement MSB/: 128 ($80) to 383-256=127 ($17F,$7F)
180
Normal VSTOP: 300-256=44 ($12C,2C) - PAL, $F4 for NTSC
181
 
182
Horizontal:
183
DDF: 4 lowres pixel resolution = 1.0 color clock, recommended 16 pixel resolution, PAL+NTSC;
184
DW: always lowres non-interlace, 1 lowres pixel resolution = 0.5 color clock
185
HW DDFSTRT limit: 24 ($18)
186
HW DDFSTOP limit: 216 ($D8) --&gt; 192 color clocks, for PAL+NTSC; but custom.c says: HARD_DDF_STOP = 0xD4
187
25 lowres word/bitmap fetches, 49 hires word/bitmap fetches (on $D8 only one word fetch)
188
horizontal blanking limits to 23 lowres words/bitmap = 368 lowres pixels
189
Normal lowres DDFSRT: 56 ($38) = $81/2-8.5=$38, below: disables some sprites; DDFSTOP: 208 ($D0)
190
Normal hires DDFSRT: 60 ($3C) = $81/2-4.5=$3C; DDFSTOP: 212 ($D4)
191
 
192
DDFSTOP - DDFSTRT = (8(fetches per word) * (word/bitmap count - 1)) for low resolution
193
DDFSTOP - DDFSTRT = (4(fetches per word) * (word/bitmap count - 2)) for high resolution
194
 
195
160 = 4x40; 640 = 16x40; 160 = 4x(640/16)
196
 
197
Limit HSTART: 0 to 255; HSTOP: /-256/: 256=0 to 511-256=255
198
Normal HSTART: 129 ($81) - PAL+NTSC; HSTOP: 449-256=193 ($1C1,$C1) - PAL+NTSC
199
 
200
Horizontal blank limit = Displayable: 368 lowres pixels = 23 words/bitmap = 184 color clocks =  - PAL+NTSC
201
 
202
1 word fetch = 1 color clock
203
4.5 color clock from first fetch to disply
204
 
205
VPOSR: identification bits
206
http://www.winnicki.net/amiga/memmap/VPOSR.html
207
 
208
*********
209
audio maximum sampling rate: PAL: 28,867 samples/s, 123 ticks/sample
210
*/
211
 
212
/*
213
Denise:
214
    - video: no overlay:
215
        - lowres: 320x256
216
        - hires: 640x256
217
    - interlace: double vertical size
218
    - wide overscan: no border around graphics
219
    - can be synchronized to external source: genlock
220
        - 1-bit output: is Amiga generating backround color or not
221
    - bitplanes: 1 to 5
222
        - fetch bits and perform color lookup
223
    - palette of 4096 colors
224
    - 6th bitplane for:
225
        - Extra-Halfbright mode: if pixel set: brightness of regular 32 color pixel is halved
226
        - Hold and Modify mode, 4096 colors on screen at once, 6-bit pixel: 2-bit control + 4-bit data:
227
            - set(data - regular color lookup)
228
            - modify-red, modify-green, modify-blue (data - modify that component, leave rest unchanged)
229
        - dual-playfield: two playfields with 8 colors each
230
            - drawn on top of each other
231
            - independant scrolling
232
            - backround color of top field displays bottom field
233
    - 8 sprites on top of graphics
234
        - detect collision between: sprites, sprites and bachground
235
        - 3 visible colors and one transparent
236
        - attached sprites: 2 sprites attached making a single 15 color sprite
237
    - sub-pixel scrolling
238
    - mouse and joystick input
239
*/
240
 
241
/* Floppy notes:
242
 
243
ID shift register:
244
1) motor on -&gt; off
245
2) SEL* inactive
246
3) SEL* inactive -&gt; SEL* active -&gt; read RDY* -&gt;
247
MSB first, inversion needed to get $FFFF FFFF Amiga drive ID
248
 
249
fl_rdy_n: motor full speed - only when fl_mtr_n active OR id mode
250
fl_chg_n: inactive when reset or no floppy, active when selected and step
251
fl_wpro_n: asserted when selected
252
fl_tk0_n: asserted when slected and head over track 0
253
fl_index_n: once per revolution, between sectors
254
 
255
fl_mtr_n: clocked on SEL* inactive -&gt; SEL* active, LED control
256
fl_side_n: inactive: side 0, active: side 1
257
fl_step_n: selected drive step pulse
258
fl_dir: inactive: higher tracks, active: lower tracks, seperate write than fl_step_n
259
 
260
floppy_syn_irq - always on sync word, independent of adk_con
261
floppy_blk_irq - DMA complete
262
 
263
DMA read and write one track every revolution
264
Synchronize CPU with specific data
265
Read single bytes
266
 
267
adk_con
268
    [14:13] precompensation,                                                                    not used
269
    [12]    0 - GCR precompensation, 1 - MFM precompensation, only MFM supported,               not used
270
    [10]    1 - synchronize on DSKSYNC and start DMA - read from next word,
271
 
272
    [9]     1 - synchronize on MSB for GCD,                                                     not used
273
    [8]     1 - 2us for bit of MFM, 0 - 4us for bit of GCD,                                     not used
274
 
275
dskptr - address, bit 0 always 0
276
 
277
dsklen
278
    [15]    secondary DMA enable
279
    [14]    DMA write
280
            second write with [15:14] == 2'b11 starts DMA write to floppy
281
            single write with [15:14] == 2'b0X resets counter
282
            second write with [15:14] == 2'b10 starts DMA read from floppy
283
    [13:0]  number of words move
284
 
285
dskbytr
286
    [15]    1 - byte read ready, cleaned after read
287
    [14]    1 - DMA is on: in DMACON and DSKLEN
288
    [13]    dsklen[14]
289
    [12]    dsksync match, for at least 2us
290
    [7:0]   read byte
291
 
292
dsksync - sync word
293
 
294
 
295
transfer: dskptr += 2; size -= 1;
296
DMA write: last 3 bits lost
297
DMA read: last word may not be read, single byte read: always ok (?),       (implemented: always all words read)
298
 
299
80 cylinders/160 tracks
300
Track: gap (nulls) | 11 sectors
301
Sector MFM encoded:
302
 
303
odd bits of segment, even bits of segment
304
 
305
encoding: data -&gt; MFM
306
1 -&gt; 01
307
 
308
 
309
MFM sync mark value: $4489
310
 
311
checksum: simple XOR
312
*/
313
 
314
/* vga_eth_capture notes:
315
 
316
Send UDP packet:
317
ethernet
318
    dest mac(6), src mac(6), type(2 = 0x0800 IPv4)
319
ip
320
    version,header([1] = 0x45), tos([1] = 0x00), length([2] = 4*5 + 4*2 + len = 990 = 0x03DE)
321
    id([2] = 0x0000), flags,offset([2] = 0x40, 0x00)
322
    ttl([1] = 0x0F), protocol([1] = 0x11), header checksum([2] = 0)
323
    source ip([4])
324
    dest ip([4])
325
udp
326
    source port([2]), dest port([2])
327
    length([2] = 8 + len = 970 = 0x03CA), checksum([2] = 0)
328
data
329
    (len = line num(2) + line(640*12/8 = 960) = 962)
330
 
331
--full ethernet packet len = 990 + 14 = 1004 = 0x03EC
332
 
333
DM9000A control to send:
334
    set IMR(FFh = 0x80)
335
 
336
    set checksum reg (31h = 0x05)
337
 
338
    set early transmit (30h = 0x83) ? threshold 75%
339
 
340
    power-up PHY (1Fh = 0x00)
341
 
342
    dummy MWCDM ?
343
 
344
    DO
345
 
346
        packet I
347
        set MWCMD(F8h = 16-bit data)
348
 
349
        wait for packet II
350
        read TX(02h bit 0 == 0)
351
 
352
        set TXPLL(FCh = low byte)
353
        set TXPLH(FDh = high byte)
354
 
355
        write TX(02h 0x01)
356
 
357
        packet II
358
        set MWCMD(F8h = 16-bit data)
359
 
360
        wait for packet I
361
        read TX(02h bit 0 == 0)
362
 
363
        set TXPLL(FCh = low byte)
364
        set TXPLH(FDh = high byte)
365
 
366
        write TX(02h 0x01)
367
 
368
    LOOP
369
*/
370
 
371
/* bus_terminator notes:
372
 32'h00E80000  --&gt; from PC: 0x00FC503A
373
 problem: PC: 0x00FCAC04, access: 0 ? -&gt; read from ocs_video -&gt; solved
374
 problem: PC: 0x00FE9318, access: 0 ?
375
 32'h00DFF0A4
376
 32'h00DFF008
377
 32'h00DFF034
378
 32'h00DFF014
379
 32'h00DFF0FC
380
 32'h00dc003c rtc
381
 32'h00d8003c rtc ?
382
 32'hFFFFFFFC at PC: 0x00FF5A10, while LoadWB - also in uae: 0+0xFFFFFFFF -&gt; in 24-bit addressing ok,
383
      but in 32-bit addressing not ok
384
*/
385
 
386
/* cia8520 notes:
387
    - name: 8520(1MHz, A - 2MHz, both used in different Amiga models)
388
    - clock input: 0.709379 Mhz
389
    - peripheral interfacing:
390
        - serial I/O: internal bidirectional 8-bit shift-register
391
            - input: clocked with external source
392
            - output: clocked with internal timer
393
            - interrupt generated when transfer completed
394
        - parallel I/O: 2x 8-bit, each line: input or output, read always returned current state
395
            - two control lines: /FLAG, /PAGE coordinated multiple CIA + parallel I/O: for Centronics Port
396
    - system timers
397
        - 2 programmable interval timers with submicrosecond precision
398
        - can take input from external input: CNT
399
        - each timer has a:
400
            - 16-bit read-only register: down counter
401
            - 16-bit write-only latch
402
            - at underflow: interrupt and/or gated to second I/O port: PB6(timer A),PB7(timer B), overrides direction
403
            - modes: once, continuous
404
    - Time-of-Day clock:
405
        - 1 read/write 24-bit binary counter: read: read stop MSB, read continue LSB, write: stop MSB(?), start LSB
406
        - after reset: 1:00:00.0 (from 6526)
407
        - alarm clock: interrupt at given time
408
            - write only
409
            - at same address as TOD, selected by control bit
410
    - output: pulse pin
411
    - input: edge detection
412
    - CIA-B: even: 0: floppy control, serial control, some parallel port status
413
    - CIA-A: odd: 1: parallel port, keyboard, some floppy support, joystick and mouse buttons
414
 
415
 Diffrences:
416
 Timer A,B: CNT transitions: not transitions but pulses: as cnt_i == 1'b0
417
 pc_n == 1'b0 one cycle after port B access, not 3 cycles.
418
 serial output cnt_o
419
*/
420
 
421
/*
422
Low-Pass filter: LED-filter
423
    - analog filter
424
    - external to Paula
425
    - 12 dB/octet Butterworth low-pass filter at 3.3 kHz
426
    - applied globally to all 4 channels
427
 
428
Static low-pass filter: models before Amiga 1200
429
    - static "tone knob" type low-pass filter
430
    - enabled regardless of the optional LED-filter
431
    - 6 dB/octet low-passfilter with cut-off at 4.5 kHz or 5 kHz
432
*/
433
 
434
/*
435
Gary: A500,A2000,CDTV
436
    - glue logic for bus control
437
    - support functions for floppy drive
438
*/
439
 
440
/* ECS only
441
Agnus
442
    BLTCON0L    ~05A  W   A( E!)  Blitter control 0, lower 8 bits (minterms)
443
    BLTSIZV     ~05C  W   A( E!)  Blitter V size (for 15 bit vertical size)
444
    BLTSIZH     ~05E  W   A( E!)  Blitter H size and start (for 11 bit H size)
445
    SPRHDAT     ~078  W   A( E!)  Ext. logic UHRES sprite pointer and data id
446
    HTOTAL       1C0  W   A( E!)  Highest number count, horiz line (VARBEAMEN=1)
447
    HSSTOP       1C2  W   A( E!)  Horizontal line position for HSYNC stop
448
    HBSTRT       1C4  W   A( E!)  Horizontal line position for HBLANK start
449
    HBSTOP       1C6  W   A( E!)  Horizontal line position for HBLANK stop
450
    VTOTAL       1C8  W   A( E!)  Highest numbered vertical line (VARBEAMEN=1)
451
    VSSTOP       1CA  W   A( E!)  Vertical line position for VSYNC stop
452
    VBSTRT       1CC  W   A( E!)  Vertical line for VBLANK start
453
    VBSTOP       1CE  W   A( E!)  Vertical line for VBLANK stop
454
    BEAMCON0     1DC  W   A( E!)  Beam counter control register (SHRES,PAL)
455
    HSSTRT       1DE  W   A( E!)  Horizontal sync start (VARHSY)
456
    VSSTRT       1E0  W   A( E!)  Vertical sync start   (VARVSY)
457
    HCENTER      1E2  W   A( E!)  Horizontal position for Vsync on interlace
458
Denise
459
    DENISEID    ~07C  R   D( E!)  Chip revision level for Denise (video out chip)
460
    BPLCON3      106  W   D( E!)  Bitplane control (enhanced features)
461
    DIWHIGH      1E4  W   AD( E!) Display window -  upper bits for start, stop
462
*/
463
 
464
/* From operations:
465
 * &lt;h3&gt;Setting up the core&lt;/h3&gt;
466
 *
467
 * &lt;h3&gt;Resetting the core&lt;/h3&gt;
468
 *
469
 * &lt;h3&gt;Modes and states&lt;/h3&gt;
470
 */
471
</pre></div> </div>
472
<hr class="footer"/><address class="footer"><small>Generated on Mon Dec 20 2010 21:20:19 for aoOCS by&#160;
473
<a href="http://www.doxygen.org/index.html">
474
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
475
</body>
476
</html>

powered by: WebSVN 2.1.0

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