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: ICACHE.v
|
// Filename: ICACHE.v
|
// Version: 3.0 Cache Interface reworked
|
// Project: M32632
|
// History: 2.0 50 MHz release of 14 August 2016
|
// Version: 3.1 bug fix of 25 February 2019
|
|
// History: 3.0 Cache Interface reworked
|
|
// 2.0 50 MHz release of 14 August 2016
|
// 1.0 first release of 30 Mai 2015
|
// 1.0 first release of 30 Mai 2015
|
// Date: 2 December 2018
|
// Author: Udo Moeller
|
|
// Date: 8 July 2017
|
//
|
//
|
// Copyright (C) 2018 Udo Moeller
|
// Copyright (C) 2019 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 38... |
Line 41... |
// ICACHE the instruction cache of M32632
|
// ICACHE the instruction cache of M32632
|
//
|
//
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
module ICACHE( BCLK, DRAMSZ, MDONE, BRESET, READ_I, IO_READY, PSR_USER, DATA_HOLD, PTB_WR, PTB_SEL, DRAM_WR,
|
module ICACHE( BCLK, DRAMSZ, MDONE, BRESET, READ_I, IO_READY, PSR_USER, DATA_HOLD, PTB_WR, PTB_SEL, DRAM_WR,
|
KDET, HOLD, CFG, DRAM_Q, CINVAL, IC_SIGS, IO_Q, IVAR, KOLLI_A, MCR_FLAGS, MMU_DIN, VADR,
|
KDET, HOLD, CFG, DRAM_Q, CINVAL, IC_SIGS, IO_Q, IVAR, IVAR_MUX, VADR_D, KOLLI_A, MCR_FLAGS, MMU_DIN, VADR_I,
|
INHIBIT, IO_RD, DRAM_ACC, INIT_RUN, PROT_ERROR, ACC_OK, IC_PREQ, KOLLISION, ENA_HK, STOP_CINV,
|
INHIBIT, IO_RD, DRAM_ACC, INIT_RUN, PROT_ERROR, ACC_OK, IC_PREQ, KOLLISION, ENA_HK, STOP_CINV,
|
DRAM_A, IC_DQ, IC_VA, ICTODC, IO_A, ENDRAM );
|
DRAM_A, IC_DQ, IC_VA, ICTODC, IO_A, ENDRAM );
|
|
|
input BCLK;
|
input BCLK;
|
input [2:0] DRAMSZ;
|
input [2:0] DRAMSZ;
|
Line 61... |
Line 64... |
input [127:0] DRAM_Q;
|
input [127:0] DRAM_Q;
|
input [1:0] CINVAL;
|
input [1:0] CINVAL;
|
input [1:0] IC_SIGS;
|
input [1:0] IC_SIGS;
|
input [31:0] IO_Q;
|
input [31:0] IO_Q;
|
input [1:0] IVAR;
|
input [1:0] IVAR;
|
|
input IVAR_MUX;
|
|
input [31:12] VADR_D;
|
input [28:4] KOLLI_A;
|
input [28:4] KOLLI_A;
|
input [3:0] MCR_FLAGS;
|
input [3:0] MCR_FLAGS;
|
input [23:0] MMU_DIN;
|
input [23:0] MMU_DIN;
|
input [31:0] VADR;
|
input [31:0] VADR_I;
|
input INHIBIT;
|
input INHIBIT;
|
input ENA_HK;
|
input ENA_HK;
|
input ENDRAM;
|
input ENDRAM;
|
|
|
output IO_RD;
|
output IO_RD;
|
Line 90... |
Line 95... |
reg [31:0] DFFE_IOR;
|
reg [31:0] DFFE_IOR;
|
reg HOLD_ON;
|
reg HOLD_ON;
|
reg DFF_HDFF1;
|
reg DFF_HDFF1;
|
reg DFF_IRD_REG;
|
reg DFF_IRD_REG;
|
|
|
|
wire [31:0] VADR;
|
wire [4:0] A_CV;
|
wire [4:0] A_CV;
|
wire ACOK;
|
wire ACOK;
|
wire [4:0] ACV;
|
wire [4:0] ACV;
|
wire AUX_DAT;
|
wire AUX_DAT;
|
wire CA_HIT;
|
wire CA_HIT;
|
Line 210... |
Line 216... |
|
|
assign LD_DRAM_A = ~DRAM_ACC | MDONE;
|
assign LD_DRAM_A = ~DRAM_ACC | MDONE;
|
|
|
assign ICTODC[3] = USER;
|
assign ICTODC[3] = USER;
|
|
|
|
assign VADR[31:12] = IVAR_MUX ? VADR_D : VADR_I[31:12];
|
|
assign VADR[11:0] = VADR_I[11:0];
|
|
|
always @(posedge BCLK) VADR_R <= VADR;
|
always @(posedge BCLK) VADR_R <= VADR;
|
|
|
always @(posedge BCLK) DFF_IRD_REG <= IO_RD;
|
always @(posedge BCLK) DFF_IRD_REG <= IO_RD;
|
|
|
always @(posedge BCLK) DFF_HDFF1 <= IO_READY;
|
always @(posedge BCLK) DFF_HDFF1 <= IO_READY;
|