summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-11-14 20:37:05 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2010-11-14 20:37:05 (GMT)
commitb8ce7bcf128b021103cc450275e799df9cfd7417 (patch)
treeee263fbdead513b07fa0db3c730b83f87e4cf2e3
parentfda64bdf4b0e4300b61b0922ed2f2bd3d625da55 (diff)
downloadabc8000-old-b8ce7bcf128b021103cc450275e799df9cfd7417.zip
abc8000-old-b8ce7bcf128b021103cc450275e799df9cfd7417.tar.gz
abc8000-old-b8ce7bcf128b021103cc450275e799df9cfd7417.tar.bz2
abc8000-old-b8ce7bcf128b021103cc450275e799df9cfd7417.tar.xz
Add a register to see the keys and switches from software
Allow the keys and switches to be made visible to software.
-rw-r--r--data/sysrom/include/ioreg.h1
-rw-r--r--de1/de1.v2
2 files changed, 3 insertions, 0 deletions
diff --git a/data/sysrom/include/ioreg.h b/data/sysrom/include/ioreg.h
index 82618b6..334743d 100644
--- a/data/sysrom/include/ioreg.h
+++ b/data/sysrom/include/ioreg.h
@@ -68,6 +68,7 @@ static __inline__ void writel(uint32_t __val, volatile uint32_t *__ptr)
#define IO_SYS_LED IO_BYTE(0xfff00002)
#define IO_SYS_7SEG IO_LONG(0xfff00004)
#define IO_SYS_CTR IO_LONG(0xfff00008)
+#define IO_SYS_SW IO_WORD(0xfff0000c)
/*
* Debug serial port
diff --git a/de1/de1.v b/de1/de1.v
index 11a16be..69b81ac 100644
--- a/de1/de1.v
+++ b/de1/de1.v
@@ -305,6 +305,8 @@ module abc8000_de1 (
sysctl_cpu_di <= cycle_ctr[31:16];
3'b101:
sysctl_cpu_di <= cycle_ctr[15:0];
+ 3'b110:
+ sysctl_cpu_di <= { key_d, 2'b00, sw_d };
endcase // case (cpu_a[3:1])
end