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

Subversion Repositories zet86

[/] [zet86/] [trunk/] [soc/] [simple_pic.v] - Blame information for rev 52

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 52 zeus
`include "defines.v"
2
 
3
module simple_pic (
4
`ifdef DEBUG
5
    output reg [1:0] irr,
6
`endif
7
    input        clk,
8
    input        rst,
9
    input  [1:0] int,
10
    input        inta,
11
    output       intr,
12
    output reg   iid
13
  );
14
 
15
  // Registers
16
`ifndef DEBUG
17
  reg [1:0] irr;
18
`endif
19
 
20
  // Continuous assignments
21
  assign intr = |irr;
22
 
23
  // Behaviour
24
  // irr
25
  always @(posedge clk)
26
    irr[0] <= rst ? 1'b0 : (int[0] | irr[0] & (iid | !inta));
27
 
28
  always @(posedge clk)
29
    irr[1] <= rst ? 1'b0 : (int[1] | irr[1] & !(iid & inta));
30
 
31
  // iid
32
  always @(posedge clk)
33
    iid <= rst ? 1'b0 : (!irr[0] | inta);
34
 
35
endmodule

powered by: WebSVN 2.1.0

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