Line 1... |
Line 1... |
/**
|
/*
|
* @file
|
* Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
|
* @copyright Copyright 2017 GNSS Sensor Ltd. All right reserved.
|
*
|
* @author Sergey Khabarov - sergeykhbr@gmail.com
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
* @brief Instruction Cache.
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
*/
|
*/
|
|
|
#ifndef __DEBUGGER_RIVERLIB_ICACHE_H__
|
#ifndef __DEBUGGER_RIVERLIB_ICACHE_H__
|
#define __DEBUGGER_RIVERLIB_ICACHE_H__
|
#define __DEBUGGER_RIVERLIB_ICACHE_H__
|
|
|
Line 51... |
Line 60... |
State_Idle,
|
State_Idle,
|
State_WaitGrant,
|
State_WaitGrant,
|
State_WaitResp,
|
State_WaitResp,
|
State_WaitAccept
|
State_WaitAccept
|
};
|
};
|
|
enum EHit {
|
|
Hit_Line1,
|
|
Hit_Line2,
|
|
Hit_Response,
|
|
Hit_Total
|
|
};
|
|
static const int ILINE_TOTAL = 2;
|
|
|
|
struct line_type {
|
|
sc_signal<sc_uint<BUS_ADDR_WIDTH - 3>> addr;
|
|
sc_signal<sc_uint<BUS_DATA_WIDTH>> data;
|
|
};
|
|
struct line_signal_type {
|
|
sc_bv<ILINE_TOTAL + 1> hit; // Hit_Total = ILINE_TOTAL + 1
|
|
sc_bv<ILINE_TOTAL> hit_hold;
|
|
sc_uint<BUS_DATA_WIDTH> hit_data;
|
|
sc_uint<BUS_DATA_WIDTH> hold_data;
|
|
};
|
|
|
struct RegistersType {
|
struct RegistersType {
|
sc_signal<sc_uint<BUS_ADDR_WIDTH - 3>> iline_addr;
|
line_type iline[ILINE_TOTAL];
|
sc_signal<sc_uint<BUS_DATA_WIDTH>> iline_data;
|
|
sc_signal<sc_uint<BUS_ADDR_WIDTH>> iline_addr_req;
|
sc_signal<sc_uint<BUS_ADDR_WIDTH>> iline_addr_req;
|
sc_signal<sc_uint<32>> iline_data_hit;
|
sc_signal<sc_uint<BUS_ADDR_WIDTH>> addr_processing;
|
sc_signal<sc_uint<BUS_ADDR_WIDTH>> iline_addr_hit;
|
|
sc_signal<sc_uint<2>> state;
|
sc_signal<sc_uint<2>> state;
|
sc_signal<bool> hit_line;
|
sc_signal<bool> double_req; // request 2-lines
|
|
sc_signal<bool> delay_valid;
|
|
sc_signal<sc_uint<32>> delay_data;
|
} v, r;
|
} v, r;
|
bool w_hit_req;
|
bool w_need_mem_req;
|
bool w_hit_line;
|
sc_uint<32> wb_hit_word;
|
bool w_hit;
|
line_signal_type wb_l[ILINE_TOTAL];
|
|
bool w_reuse_lastline;
|
|
bool w_wait_response;
|
};
|
};
|
|
|
|
|
#ifdef DBG_ICACHE_TB
|
#ifdef DBG_ICACHE_TB
|
SC_MODULE(ICache_tb) {
|
SC_MODULE(ICache_tb) {
|