OpenCores
URL https://opencores.org/ocsvn/mips32r1/mips32r1/trunk

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Hardware/] [XUPV5-LX110T_SoC/] [MIPS32-Pipelined-Hw/] [src/] [LED/] [LED.v] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ayersg
`timescale 1ns / 1ps
2
/*
3
 * File         : LED.v
4
 * Project      : University of Utah, XUM Project MIPS32 core
5
 * Creator(s)   : Grant Ayers (ayers@cs.utah.edu)
6
 *
7
 * Modification History:
8
 *   Rev   Date         Initials  Description of Change
9
 *   1.0   13-Jul-2012  GEA       Initial design.
10
 *
11
 * Standards/Formatting:
12
 *   Verilog 2001, 4 soft tab, wide column.
13
 *
14
 * Description:
15
 *   A read/write interface between a 4-way handshaking data bus and
16
 *   8 LEDs.
17
 *
18
 *   An optional mode allows the LEDs to show current interrupts
19
 *   instead of bus data.
20
 */
21
module LED(
22
    input  clock,
23
    input  reset,
24
    input  [14:0] dataIn,
25
    input  [7:0] IP,
26
    input  Write,
27
    input  Read,
28
    output [13:0] dataOut,
29
    output reg Ack,
30
    output [13:0] LED
31
    );
32
 
33
    reg  [13:0] data;
34
    reg  useInterrupts;
35
 
36
    always @(posedge clock) begin
37
        data <= (reset) ? 14'b0 : ((Write) ? dataIn[13:0] : data);
38
        useInterrupts <= (reset) ? 0 : ((Write) ? dataIn[14] : useInterrupts);
39
    end
40
 
41
    always @(posedge clock) begin
42
        Ack <= (reset) ? 0 : (Write | Read);
43
    end
44
 
45
    assign LED = (useInterrupts) ? {6'b0, IP[7:0]} : data;
46
    assign dataOut = data;
47
 
48
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.