URL
https://opencores.org/ocsvn/leros/leros/trunk
Show entire file |
Details |
Blame |
View Log
Rev 4 |
Rev 8 |
Line 30... |
Line 30... |
*/
|
*/
|
|
|
package leros.sim;
|
package leros.sim;
|
|
|
/**
|
/**
|
* Simulation of IO devices connected to Leros. IO mapping is at the moment not
|
* Simulation of IO devices connected to Leros.
|
* the same as in VHDL.
|
* IO mapping needs a definition of a minimum default.
|
|
* LEDs, buttons, and a UART
|
*
|
*
|
* @author martin
|
* @author martin
|
*
|
*
|
*/
|
*/
|
public class LerosIO implements ILerosIO{
|
public class LerosIO implements ILerosIO{
|
|
|
final static int UART_STATUS = 0;
|
final static int UART_STATUS = 2;
|
final static int UART_IO = 1;
|
final static int UART_IO = 3;
|
final static int LED = 2;
|
final static int LED = 0;
|
|
|
int[] command = new int[]{ 10,10,30,20,1,1};
|
int[] command = new int[]{ 10,10,30,20,1,1};
|
int commandIndex = 0;
|
int commandIndex = 0;
|
|
|
public void write(int addr, int data) {
|
public void write(int addr, int data) {
|
switch (addr) {
|
switch (addr) {
|
|
|
case UART_IO:
|
case UART_IO:
|
|
|
System.out.println( data);
|
System.out.println((char) data);
|
|
|
break;
|
break;
|
|
|
case LED:
|
case LED:
|
System.out.println( "LED = " + String.valueOf(data) );
|
System.out.println( "LED = " + String.valueOf(data) );
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.