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>2014-02-11 02:07:50 (GMT)
commitc9669a7aff05c3558e3f0a4edfaabdab3a1d6907 (patch)
tree8642d7f5d772f518cf6fbdc6074ed57377a16320
parent114668c956b44107585e6556fef01c52b131da7b (diff)
downloadabc8000-c9669a7aff05c3558e3f0a4edfaabdab3a1d6907.zip
abc8000-c9669a7aff05c3558e3f0a4edfaabdab3a1d6907.tar.gz
abc8000-c9669a7aff05c3558e3f0a4edfaabdab3a1d6907.tar.bz2
abc8000-c9669a7aff05c3558e3f0a4edfaabdab3a1d6907.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 2547687..82357e3 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 f79051e..48c94a8 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