From 459c20bafb008dce1076597edb7e1fe07216fe4e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 17 Jun 2014 08:51:10 -0700 Subject: 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 --- abc80.v | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3