This commits implements the Bit Manipulateion Extension ZBT instruction group: cmix, cmov, fsr[i] and fsl. Those are instructions depend on three ALU operands. Completeion of these instructions takes 2 clock cycles. Additionally, the rotation shifts rol and ror are made multicycle instructions. All multicycle instructions take exactly two cycles to complete. Architectural additions: * Multicycle Stage Register in ID stage. multicycle_op_stage_reg * Decoder generates alu_multicycle signal, to stall pipeline * For all ternary instructions: 1. cycle: connect alu operands a and b to rs1 and rs2 respectively 2. cycle: connect operands a and be to rs3 and rs2 respectively * Reduce the physical size of the shifter from 64 bit to 63 bit: 32-bit operand + 1 bit for arithmetic / one-shift * Make rotation shifts multicycle instructions. Instruction Details: * cmov: 1. store operand a (rs1) in stage reg. 2. return stage reg output (rs2) or rs3. if rs2 != 0 the output (rs1) is already known in the first cycle. -> variable latency implementation is possible. * cmix: 1. store rs1 & rs2 in stage reg 2. return stage_reg_q | (rs2 & ~rs3) reusing bwlogic from zbb * rol/ror: (here: ror) shift_amt = rs2 & 31; shift_amt_compl = (32 - shift_amt) & 31 1. store (rs1 >> shift_amt) in stage reg 2. return (rs1 << shift_amt_compl) | stage_reg_q * fsl/fsr: For funnel shifts, the order of applying the shift amount or its complement is determined by bit [5] of shift_amt. Pseudocode for fsr: shift_amt = rs2 & 63 shift_amt_compl = (32 - shift_amt[4:0]) 1. if (shift_amt >= 33): store (rs1 >> shift_amt_compl[4:0]) in stage reg else if (shift_amt <0 && shift_amt <= 31): store (rs1 << shift_amt[4:0]) in stage reg else if (shift_amt == 32 || shift_amt == 0): store rs1 in stage reg 2. if (shift_amt >= 33): return stage_reg_q | (rs3 << shift_amt[4:0]) else if (shift_amt <0 && shift_amt <= 31): return stage_reg_q | (rs3 >> shift_amt_compl[4:0]) else if (shift_amt == 32): return rs3 else if (shift_amt == 0): return rs1 Signed-off-by: ganoam <gnoam@live.com> |
||
---|---|---|
ci | ||
doc | ||
dv | ||
examples | ||
lint | ||
rtl | ||
shared | ||
syn | ||
util | ||
vendor | ||
.clang-format | ||
.gitignore | ||
azure-pipelines.yml | ||
check_tool_requirements.core | ||
CONTRIBUTING.md | ||
CREDITS.md | ||
ibex_configs.yaml | ||
ibex_core.core | ||
ibex_core_tracing.core | ||
ibex_icache.core | ||
ibex_pkg.core | ||
ibex_tracer.core | ||
LICENSE | ||
Makefile | ||
python-requirements.txt | ||
README.md | ||
src_files.yml | ||
tool_requirements.py |
Ibex RISC-V Core
Ibex is a small and efficient, 32-bit, in-order RISC-V core with a 2-stage pipeline that implements the RV32IMC instruction set architecture.
Ibex offers several configuration parameters to meet the needs of various application scenarios. The options include two different choices for the architecture of the multiplier and divider unit, as well as the possibility to drop the support for the "M" extension completely. In addition, the "E" extension can be enabled when opting for a minimum-area configuration.
This core was initially developed as part of the PULP platform under the name "Zero-riscy" [1], and has been contributed to lowRISC who maintains it and develops it further. It is under active development, with further code cleanups, feature additions, and test and verification planned for the future.
Documentation
The Ibex user manual can be
read online at ReadTheDocs. It is also contained in
the doc
folder of this repository.
Contributing
We highly appreciate community contributions. To ease our work of reviewing your contributions, please:
- Create your own branch to commit your changes and then open a Pull Request.
- Split large contributions into smaller commits addressing individual changes or bug fixes. Do not mix unrelated changes into the same commit!
- Write meaningful commit messages. For more information, please check out the contribution guide.
- If asked to modify your changes, do fixup your commits and rebase your branch to maintain a clean history.
When contributing SystemVerilog source code, please try to be consistent and adhere to our Verilog coding style guide.
When contributing C or C++ source code, please try to adhere to the OpenTitan C++ coding style
guide.
All C and C++ code should be formatted with clang-format before committing.
Either run clang-format -i filename.cc
or git clang-format
on added files.
To get started, please check out the "Good First Issue" list.
Issues and Troubleshooting
If you find any problems or issues with Ibex or the documentation, please check out the issue tracker and create a new issue if your problem is not yet tracked.
Questions?
Do not hesitate to contact us, e.g., on our public Ibex channel on Zulip!
License
Unless otherwise noted, everything in this repository is covered by the Apache License, Version 2.0 (see LICENSE for full text).
Credits
Many people have contributed to Ibex through the years. Please have a look at the credits file and the commit history for more information.