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

Subversion Repositories 8051

[/] [8051/] [trunk/] [rtl/] [verilog/] [oc8051_int.v] - Diff between revs 2 and 4

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

Rev 2 Rev 4
Line 29... Line 29...
`include "oc8051_timescale.v"
`include "oc8051_timescale.v"
//synopsys translate_on
//synopsys translate_on
 
 
 
 
 
 
module oc0851_int (clk, wr_addr, rd_addr, data_in, bit_in, data_out, bit_out, wr, wr_bit, tf0, tf1, int, ie0, ie1, rst, reti, int_vec, tr0, tr1, uart, ack);
module oc0851_int (clk, wr_addr, rd_addr, data_in, bit_in, data_out, bit_out, wr, wr_bit, tf0, tf1, intr, ie0, ie1, rst, reti, int_vec, tr0, tr1, uart, ack);
input [7:0] wr_addr, data_in, rd_addr;
input [7:0] wr_addr, data_in, rd_addr;
input wr, tf0, tf1, ie0, ie1, clk, rst, reti, wr_bit, bit_in, uart, ack;
input wr, tf0, tf1, ie0, ie1, clk, rst, reti, wr_bit, bit_in, uart, ack;
 
 
output tr0, tr1, int, bit_out;
output tr0, tr1, intr, bit_out;
output [7:0] int_vec, data_out;
output [7:0] int_vec, data_out;
 
 
reg [7:0] ip, ie, int_vec, id, data_out;
reg [7:0] ip, ie, int_vec, id, data_out;
 
 
reg [3:0] tcon_s;
reg [3:0] tcon_s;
Line 57... Line 57...
// int_l0       waiting interrupts on level 0
// int_l0       waiting interrupts on level 0
// int_l1       waiting interrupts on level 1
// int_l1       waiting interrupts on level 1
wire [4:0] int_l0, int_l1;
wire [4:0] int_l0, int_l1;
wire il0, il1;
wire il0, il1;
 
 
integer n;
 
 
 
 
 
//reg set_tf0, set_tf1, set_ie0, set_ie1;
//reg set_tf0, set_tf1, set_ie0, set_ie1;
reg tf0_buff, tf1_buff, ie0_buff, ie1_buff;
reg tf0_buff, tf1_buff, ie0_buff, ie1_buff;
//reg tf0_ack, tf1_ack, ie0_ack, ie1_ack;
//reg tf0_ack, tf1_ack, ie0_ack, ie1_ack;
 
 
assign tcon = {tcon_tf1, tcon_s[3], tcon_tf0, tcon_s[2], tcon_ie1, tcon_s[1], tcon_ie0, tcon_s[0]};
assign tcon = {tcon_tf1, tcon_s[3], tcon_tf0, tcon_s[2], tcon_ie1, tcon_s[1], tcon_ie0, tcon_s[0]};
assign tr0 = tcon_s[2];
assign tr0 = tcon_s[2];
assign tr1 = tcon_s[3];
assign tr1 = tcon_s[3];
assign int = |int_vec;
assign intr = |int_vec;
 
 
assign int_l0 = ~ip[4:0] & ie[4:0] & {uart, tcon_tf1, tcon_ie1, tcon_tf0, tcon_ie0};
assign int_l0 = ~ip[4:0] & ie[4:0] & {uart, tcon_tf1, tcon_ie1, tcon_tf0, tcon_ie0};
assign int_l1 = ip[4:0] & ie[4:0] & {uart, tcon_tf1, tcon_ie1, tcon_tf0, tcon_ie0};
assign int_l1 = ip[4:0] & ie[4:0] & {uart, tcon_tf1, tcon_ie1, tcon_tf0, tcon_ie0};
assign il0 = |int_l0;
assign il0 = |int_l0;
assign il1 = |int_l1;
assign il1 = |int_l1;
Line 252... Line 249...
   int_vec <= #1 8'h00;
   int_vec <= #1 8'h00;
 end
 end
end
end
 
 
 
 
always @(posedge clk)
always @(posedge clk or posedge rst)
begin
begin
  if (wr & !wr_bit & (wr_addr==rd_addr) & (
  if (rst) data_out <= #1 8'h0;
 
  else if (wr & !wr_bit & (wr_addr==rd_addr) & (
     (wr_addr==`OC8051_SFR_IP) | (wr_addr==`OC8051_SFR_IE) | (wr_addr==`OC8051_SFR_TCON))) begin
     (wr_addr==`OC8051_SFR_IP) | (wr_addr==`OC8051_SFR_IE) | (wr_addr==`OC8051_SFR_TCON))) begin
    data_out <= #1 data_in;
    data_out <= #1 data_in;
  end else begin
  end else begin
    case (rd_addr)
    case (rd_addr)
      `OC8051_SFR_IP: data_out <= #1 ip;
      `OC8051_SFR_IP: data_out <= #1 ip;
Line 266... Line 264...
      default: data_out <= #1 tcon;
      default: data_out <= #1 tcon;
    endcase
    endcase
  end
  end
end
end
 
 
always @(posedge clk)
always @(posedge clk or posedge rst)
 
  if (rst) begin
 
    tf0_buff <= #1 1'b0;
 
    tf1_buff <= #1 1'b0;
 
    ie0_buff <= #1 1'b0;
 
    ie1_buff <= #1 1'b0;
 
  end else begin
  tf0_buff <= #1 tf0;
  tf0_buff <= #1 tf0;
 
 
always @(posedge clk)
 
  tf1_buff <= #1 tf1;
  tf1_buff <= #1 tf1;
 
 
always @(posedge clk)
 
  ie0_buff <= #1 ie0;
  ie0_buff <= #1 ie0;
 
 
always @(posedge clk)
 
  ie1_buff <= #1 ie1;
  ie1_buff <= #1 ie1;
 
  end
 
 
always  @(posedge clk)
always @(posedge clk or posedge rst)
begin
begin
  if (wr & wr_bit & (wr_addr==rd_addr) & ((wr_addr[7:3]==`OC8051_SFR_B_IP) |
  if (rst) bit_out <= #1 1'b0;
 
  else if (wr & wr_bit & (wr_addr==rd_addr) & ((wr_addr[7:3]==`OC8051_SFR_B_IP) |
     (wr_addr[7:3]==`OC8051_SFR_B_IE) | (wr_addr[7:3]==`OC8051_SFR_B_TCON))) begin
     (wr_addr[7:3]==`OC8051_SFR_B_IE) | (wr_addr[7:3]==`OC8051_SFR_B_TCON))) begin
    bit_out <= #1 bit_in;
    bit_out <= #1 bit_in;
  end else begin
  end else begin
    case (rd_addr[7:3])
    case (rd_addr[7:3])
      `OC8051_SFR_B_IP: bit_out <= #1 ip[rd_addr[2:0]];
      `OC8051_SFR_B_IP: bit_out <= #1 ip[rd_addr[2:0]];

powered by: WebSVN 2.1.0

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