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

Subversion Repositories tv80

[/] [tv80/] [trunk/] [env/] [env_io.v] - Diff between revs 31 and 37

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 31 Rev 37
Line 23... Line 23...
  reg [7:0]    timeout_ctl;
  reg [7:0]    timeout_ctl;
  reg [15:0]   cur_timeout;
  reg [15:0]   cur_timeout;
  reg [15:0]   max_timeout;
  reg [15:0]   max_timeout;
 
 
  reg [7:0]    int_countdown;
  reg [7:0]    int_countdown;
 
  reg [7:0]    checksum;
 
  reg [7:0]    ior_value;  // increment-on-read value
 
 
  assign       DI = (!iorq_n & !rd_n & io_cs) ? io_data : {8{1'bz}};
  assign       DI = (!iorq_n & !rd_n & io_cs) ? io_data : {8{1'bz}};
 
 
  initial
  initial
    begin
    begin
Line 36... Line 38...
      max_timeout = 10000;
      max_timeout = 10000;
      timeout_ctl = 1;
      timeout_ctl = 1;
      int_countdown = 0;
      int_countdown = 0;
    end
    end
 
 
 
  always @*
 
    begin
 
      if (!iorq_n & !rd_n)
 
        begin
 
          io_cs = (addr[7:5] == 3'b100);
 
 
 
          case (addr)
 
            8'h83 : io_data = max_timeout[7:0];
 
            8'h84 : io_data = max_timeout[15:8];
 
 
 
            8'h90 : io_data = int_countdown;
 
            8'h91 : io_data = checksum;
 
            8'h93 : io_data = ior_value;
 
            default : io_data = 8'hzz;
 
          endcase // case(addr)
 
        end // if (!iorq_n & !rd_n)
 
    end // always @ *
 
 
  always @(posedge clk)
  always @(posedge clk)
    begin
    begin
      if (!iorq_n & !wr_n)
      if (!iorq_n & !wr_n)
        case (addr)
        case (addr)
          8'h80 :
          8'h80 :
Line 84... Line 104...
 
 
          8'h83 : max_timeout[7:0] = DO;
          8'h83 : max_timeout[7:0] = DO;
          8'h84 : max_timeout[15:8] = DO;
          8'h84 : max_timeout[15:8] = DO;
 
 
          8'h90 : int_countdown = DO;
          8'h90 : int_countdown = DO;
 
          8'h91 : checksum = DO;
 
          8'h92 : checksum = checksum + DO;
 
          8'h93 : ior_value = DO;
        endcase // case(addr)
        endcase // case(addr)
    end // always @ (posedge clk)
    end // always @ (posedge clk)
 
 
  always @(posedge clk)
  always @(posedge clk)
    begin
    begin

powered by: WebSVN 2.1.0

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