Subversion Repositories pentevo

Rev

Rev 438 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. // Pentevo project (c) NedoPC 2011
  2. //
  3. // frame INT generation
  4.  
  5. `include "../include/tune.v"
  6.  
  7. module zint
  8. (
  9.         input  wire fclk,
  10.  
  11.         input  wire zpos,
  12.         input  wire zneg,
  13.  
  14.         input  wire int_start,
  15.  
  16.         input  wire iorq_n,
  17.         input  wire m1_n,
  18.  
  19.         input  wire wait_n,
  20.  
  21.         output reg  int_n
  22. );
  23.  
  24.         wire intend;
  25.  
  26.         reg [9:0] intctr;
  27.  
  28.         reg [1:0] wr;
  29.  
  30.  
  31. `ifdef SIMULATE
  32.         initial
  33.         begin
  34.                 intctr = 10'b1100000000;
  35.         end
  36. `endif
  37.  
  38.         always @(posedge fclk)
  39.                 wr[1:0] <= { wr[0], wait_n };
  40.  
  41.         always @(posedge fclk)
  42.         begin
  43.                 if( int_start )
  44.                         intctr <= 10'd0;
  45.                 else if( !intctr[9:8] && wr[1] )
  46.                         intctr <= intctr + 10'd1;
  47.         end
  48.  
  49.  
  50.         assign intend = intctr[9:8] || ( (!iorq_n) && (!m1_n) && zneg );
  51.  
  52.  
  53.         always @(posedge fclk)
  54.         begin
  55.                 if( int_start )
  56.                         int_n <= 1'b0;
  57.                 else if( intend )
  58.                         int_n <= 1'bZ;
  59.         end
  60.  
  61.  
  62.  
  63.  
  64.  
  65. endmodule
  66.  
  67.