这个文章记录了我学习RISC-V蜂鸟E203处理器的学习历程
这是我正式阅读代码学习的第3个源代码文件
针对代码的学习,我结合自己的理解对每个module的接口,以及内部关键信号做了详细的注释说明
原创不易,请保护版权,转载联系作者,并请注明出处,标出原始链接,谢谢~~~
e203_ifu_litebpu.v
/*
Copyright 2017 Silicon Integrated Microelectronics, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
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.
*/
//=====================================================================
//-- _______ ___
//-- ( ____/ /__/
//-- \ \ __
//-- ____\ \ / /
//-- /_______\ /_/ MICROELECTRONICS
//--
//=====================================================================
// Designer : Bob Hu
//
// Description:
// The Lite-BPU module to handle very simple branch predication at IFU
//
// ====================================================================
// +++++++++++++++++++++++++++ 我的阅读笔记:
// 这个模块用于对指令微译码的结果进行进一步处理,用来预测是否需要跳转
// 分支预测采用最简单的静态分支预测,对于BXX等带条件跳转向后跳转为需要跳,向前跳转为不需要跳
// 对于jal和jalr等无需跳转的,不用进行预测,一定是跳转的,直接去跳转的地址取指令就行
// 对于PC和IR,IR是已经成功取到的指令,也就是EXU要执行的指令,PC是该IR中的指令
// 对应的地址
// +++++++++++++++++++++++++++++++++++++++++
`include "e203_defines.v"
module e203_ifu_litebpu(
// Current PC
input [`E203_PC_SIZE-1:0] pc, //被译码的指令(也就是当前EXU正在执行的指令)对应的pc指针值
// The mini-decoded info
input dec_jal, //从mini-decode模块送过来的,具体的指令译码结果信息,这个信号指示是直接跳转
input dec_jalr,