Skip to content

reg_t type definition & refactoring#214

Open
RexPaster wants to merge 4 commits intoUTOSS:mainfrom
RexPaster:reg_t
Open

reg_t type definition & refactoring#214
RexPaster wants to merge 4 commits intoUTOSS:mainfrom
RexPaster:reg_t

Conversation

@RexPaster
Copy link
Copy Markdown
Contributor

closes #213
This pull request refactors the codebase to introduce a new typedef, reg_t, for register address fields (5 bits wide), and updates all relevant modules and testbenches to use this new type instead of raw [4:0] logic vectors. This improves code readability, type safety, and consistency across the project.

Type definition and usage standardization:

  • Added a new typedef reg_t as logic [4:0] in src/types.svh, and included this type definition where needed. [1] [2] [3] [4]

Module and interface updates:

  • Updated all module interfaces and internal signals that represent register addresses (rd, rs1, rs2, Addr1, Addr2, Addr3) to use reg_t instead of [4:0]. This includes changes in Instruction_Decode.sv, RegisterFile.v, Logger.sv, decoder.sv, utoss_riscv.sv, and the testbench rf_tb.sv. [1] [2] [3] [4] [5] [6]

Rename src/Instruction_Decode/RegisterFile.v to RegisterFile.sv and update references across the project. Updated Quartus QSF to treat RegisterFile.sv as a SYSTEMVERILOG_FILE (also fixed pkg_control_fsm extension to .svh), adjusted src/Instruction_Decode/Makefile SRCS and test target to use the .sv file, and modified testInstructDecode.tcl to svlog the SystemVerilog file. No functional changes to the module implemented—just tooling/build updates for SystemVerilog support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add register type

1 participant