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

Subversion Repositories 8051

[/] [8051/] [trunk/] [rtl/] [verilog/] [oc8051_sfr.v] - Diff between revs 120 and 132

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

Rev 120 Rev 132
Line 42... Line 42...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.10  2003/04/10 12:43:19  simont
 
// defines for pherypherals added
 
//
// Revision 1.9  2003/04/09 16:24:03  simont
// Revision 1.9  2003/04/09 16:24:03  simont
// change wr_sft to 2 bit wire.
// change wr_sft to 2 bit wire.
//
//
// Revision 1.8  2003/04/09 15:49:42  simont
// Revision 1.8  2003/04/09 15:49:42  simont
// Register oc8051_sfr dato output, add signal wait_data.
// Register oc8051_sfr dato output, add signal wait_data.
Line 90... Line 93...
       sp, sp_w,
       sp, sp_w,
       bank_sel,
       bank_sel,
       desAc, desOv,
       desAc, desOv,
       srcAc, cy,
       srcAc, cy,
       psw_set, rmw,
       psw_set, rmw,
 
       comp_sel,
 
       comp_wait,
 
 
`ifdef OC8051_PORTS
`ifdef OC8051_PORTS
 
 
  `ifdef OC8051_PORT0
  `ifdef OC8051_PORT0
       p0_out,
       p0_out,
Line 150... Line 155...
            int0,
            int0,
            int1,
            int1,
            reti,
            reti,
            wr_bit;
            wr_bit;
input [1:0] psw_set,
input [1:0] psw_set,
            wr_sfr;
            wr_sfr,
 
            comp_sel;
input [2:0] ram_rd_sel,
input [2:0] ram_rd_sel,
            ram_wr_sel;
            ram_wr_sel;
input [7:0] adr0,        //address 0 input
input [7:0] adr0,        //address 0 input
            adr1,       //address 1 input
            adr1,       //address 1 input
            dat1,       //data 1 input (des1)
            dat1,       //data 1 input (des1)
Line 162... Line 168...
 
 
output       bit_out,
output       bit_out,
             intr,
             intr,
             srcAc,
             srcAc,
             cy,
             cy,
             wait_data;
             wait_data,
 
             comp_wait;
output [1:0] bank_sel;
output [1:0] bank_sel;
output [7:0] dat0,       //data output
output [7:0] dat0,       //data output
             int_src,
             int_src,
             dptr_hi,
             dptr_hi,
             dptr_lo,
             dptr_lo,
Line 524... Line 531...
    adr0_r <= #1 adr0;
    adr0_r <= #1 adr0;
    ram_wr_sel_r <= #1 ram_wr_sel;
    ram_wr_sel_r <= #1 ram_wr_sel;
    wr_bit_r <= #1 wr_bit;
    wr_bit_r <= #1 wr_bit;
  end
  end
 
 
 
assign comp_wait = !(
 
                    ((comp_sel==`OC8051_CSS_AZ) &
 
                       ((wr_sfr==`OC8051_WRS_ACC1) |
 
                        (wr_sfr==`OC8051_WRS_ACC2) |
 
                        ((adr1==`OC8051_SFR_ACC) & we & !wr_bit_r) |
 
                        ((adr1[7:3]==`OC8051_SFR_B_ACC) & we & wr_bit_r))) |
 
                    ((comp_sel==`OC8051_CSS_CY) &
 
                       ((|psw_set) |
 
                        ((adr1==`OC8051_SFR_PSW) & we & !wr_bit_r) |
 
                        ((adr1[7:3]==`OC8051_SFR_B_PSW) & we & wr_bit_r))) |
 
                    ((comp_sel==`OC8051_CSS_BIT) &
 
                       ((adr1[7:3]==adr0[7:3]) & (~&adr1[2:0]) &  we & !wr_bit_r) |
 
                       ((adr1==adr0) & adr1[7] & we & !wr_bit_r)));
 
 
 
 
 
 
//
//
//set output in case of address (byte)
//set output in case of address (byte)
always @(posedge clk or posedge rst)
always @(posedge clk or posedge rst)
begin
begin
Line 541... Line 563...
      (((wr_sfr==`OC8051_WRS_ACC1) & (adr0==`OC8051_SFR_ACC)) |         //write to acc
      (((wr_sfr==`OC8051_WRS_ACC1) & (adr0==`OC8051_SFR_ACC)) |         //write to acc
      ((wr_sfr==`OC8051_WRS_DPTR) & (adr0==`OC8051_SFR_DPTR_LO)) |      //write to dpl
      ((wr_sfr==`OC8051_WRS_DPTR) & (adr0==`OC8051_SFR_DPTR_LO)) |      //write to dpl
      (adr1[7] & (adr1==adr0) & we & !wr_bit_r)) & !wait_data) begin    //write and read same address
      (adr1[7] & (adr1==adr0) & we & !wr_bit_r)) & !wait_data) begin    //write and read same address
    wait_data <= #1 1'b1;
    wait_data <= #1 1'b1;
 
 
  end else if (
  end else if ((
      (((wr_sfr==`OC8051_WRS_ACC2) & (adr0==`OC8051_SFR_ACC)) |         //write to acc
      ((|psw_set) & (adr0==`OC8051_SFR_PSW)) |
 
      ((wr_sfr==`OC8051_WRS_ACC2) & (adr0==`OC8051_SFR_ACC)) |  //write to acc
      ((wr_sfr==`OC8051_WRS_DPTR) & (adr0==`OC8051_SFR_DPTR_HI))        //write to dph
      ((wr_sfr==`OC8051_WRS_DPTR) & (adr0==`OC8051_SFR_DPTR_HI))        //write to dph
      ) & !wait_data) begin
      ) & !wait_data) begin
    wait_data <= #1 1'b1;
    wait_data <= #1 1'b1;
 
 
  end else begin
  end else begin

powered by: WebSVN 2.1.0

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