summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2014-06-17 15:51:10 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2014-06-17 15:51:10 (GMT)
commit459c20bafb008dce1076597edb7e1fe07216fe4e (patch)
treeb51327afd8c1cae184d8ae93c3041afdf097ae71
parentc2b2d4556275fad0360a98128bb62436134e2065 (diff)
downloadabc80-459c20bafb008dce1076597edb7e1fe07216fe4e.zip
abc80-459c20bafb008dce1076597edb7e1fe07216fe4e.tar.gz
abc80-459c20bafb008dce1076597edb7e1fe07216fe4e.tar.bz2
abc80-459c20bafb008dce1076597edb7e1fe07216fe4e.tar.xz
abc80.v: Allow the CPU to control the red LEDs
Add I/O ports to control the red LEDs from the CPU instead of simply reflecting the switches. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--abc80.v13
1 files changed, 12 insertions, 1 deletions
diff --git a/abc80.v b/abc80.v
index f27dca6..f45b940 100644
--- a/abc80.v
+++ b/abc80.v
@@ -141,6 +141,7 @@ module abc80 (
reg [6:0] std_s7_1;
reg [6:0] std_s7_0;
+ reg [9:0] prog_ledr;
reg [7:0] prog_led;
reg [7:0] prog_s7_1;
reg [7:0] prog_s7_0;
@@ -148,7 +149,8 @@ module abc80 (
wire [7:0] sd_errled;
- assign ledr = sw; // Show the switch status
+ // Show the switch status
+ assign ledr = prog_led_ctl[1] ? prog_ledr : sw;
assign ledg = prog_led_ctl[0] ? prog_led : std_led;
assign s7_3 = ~prog_s7_1[6:0];
@@ -917,6 +919,7 @@ module abc80 (
prog_led_ctl <= 0;
prog_led <= 0;
+ prog_ledr <= 0;
prog_s7_0 <= 0;
prog_s7_1 <= 0;
@@ -951,6 +954,10 @@ module abc80 (
prog_s7_0 <= cpu_do[7:0];
5'b10111:
prog_s7_1 <= cpu_do[7:0];
+ 5'b11000:
+ prog_ledr[7:0] <= cpu_do[7:0];
+ 5'b11001:
+ prog_ledr[9:8] <= cpu_do[1:0];
5'b11110:
fgctl <= cpu_do[7:0];
5'b11111:
@@ -986,6 +993,10 @@ module abc80 (
intio_do <= prog_s7_0;
5'b10111:
intio_do <= prog_s7_1;
+ 5'b11000:
+ intio_do <= prog_ledr[7:0];
+ 5'b11001:
+ intio_do <= prog_ledr[9:8];
5'b11110:
intio_do <= fgctl;
5'b11111: