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

Subversion Repositories m32632

[/] [m32632/] [trunk/] [rtl/] [CACHE_LOGIK.v] - Diff between revs 12 and 23

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

Rev 12 Rev 23
Line 2... Line 2...
//
//
// This file is part of the M32632 project
// This file is part of the M32632 project
// http://opencores.org/project,m32632
// http://opencores.org/project,m32632
//
//
// Filename: CACHE_LOGIK.v
// Filename: CACHE_LOGIK.v
// Version:  1.1 bug fix
//      Version:        2.0
// History:  1.0 first release of 30 Mai 2015
//      History:        1.1 bug fix of 7 October 2015
// Date:     7 October 2015
//                              1.0 first release of 30 Mai 2015
 
//      Date:           14 August 2016
//
//
// Copyright (C) 2015 Udo Moeller
// Copyright (C) 2016 Udo Moeller
// 
// 
// This source file may be used and distributed without 
// This source file may be used and distributed without 
// restriction provided that this copyright statement is not 
// restriction provided that this copyright statement is not 
// removed from the file and that any derivative work contains 
// removed from the file and that any derivative work contains 
// the original copyright notice and the associated disclaimer.
// the original copyright notice and the associated disclaimer.
Line 32... Line 33...
// from http://www.opencores.org/lgpl.shtml 
// from http://www.opencores.org/lgpl.shtml 
// 
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
//      Modules contained in this file:
//      Modules contained in this file:
//      1. DEBUG_AE     Debug unit for address compare in data cache
//      1. NEU_VALID    Cache Valid RAM
//      2. MMU_UP               MMU memory update and initalization controller
//      2. DEBUG_AE     Debug unit for address compare in data cache
//      3. DCA_CONTROL  Data cache valid memory update and initalization controller
//      3. MMU_UP               MMU memory update and initalization controller
//      4. MMU_MATCH    MMU virtual address match detector
//      4. DCA_CONTROL  Data cache valid memory update and initalization controller
//      5. CA_MATCH             Cache tag match detector
//      5. MMU_MATCH    MMU virtual address match detector
//      6. DCACHE_SM    Data cache state machine
//      6. CA_MATCH             Cache tag match detector
 
//      7. FILTCMP              Address Filter and Comparator
 
//      8. DCACHE_SM    Data cache state machine
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
//      1. DEBUG_AE     Debug unit for address compare in data cache
//      1. NEU_VALID    Cache Valid RAM
 
//
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
module NEU_VALID ( BCLK, VALIN, WADR, WREN, RADR, VALOUT );
 
 
 
        input                   BCLK;
 
        input   [23:0]   VALIN;
 
        input    [4:0]   WADR;
 
        input                   WREN;
 
        input    [4:0]   RADR;
 
 
 
        output  [23:0]   VALOUT;
 
 
 
        reg             [23:0]   cvalid [0:31];   // Valid bits for Data Set 0 and 1 : 32 entries of 24 bits
 
        reg             [23:0]   ramout;
 
        reg             [23:0]   valhold;
 
        reg                             gleich;
 
 
 
        always @(posedge BCLK) ramout <= cvalid[RADR];
 
        always @(posedge BCLK) if (WREN) cvalid[WADR] <= VALIN;
 
 
 
        always @(posedge BCLK) valhold <= VALIN;
 
        always @(posedge BCLK) gleich  <= WREN & (RADR == WADR);
 
 
 
        assign VALOUT = gleich ? valhold : ramout;
 
 
 
endmodule
 
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
//
 
//      2. DEBUG_AE     Debug unit for address compare in data cache
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
module DEBUG_AE ( DBG_IN, READ, WRITE, USER, VIRTUELL, ACC_OK, VADR_R, MMU_Q, ENBYTE, DBG_HIT );
module DEBUG_AE ( DBG_IN, READ, WRITE, USER, VIRTUELL, ACC_OK, VADR_R, MMU_Q, ENBYTE, DBG_HIT );
 
 
        input   [40:2]  DBG_IN;
        input   [40:2]  DBG_IN;
Line 90... Line 123...
 
 
endmodule
endmodule
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
//      2. MMU_UP               MMU memory update and initalization controller
//      3. MMU_UP               MMU memory update and initalization controller
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
module MMU_UP ( BCLK, BRESET, NEW_PTB, PTB1, IVAR, WR_MRAM, VADR, VADR_R, MVALID, UPDATE,
module MMU_UP ( BCLK, BRESET, NEW_PTB, PTB1, IVAR, WR_MRAM, VADR, VADR_R, MVALID, UPDATE,
                                WE_MV, WADR_MV, RADR_MV, DAT_MV, NEW_PTB_RUN );
                                WE_MV, WADR_MV, RADR_MV, DAT_MV, NEW_PTB_RUN );
 
 
Line 141... Line 174...
 
 
endmodule
endmodule
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
//      3. DCA_CONTROL  Data cache valid memory update and initalization controller
//      4. DCA_CONTROL  Data cache valid memory update and initalization controller
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
module DCA_CONTROL ( BCLK, MCLK, BRESET, CUPDATE, DRAM_ACC, CA_SET, HIT_ALL, WRCFG, VADR_R, UPDATE, INVAL_A, WRITE,
module DCA_CONTROL ( BCLK, MCLK, BRESET, CUPDATE, DRAM_ACC, CA_SET, HIT_ALL, WRCFG, VADR_R, UPDATE, INVAL_A, WRITE,
                                         WCTRL, KILL, WRCRAM0, WRCRAM1, WE_CV, WADR_CV, DAT_CV, INIT_CA_RUN, WRSET0, WRSET1 );
                                         WCTRL, KILL, WRCRAM0, WRCRAM1, WE_CV, WADR_CV, DAT_CV, INIT_CA_RUN, WRSET0, WRSET1 );
 
 
Line 178... Line 211...
        reg                             dly_bclk,zero,wr_puls;
        reg                             dly_bclk,zero,wr_puls;
        reg              [2:0]   count,refer;
        reg              [2:0]   count,refer;
 
 
        wire                    countf;
        wire                    countf;
 
 
 
        always @(posedge BCLK) if (DRAM_ACC) ca_set_d <= CA_SET;        // Store for whole access
 
 
        // physical address is stored in TAG-RAM
        // physical address is stored in TAG-RAM
 
 
        assign WRCRAM0 = (CUPDATE & ~WCTRL[0]) & ~CA_SET;
        assign WRCRAM0 = (CUPDATE & ~WCTRL[0]) & ~ca_set_d;
        assign WRCRAM1 = (CUPDATE & ~WCTRL[0]) &  CA_SET;
        assign WRCRAM1 = (CUPDATE & ~WCTRL[0]) &  ca_set_d;
 
 
        // Load Valid RAM :
        // Load Valid RAM :
 
 
        assign WE_CV   = state[1] | HIT_ALL | (CUPDATE & ~WCTRL[0]) | KILL; // Hit All for "Last" Update
        assign WE_CV   = state[1] | HIT_ALL | (CUPDATE & ~WCTRL[0]) | KILL; // Hit All for "Last" Update
        assign WADR_CV = state[1] ? acount : VADR_R;
        assign WADR_CV = state[1] ? acount : VADR_R;
Line 208... Line 243...
 
 
        always @(posedge BCLK) if (!state[1]) acount <= 5'h0; else acount <= acount + 5'h01;
        always @(posedge BCLK) if (!state[1]) acount <= 5'h0; else acount <= acount + 5'h01;
 
 
        assign INIT_CA_RUN = state[1];
        assign INIT_CA_RUN = state[1];
 
 
        always @(posedge BCLK) if (DRAM_ACC) ca_set_d <= CA_SET;
 
 
 
        // WRITE Control in data RAMs
        // WRITE Control in data RAMs
        assign WRSET0 = ( ~CA_SET & WRITE & HIT_ALL & wr_puls) | (WCTRL[1] & ~ca_set_d);
        assign WRSET0 = ( ~CA_SET & WRITE & HIT_ALL & wr_puls) | (WCTRL[1] & ~ca_set_d);
        assign WRSET1 = (  CA_SET & WRITE & HIT_ALL & wr_puls) | (WCTRL[1] &  ca_set_d);
        assign WRSET1 = (  CA_SET & WRITE & HIT_ALL & wr_puls) | (WCTRL[1] &  ca_set_d);
 
 
        // ++++++++++++ Special circuit for Timing of write pulse for data RAM of data cache +++++++++
        // ++++++++++++ Special circuit for Timing of write pulse for data RAM of data cache +++++++++
Line 235... Line 268...
 
 
endmodule
endmodule
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
//      4. MMU_MATCH    MMU virtual address match detector
//      5. MMU_MATCH    MMU virtual address match detector
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
module MMU_MATCH ( USER, READ, WRITE, RMW, MCR_FLAGS, MVALID, VADR_R, MMU_VA, IVAR,
module MMU_MATCH ( USER, READ, WRITE, RMW, MCR_FLAGS, MVALID, VADR_R, MMU_VA, IVAR,
                                   VIRTUELL, MMU_HIT , UPDATE, PROT_ERROR, CI, SEL_PTB1 );
                                   VIRTUELL, MMU_HIT , UPDATE, PROT_ERROR, CI, SEL_PTB1 );
 
 
Line 296... Line 329...
 
 
        assign match = (VADR_R[31:20] == MMU_VA[31:20]) & (adr_space == as_sorte) & ((MVALID[15:0] & maske) != 16'h0000);
        assign match = (VADR_R[31:20] == MMU_VA[31:20]) & (adr_space == as_sorte) & ((MVALID[15:0] & maske) != 16'h0000);
 
 
        assign alles_ok = match & ( ~WRITE | MMU_VA[17] ) & ~PROT_ERROR;        // Modified - Flag : reload the PTE
        assign alles_ok = match & ( ~WRITE | MMU_VA[17] ) & ~PROT_ERROR;        // Modified - Flag : reload the PTE
 
 
        // if MMU_HIT = 0 then there is no Write-Buffer access abd no update of cache !
        // if MMU_HIT = 0 then there is no Write-Buffer access and no update of cache !
        assign MMU_HIT = zugriff ? ( VIRTUELL ? alles_ok : 1'b1 ) : 1'b0 ;      // MMU off : then always HIT
        assign MMU_HIT = zugriff ? ( VIRTUELL ? alles_ok : 1'b1 ) : 1'b0 ;      // MMU off : then always HIT
 
 
        assign val_bits = IVAR[1] ? (MVALID[15:0] & (match ? ~maske : 16'hFFFF)) : (MVALID[15:0] | maske);
        assign val_bits = IVAR[1] ? (MVALID[15:0] & (match ? ~maske : 16'hFFFF)) : (MVALID[15:0] | maske);
        assign as_bits  = IVAR[1] ? MVALID[31:16] : (adr_space ? (MVALID[31:16] | maske) : (MVALID[31:16] & ~maske));
        assign as_bits  = IVAR[1] ? MVALID[31:16] : (adr_space ? (MVALID[31:16] | maske) : (MVALID[31:16] & ~maske));
 
 
Line 322... Line 355...
 
 
endmodule
endmodule
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
//      5. CA_MATCH             Cache tag match detector
//      6. CA_MATCH             Cache tag match detector
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
module CA_MATCH ( CVALID, IOSEL, ADDR, TAG0, TAG1, CFG, WRITE, MMU_HIT, CI, INVAL_L, KDET, ENDRAM, DC_ILO,
module CA_MATCH ( CVALID, DRAMSZ, ADDR, TAG0, TAG1, CFG, WRITE, MMU_HIT, CI, INVAL_L, KDET, ENDRAM, DC_ILO,
                                  CA_HIT, CA_SET, UPDATE, IO_SPACE, USE_CA, WB_ACC, KILL );
                                  CA_HIT, CA_SET, UPDATE, IO_SPACE, USE_CA, WB_ACC, KILL );
 
 
        input   [23:0]   CVALID;
        input   [23:0]   CVALID;
        input    [3:0]   IOSEL;
        input    [2:0]   DRAMSZ;
        input   [27:4]  ADDR;
        input   [31:4]  ADDR;
        input  [27:12]  TAG0,TAG1;
        input  [27:12]  TAG0,TAG1;
        input    [1:0]   CFG;    // LDC , DC
        input    [1:0]   CFG;    // LDC , DC
        input                   WRITE;
        input                   WRITE;
        input                   MMU_HIT;
        input                   MMU_HIT;
        input                   CI;
        input                   CI;
Line 350... Line 383...
        output                  USE_CA;
        output                  USE_CA;
        output                  WB_ACC;
        output                  WB_ACC;
        output                  KILL;
        output                  KILL;
 
 
        reg              [7:0]   maske;
        reg              [7:0]   maske;
 
        reg              [4:0]   szmaske;
 
 
        wire                    match_0,match_1;
        wire                    match_0,match_1;
        wire                    valid_0,valid_1;
        wire                    valid_0,valid_1;
        wire                    select;
        wire                    select;
        wire                    clear;
        wire                    clear;
        wire     [7:0]   update_0,update_1,lastinfo;
        wire     [7:0]   update_0,update_1,lastinfo;
        wire                    sel_dram;
        wire                    sel_dram,filter;
 
 
        always @(ADDR)
        always @(ADDR)
                case (ADDR[6:4])
                case (ADDR[6:4])
                  3'h0 : maske = 8'h01;
                  3'h0 : maske = 8'h01;
                  3'h1 : maske = 8'h02;
                  3'h1 : maske = 8'h02;
Line 394... Line 428...
 
 
        assign UPDATE = {lastinfo,update_1,update_0};
        assign UPDATE = {lastinfo,update_1,update_0};
 
 
        assign KILL = clear & CA_HIT & ~CFG[1];         // only if cache is not locked
        assign KILL = clear & CA_HIT & ~CFG[1];         // only if cache is not locked
 
 
        assign sel_dram = (IOSEL == 4'b0000) & ENDRAM;  // at the moment the first 256 MB of memory
        always @(DRAMSZ)        // Size of DRAM
 
                casex (DRAMSZ)
 
                   3'b00x : szmaske = 5'h1F;    //   8 MB 32016 Second Processor
 
        //         3'b001 reserved for Ceres III
 
                   3'b01x : szmaske = 5'h10;    // 128 MB MCUBE
 
                default   : szmaske = 5'h00;    // 256 MB NetBSD
 
                endcase
 
 
 
        assign filter   = ((ADDR[27:23] & szmaske) == 5'd0);
 
        assign sel_dram =  (ADDR[31:28] == 4'd0) & filter & ENDRAM;
        assign IO_SPACE = ~sel_dram;                                    // not DRAM or DRAM ist off
        assign IO_SPACE = ~sel_dram;                                    // not DRAM or DRAM ist off
 
 
        assign USE_CA   = ~CI & ~DC_ILO & CFG[0] & ~CFG[1];      // CI ? ILO ? Cache on ? Locked Cache ? 
        assign USE_CA   = ~CI & ~DC_ILO & CFG[0] & ~CFG[1];      // CI ? ILO ? Cache on ? Locked Cache ? 
        assign WB_ACC   = WRITE & MMU_HIT & sel_dram;
        assign WB_ACC   = WRITE & MMU_HIT & sel_dram;
 
 
endmodule
endmodule
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
//      6. DCACHE_SM    Data cache state machine
//      7. FILTCMP              Address Filter and Comparator
 
//
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
module FILTCMP ( DRAMSZ, RADR, DRAM_A, ADR_EQU, TAGDAT );
 
 
 
        input    [2:0]   DRAMSZ;
 
        input   [27:4]  RADR,DRAM_A;
 
 
 
        output                  ADR_EQU;
 
        output reg      [27:12] TAGDAT;
 
 
 
        reg        [27:23]      adram;
 
 
 
        always @(DRAMSZ or RADR)
 
                casex (DRAMSZ)
 
                  3'b00x : TAGDAT = {5'd0,RADR[22:12]}; //   8 MB
 
                  3'bx10 : TAGDAT = {3'd0,RADR[24:12]}; //  32 MB
 
                  3'bx11 : TAGDAT = {2'd0,RADR[25:12]}; //  64 MB
 
                  3'b100 : TAGDAT = {1'd0,RADR[26:12]}; // 128 MB
 
                  3'b101 : TAGDAT =       RADR[27:12] ; // 256 MB
 
                endcase
 
 
 
        always @(DRAMSZ or DRAM_A)      // The address comparator is only used in the data cache.
 
                casex (DRAMSZ)
 
                  3'b00x : adram =  5'd0;                                       //   8 MB
 
                  3'bx10 : adram = {3'd0,DRAM_A[24:23]};        //  32 MB
 
                  3'bx11 : adram = {2'd0,DRAM_A[25:23]};        //  64 MB
 
                  3'b100 : adram = {1'd0,DRAM_A[26:23]};        // 128 MB
 
                  3'b101 : adram =       DRAM_A[27:23] ;        // 256 MB
 
                endcase
 
 
 
        assign ADR_EQU = {TAGDAT,RADR[11:4]} == {adram,DRAM_A[22:4]};
 
 
 
endmodule
 
 
 
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
//
 
//      8. DCACHE_SM    Data cache state machine
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
module DCACHE_SM ( BCLK, BRESET, IO_SPACE, MDONE, IO_READY, MMU_HIT, CA_HIT, READ, WRITE, ZTEST, RMW, CAPDAT, VADR_R, IC_VA,
module DCACHE_SM ( BCLK, BRESET, IO_SPACE, MDONE, IO_READY, MMU_HIT, CA_HIT, READ, WRITE, ZTEST, RMW, CAPDAT, VADR_R, IC_VA,
                                   USE_CA, PTB_WR, PTB_SEL, SEL_PTB1, CPU_OUT, USER, PROT_ERROR, WB_ACC, ENWR, ADR_EQU, IC_PREQ, FILLRAM, ICTODC,
                                   USE_CA, PTB_WR, PTB_SEL, SEL_PTB1, CPU_OUT, USER, PROT_ERROR, WB_ACC, ENWR, ADR_EQU, IC_PREQ, DMA_CHK, ICTODC,
                                   RWVAL, VIRTUELL, QWATWO,
                                   RWVAL, VIRTUELL, QWATWO,
                                   DRAM_ACC, DRAM_WR, IO_ACC, IO_RD, IO_WR, PTE_MUX, PD_MUX, PKEEP, PTE_ADR, PTE_DAT, HIT_ALL, ACC_OK,
                                   DRAM_ACC, DRAM_WR, IO_ACC, IO_RD, IO_WR, PTE_MUX, PD_MUX, PKEEP, PTE_ADR, PTE_DAT, HIT_ALL, ACC_OK,
                                   ABORT, PROTECT, IACC_STAT, ABO_LEVEL1, WR_MRAM, CUPDATE, AUX_DAT, NEW_PTB, PTB_ONE, MMU_DIN, IC_SIGS, KOMUX,
                                   ABORT, PROTECT, IACC_STAT, ABO_LEVEL1, WR_MRAM, CUPDATE, AUX_DAT, NEW_PTB, PTB_ONE, MMU_DIN, IC_SIGS, KOMUX,
                                   KDET, DMA_MUX, HLDA, RWVFLAG, PTE_STAT );
                                   KDET, DMA_MUX, HLDA, RWVFLAG, PTE_STAT );
 
 
Line 432... Line 513...
        input                   PROT_ERROR;
        input                   PROT_ERROR;
        input                   WB_ACC;
        input                   WB_ACC;
        input                   ENWR;           // Enable WRITE from DRAM
        input                   ENWR;           // Enable WRITE from DRAM
        input                   ADR_EQU;
        input                   ADR_EQU;
        input                   IC_PREQ;
        input                   IC_PREQ;
        input                   FILLRAM;
        input                   DMA_CHK;
        input    [3:0]   ICTODC;         // multiple signals from ICACHE, especially DMA
        input    [3:0]   ICTODC;         // multiple signals from ICACHE, especially DMA
        input    [1:0]   RWVAL;          // RDVAL+WRVAL Operation
        input    [1:0]   RWVAL;          // RDVAL+WRVAL Operation
        input                   VIRTUELL;       // for RDVAL/WRVAL
        input                   VIRTUELL;       // for RDVAL/WRVAL
        input                   QWATWO;
        input                   QWATWO;
 
 
Line 551... Line 632...
                // DRAM access : Cache Miss at READ : 
                // DRAM access : Cache Miss at READ : 
                  13'b10_0x_1100_00_x_x0 : new_state = 7'b0010010;
                  13'b10_0x_1100_00_x_x0 : new_state = 7'b0010010;
                // DRAM access : WRITE
                // DRAM access : WRITE
                  13'b10_0x_101x_x0_x_x0 : new_state = 7'b0000100;
                  13'b10_0x_101x_x0_x_x0 : new_state = 7'b0000100;
                // PTE Request ICACHE , IO access with WRITE is stored - parallel DRAM access possible
                // PTE Request ICACHE , IO access with WRITE is stored - parallel DRAM access possible
                  13'b0x_xx_xxxx_x0_1_00 : new_state = 7'b0101010;      // no access
                  13'b0x_xx_xxxx_x0_1_x0 : new_state = 7'b0101010;      // no access
                  13'b10_0x_1101_x0_1_x0 : new_state = 7'b0101010;      // if successful READ a PTE access can happen in parallel
                  13'b10_0x_1101_x0_1_x0 : new_state = 7'b0101010;      // if successful READ a PTE access can happen in parallel
                // DMA access. Attention : no IO-Write access in background and no ICACHE PTE access !
                // DMA access. Attention : no IO-Write access in background and no ICACHE PTE access !
                  13'b0x_x0_xxxx_xx_0_10 : new_state = 7'b1000000;      // DMA access is started
                  13'b0x_x0_xxxx_x0_0_10 : new_state = 7'b1000000;      // DMA access is started
                  default                                : new_state = 7'b0;
                  default                                : new_state = 7'b0;
                endcase
                endcase
 
 
        assign IO_ACC   = new_state[0];  // to load registers for data, addr und BE, signal one pulse
        assign IO_ACC   = new_state[0];  // to load registers for data, addr und BE, signal one pulse
        assign dram_go  = new_state[1] | rd_level2 ;
        assign dram_go  = new_state[1] | rd_level2 ;
Line 708... Line 789...
 
 
        always @(posedge BCLK) dma_run <= (dma_go | (dma_run & dma)) & BRESET;  // stops the data access until HOLD becomes inactive
        always @(posedge BCLK) dma_run <= (dma_go | (dma_run & dma)) & BRESET;  // stops the data access until HOLD becomes inactive
 
 
        assign HLDA = ~(ICTODC[1] & dma_run);   // Signal for system that the CPU has stopped accesses
        assign HLDA = ~(ICTODC[1] & dma_run);   // Signal for system that the CPU has stopped accesses
 
 
        always @(posedge BCLK) dma_kdet <= FILLRAM;
        always @(posedge BCLK) dma_kdet <= DMA_CHK;
        assign DMA_MUX = FILLRAM | dma_kdet;
        assign DMA_MUX = DMA_CHK | dma_kdet;
 
 
        // global feedback to ADDR_UNIT, early feedback to Op-Dec : you can continue
        // global feedback to ADDR_UNIT, early feedback to Op-Dec : you can continue
 
 
        assign ACC_OK = ZTEST ? (~VIRTUELL | zt_ok)
        assign ACC_OK = ZTEST ? (~VIRTUELL | zt_ok)
                                                  : (IO_SPACE ? ((IO_ACC & WRITE) | rd_done) : (wr_dram | (READ & MMU_HIT & rd_ende & run_dc)) );
                                                  : (IO_SPACE ? ((IO_ACC & WRITE) | rd_done) : (wr_dram | (READ & MMU_HIT & rd_ende & run_dc)) );

powered by: WebSVN 2.1.0

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