10 |
|
|
11 |
<!-- |
<!-- |
12 |
|
|
13 |
$Id: experiments.html,v 1.102 2006/06/12 10:21:12 debug Exp $ |
$Id: experiments.html,v 1.110 2007/06/15 18:07:08 debug Exp $ |
14 |
|
|
15 |
Copyright (C) 2003-2006 Anders Gavare. All rights reserved. |
Copyright (C) 2003-2007 Anders Gavare. All rights reserved. |
16 |
|
|
17 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
18 |
modification, are permitted provided that the following conditions are met: |
modification, are permitted provided that the following conditions are met: |
65 |
|
|
66 |
<p> |
<p> |
67 |
<ul> |
<ul> |
68 |
<li>Build and install a cross-compiler for your chosen target. |
<li>Build and install a cross-compiler for your chosen target, |
69 |
|
e.g. <tt>mips64-unknown-elf</tt>. |
70 |
GCC is usually a good compiler choice, because it is portable |
GCC is usually a good compiler choice, because it is portable |
71 |
and in wide-spread use. (Other compilers should work too.) |
and in wide-spread use. (Other compilers should work too.) |
72 |
|
|
232 |
<tr> |
<tr> |
233 |
<td align="left" valign="top"><tt>0x00d0</tt></td> |
<td align="left" valign="top"><tt>0x00d0</tt></td> |
234 |
<td align="left" valign="top">Read: <b><tt>ncycles()</tt></b>. |
<td align="left" valign="top">Read: <b><tt>ncycles()</tt></b>. |
235 |
Returns approximately the number of cycles executed. |
Returns approximately the number of cycles executed on |
236 |
Note: this value is not updated for every instruction, |
this CPU. Note: this value is not updated for every instruction, |
237 |
so it cannot be used for small measurements.</td> |
so it cannot be used for small measurements.</td> |
238 |
</tr> |
</tr> |
239 |
</table> |
</table> |
368 |
</td> |
</td> |
369 |
</tr> |
</tr> |
370 |
|
|
371 |
|
<tr height="15"> |
372 |
|
<td height="15"> </td> |
373 |
|
</tr> |
374 |
|
|
375 |
|
<tr> |
376 |
|
<td align="left" valign="top"> |
377 |
|
<a name="expdevices_rtc"><b><tt>rtc</tt>:</b></a> |
378 |
|
<p>A Real-Time Clock, used to retrieve the current time |
379 |
|
and to cause periodic interrupts. |
380 |
|
<p>Source code: <font color="#0000f0"><tt>src/devices/dev_rtc.c</tt></font> |
381 |
|
<p>Include file: <font color="#0000f0"><tt>dev_rtc.h</tt></font> |
382 |
|
<br>Default physical address:  <font color="#0000f0">0x15000000</font> |
383 |
|
</td> |
384 |
|
<td></td> |
385 |
|
<td align="left" valign="top"> |
386 |
|
<table border="0"> |
387 |
|
<tr> |
388 |
|
<td align="left" valign="top"><i><u>Offset:</u></i> </td> |
389 |
|
<td align="left" valign="top"><i><u>Effect:</u></i></td> |
390 |
|
</tr> |
391 |
|
<tr> |
392 |
|
<td align="left" valign="top"><tt>0x0000</tt></td> |
393 |
|
<td align="left" valign="top">Read or Write: Trigger a clock update (a gettimeofday() on the host).</td> |
394 |
|
</tr> |
395 |
|
<tr> |
396 |
|
<td align="left" valign="top"><tt>0x0010</tt></td> |
397 |
|
<td align="left" valign="top">Read: Seconds since 1st January 1970</td> |
398 |
|
</tr> |
399 |
|
<tr> |
400 |
|
<td align="left" valign="top"><tt>0x0020</tt></td> |
401 |
|
<td align="left" valign="top">Read: Microseconds</td> |
402 |
|
</tr> |
403 |
|
<tr> |
404 |
|
<td align="left" valign="top"><tt>0x0100</tt></td> |
405 |
|
<td align="left" valign="top">Read: Get the current |
406 |
|
timer interrupt frequency.<br>Write: Set the timer |
407 |
|
interrupt frequency. (Writing 0 disables the timer.)</td> |
408 |
|
</tr> |
409 |
|
<tr> |
410 |
|
<td align="left" valign="top"><tt>0x0110</tt></td> |
411 |
|
<td align="left" valign="top">Read or Write: Acknowledge |
412 |
|
one timer interrupt. (Note that if multiple interrupts |
413 |
|
are pending, only one is acknowledged.)</td> |
414 |
|
</tr> |
415 |
|
</table> |
416 |
|
</td> |
417 |
|
</tr> |
418 |
|
|
419 |
|
<tr height="15"> |
420 |
|
<td height="15"> </td> |
421 |
|
</tr> |
422 |
|
|
423 |
|
<tr> |
424 |
|
<td align="left" valign="top"> |
425 |
|
<a name="expdevices_irqc"><b><tt>irqc</tt>:</b></a> |
426 |
|
<p>An Interrupt Controller. (Note: Not used for the MIPS test machine.) |
427 |
|
<p>Source code: <font color="#0000f0"><tt>src/devices/dev_irqc.c</tt></font> |
428 |
|
<p>Include file: <font color="#0000f0"><tt>dev_irqc.h</tt></font> |
429 |
|
<br>Default physical address:  <font color="#0000f0">0x16000000</font> |
430 |
|
</td> |
431 |
|
<td></td> |
432 |
|
<td align="left" valign="top"> |
433 |
|
<table border="0"> |
434 |
|
<tr> |
435 |
|
<td align="left" valign="top"><i><u>Offset:</u></i> </td> |
436 |
|
<td align="left" valign="top"><i><u>Effect:</u></i></td> |
437 |
|
</tr> |
438 |
|
<tr> |
439 |
|
<td align="left" valign="top"><tt>0x0</tt></td> |
440 |
|
<td align="left" valign="top">Read: IRQ status as a 32-bit word, one bit per interrupt source.</td> |
441 |
|
</tr> |
442 |
|
<tr> |
443 |
|
<td align="left" valign="top"><tt>0x4</tt></td> |
444 |
|
<td align="left" valign="top">Write: Mask one interrupt source. Value should be an integer 0..31.</td> |
445 |
|
</tr> |
446 |
|
<tr> |
447 |
|
<td align="left" valign="top"><tt>0x8</tt></td> |
448 |
|
<td align="left" valign="top">Write: Unmask one interrupt source. Value should be an integer 0..31.</td> |
449 |
|
</tr> |
450 |
|
</table> |
451 |
|
</td> |
452 |
|
</tr> |
453 |
|
|
454 |
</table></center> |
</table></center> |
455 |
|
|
456 |
<p> |
<p>The include files for the test machine devices are found in |
457 |
While these devices may resemble real-world hardware, they are |
<a href="../src/include/testmachine/"><tt>src/include/testmachine/</tt></a>. |
458 |
|
|
459 |
|
<p>While these devices may resemble real-world hardware, they are |
460 |
intentionally made simpler to use. (An exception is the framebuffer; |
intentionally made simpler to use. (An exception is the framebuffer; |
461 |
some machines actually have simple linear framebuffers like this.) |
some machines actually have simple linear framebuffers like this.) |
462 |
|
|
466 |
<tt>0xffffffff90000000</tt> too, but devices should usually be accessed in |
<tt>0xffffffff90000000</tt> too, but devices should usually be accessed in |
467 |
a non-cached manner.) |
a non-cached manner.) |
468 |
|
|
469 |
<p>When using the Alpha, ARM, or PPC test machines, the addresses are |
<p>When using the ARM or PPC test machines, the addresses are |
470 |
<tt>0x10000000</tt>, <tt>0x11000000</tt> etc., so no need to add any |
<tt>0x10000000</tt>, <tt>0x11000000</tt> etc., so no need to add any |
471 |
virtual displacement. |
virtual displacement. |
472 |
|
|
500 |
<p><center> |
<p><center> |
501 |
<table border="1"> |
<table border="1"> |
502 |
<tr><td align="center"> |
<tr><td align="center"> |
503 |
<b><tt>testmips</tt></b> |
<b><tt>testmips</tt></b> (as native MIPS interrupts) |
504 |
</td></tr> |
</td></tr> |
505 |
<tr><td> |
<tr><td> |
506 |
<table border="0"> |
<table border="0"> |
510 |
<td>MIPS count/compare interrupt</td></tr> |
<td>MIPS count/compare interrupt</td></tr> |
511 |
<tr><td align="center">6</td><td></td> |
<tr><td align="center">6</td><td></td> |
512 |
<td><tt>mp</tt> (inter-processor interrupts)</td></tr> |
<td><tt>mp</tt> (inter-processor interrupts)</td></tr> |
513 |
|
<tr><td align="center">4</td><td></td> |
514 |
|
<td><tt>rtc</tt></td></tr> |
515 |
|
<tr><td align="center">3</td><td></td> |
516 |
|
<td><tt>ether</tt></td></tr> |
517 |
|
<tr><td align="center">2</td><td></td> |
518 |
|
<td><tt>cons</tt></td></tr> |
519 |
|
</table> |
520 |
|
</td></tr> |
521 |
|
</table> |
522 |
|
|
523 |
|
<p><table border="1"> |
524 |
|
<tr><td align="center"> |
525 |
|
<b><tt>testarm</tt> and others</b> (via the <tt>irqc</tt> device) |
526 |
|
</td></tr> |
527 |
|
<tr><td> |
528 |
|
<table border="0"> |
529 |
|
<tr><td align="center">IRQ:</td><td> </td> |
530 |
|
<td>Used for:</td></tr> |
531 |
|
<tr><td align="center">6</td><td></td> |
532 |
|
<td><tt>mp</tt> (inter-processor interrupts)</td></tr> |
533 |
|
<tr><td align="center">4</td><td></td> |
534 |
|
<td><tt>rtc</tt></td></tr> |
535 |
<tr><td align="center">3</td><td></td> |
<tr><td align="center">3</td><td></td> |
536 |
<td><tt>ether</tt></td></tr> |
<td><tt>ether</tt></td></tr> |
537 |
<tr><td align="center">2</td><td></td> |
<tr><td align="center">2</td><td></td> |
541 |
</table> |
</table> |
542 |
</center> |
</center> |
543 |
|
|
|
<p>Other machines: TODO |
|
544 |
|
|
545 |
|
|
546 |
<p><br> |
<p><br> |