Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code clean-up of the number of register address bits #2483

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

JeanRochCoulon
Copy link
Contributor

@JeanRochCoulon JeanRochCoulon commented Aug 30, 2024

rs1[4:0], rs2[4:0], rd[4:0] are replaced by rs1, rs2 and rd.

core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated
Comment on lines 1410 to 1413
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.use_pc = 1'b1;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.use_pc = 1'b1;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.use_pc = 1'b1;
instruction_o.rd = instr.utype.rd;

core/decoder.sv Outdated Show resolved Hide resolved
core/decoder.sv Outdated
Comment on lines 475 to 476
check_fprm = 1'b1;
allow_replication = 1'b1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
check_fprm = 1'b1;
allow_replication = 1'b1;
check_fprm = 1'b1;
allow_replication = 1'b1;

core/decoder.sv Outdated
Comment on lines 480 to 481
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0

core/decoder.sv Outdated
check_fprm = 1'b1;
allow_replication = 1'b1;
// decode vectorial FP instruction
unique case (instr.rvftype.vecfltop)
5'b00001: begin
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0
instruction_o.rs2[4:0] = instr.rvftype.rs1; // Operand B is set to rs1
instruction_o.rs2 = instr.rvftype.rs1; // Operand B is set to rs1
imm_select = IIMM; // Operand C is set to rs2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = IIMM; // Operand C is set to rs2
imm_select = IIMM; // Operand C is set to rs2

core/decoder.sv Outdated
@@ -820,9 +820,9 @@
// --------------------------
riscv::OpcodeOp32: begin
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;

core/decoder.sv Outdated
@@ -1391,9 +1391,9 @@
riscv::OpcodeJalr: begin
instruction_o.fu = CTRL_FLOW;
instruction_o.op = ariane_pkg::JALR;
instruction_o.rs1[4:0] = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rs1 = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;

core/decoder.sv Outdated
imm_select = IIMM;
instruction_o.rd[4:0] = instr.itype.rd;
instruction_o.rd = instr.itype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.itype.rd;
instruction_o.rd = instr.itype.rd;

core/decoder.sv Outdated
Comment on lines 480 to 481
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0

core/decoder.sv Outdated
// decode vectorial FP instruction
unique case (instr.rvftype.vecfltop)
5'b00001: begin
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0
instruction_o.rs2[4:0] = instr.rvftype.rs1; // Operand B is set to rs1
instruction_o.rs2 = instr.rvftype.rs1; // Operand B is set to rs1
imm_select = IIMM; // Operand C is set to rs2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = IIMM; // Operand C is set to rs2
imm_select = IIMM; // Operand C is set to rs2

core/decoder.sv Outdated
@@ -820,9 +820,9 @@ module decoder
// --------------------------
riscv::OpcodeOp32: begin
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;

core/decoder.sv Outdated
@@ -1391,9 +1391,9 @@ module decoder
riscv::OpcodeJalr: begin
instruction_o.fu = CTRL_FLOW;
instruction_o.op = ariane_pkg::JALR;
instruction_o.rs1[4:0] = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rs1 = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;

core/decoder.sv Outdated
imm_select = IIMM;
instruction_o.rd[4:0] = instr.itype.rd;
instruction_o.rd = instr.itype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.itype.rd;
instruction_o.rd = instr.itype.rd;

core/decoder.sv Outdated
@@ -1402,21 +1402,21 @@ module decoder
riscv::OpcodeJal: begin
instruction_o.fu = CTRL_FLOW;
imm_select = JIMM;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.utype.rd;
instruction_o.rd = instr.utype.rd;

core/decoder.sv Outdated
instruction_o.rs2[4:0] = instr.rvftype.rs1; // Operand B is set to rs1
instruction_o.op = ariane_pkg::FADD; // vfadd.vfmt - Vectorial FP Addition
instruction_o.rs1 = '0; // Operand A is set to 0
instruction_o.rs2 = instr.rvftype.rs1; // Operand B is set to rs1
imm_select = IIMM; // Operand C is set to rs2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = IIMM; // Operand C is set to rs2
imm_select = IIMM; // Operand C is set to rs2

core/decoder.sv Outdated
@@ -820,9 +820,9 @@
// --------------------------
riscv::OpcodeOp32: begin
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;

core/decoder.sv Outdated
@@ -1391,9 +1391,9 @@
riscv::OpcodeJalr: begin
instruction_o.fu = CTRL_FLOW;
instruction_o.op = ariane_pkg::JALR;
instruction_o.rs1[4:0] = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rs1 = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;

core/decoder.sv Outdated
imm_select = IIMM;
instruction_o.rd[4:0] = instr.itype.rd;
instruction_o.rd = instr.itype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.itype.rd;
instruction_o.rd = instr.itype.rd;

core/decoder.sv Outdated
@@ -1402,21 +1402,21 @@
riscv::OpcodeJal: begin
instruction_o.fu = CTRL_FLOW;
imm_select = JIMM;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.utype.rd;
instruction_o.rd = instr.utype.rd;

core/decoder.sv Outdated
@@ -820,9 +820,9 @@ module decoder
// --------------------------
riscv::OpcodeOp32: begin
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;

core/decoder.sv Outdated
@@ -1391,9 +1391,9 @@ module decoder
riscv::OpcodeJalr: begin
instruction_o.fu = CTRL_FLOW;
instruction_o.op = ariane_pkg::JALR;
instruction_o.rs1[4:0] = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rs1 = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;

core/decoder.sv Outdated
imm_select = IIMM;
instruction_o.rd[4:0] = instr.itype.rd;
instruction_o.rd = instr.itype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.itype.rd;
instruction_o.rd = instr.itype.rd;

core/decoder.sv Outdated
@@ -1402,21 +1402,21 @@ module decoder
riscv::OpcodeJal: begin
instruction_o.fu = CTRL_FLOW;
imm_select = JIMM;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.utype.rd;
instruction_o.rd = instr.utype.rd;

core/decoder.sv Outdated
Comment on lines 1417 to 1418
imm_select = UIMM;
instruction_o.fu = ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = UIMM;
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.fu = ALU;

core/decoder.sv Outdated
imm_select = IIMM;
instruction_o.rd[4:0] = instr.itype.rd;
instruction_o.rd = instr.itype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.itype.rd;
instruction_o.rd = instr.itype.rd;

core/decoder.sv Outdated
@@ -1402,21 +1402,21 @@ module decoder
riscv::OpcodeJal: begin
instruction_o.fu = CTRL_FLOW;
imm_select = JIMM;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.utype.rd;
instruction_o.rd = instr.utype.rd;

core/decoder.sv Outdated
Comment on lines 1417 to 1418
imm_select = UIMM;
instruction_o.fu = ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = UIMM;
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.fu = ALU;

core/decoder.sv Outdated
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.rs1 = instr.rtype.rs1;
instruction_o.rs2 = instr.rtype.rs2;
instruction_o.rd = instr.rtype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.rtype.rd;
instruction_o.rd = instr.rtype.rd;

core/decoder.sv Outdated
@@ -1391,9 +1391,9 @@ module decoder
riscv::OpcodeJalr: begin
instruction_o.fu = CTRL_FLOW;
instruction_o.op = ariane_pkg::JALR;
instruction_o.rs1[4:0] = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rs1 = instr.itype.rs1;
instruction_o.rs1 = instr.itype.rs1;

core/decoder.sv Outdated
imm_select = IIMM;
instruction_o.rd[4:0] = instr.itype.rd;
instruction_o.rd = instr.itype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.itype.rd;
instruction_o.rd = instr.itype.rd;

core/decoder.sv Outdated
@@ -1402,21 +1402,21 @@ module decoder
riscv::OpcodeJal: begin
instruction_o.fu = CTRL_FLOW;
imm_select = JIMM;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.utype.rd;
instruction_o.rd = instr.utype.rd;

core/decoder.sv Outdated
Comment on lines 1417 to 1418
imm_select = UIMM;
instruction_o.fu = ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = UIMM;
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.fu = ALU;

core/decoder.sv Outdated
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.rs1 = instr.rtype.rs1;
instruction_o.rs2 = instr.rtype.rs2;
instruction_o.rd = instr.rtype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.rtype.rd;
instruction_o.rd = instr.rtype.rd;

core/decoder.sv Outdated
@@ -1402,21 +1402,21 @@
riscv::OpcodeJal: begin
instruction_o.fu = CTRL_FLOW;
imm_select = JIMM;
instruction_o.rd[4:0] = instr.utype.rd;
instruction_o.rd = instr.utype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.utype.rd;
instruction_o.rd = instr.utype.rd;

core/decoder.sv Outdated
Comment on lines 1417 to 1418
imm_select = UIMM;
instruction_o.fu = ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = UIMM;
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.fu = ALU;

core/decoder.sv Outdated
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.rs1 = instr.rtype.rs1;
instruction_o.rs2 = instr.rtype.rs2;
instruction_o.rd = instr.rtype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.rtype.rd;
instruction_o.rd = instr.rtype.rd;

core/decoder.sv Outdated
Comment on lines 1417 to 1418
imm_select = UIMM;
instruction_o.fu = ALU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
imm_select = UIMM;
instruction_o.fu = ALU;
imm_select = UIMM;
instruction_o.fu = ALU;

core/decoder.sv Outdated
instruction_o.fu = (instr.rtype.funct7 == 7'b000_0001) ? MULT : ALU;
instruction_o.rs1 = instr.rtype.rs1;
instruction_o.rs2 = instr.rtype.rs2;
instruction_o.rd = instr.rtype.rd;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.rd = instr.rtype.rd;
instruction_o.rd = instr.rtype.rd;

core/decoder.sv Outdated
@@ -1102,9 +1102,9 @@
riscv::OpcodeMadd, riscv::OpcodeMsub, riscv::OpcodeNmsub, riscv::OpcodeNmadd: begin
if (CVA6Cfg.FpPresent && fs_i != riscv::Off && ((CVA6Cfg.RVH && (!v_i || vfs_i != riscv::Off)) || !CVA6Cfg.RVH)) begin // only generate decoder if FP extensions are enabled (static)
instruction_o.fu = FPU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.fu = FPU;
instruction_o.fu = FPU;

core/decoder.sv Outdated
@@ -1102,9 +1102,9 @@ module decoder
riscv::OpcodeMadd, riscv::OpcodeMsub, riscv::OpcodeNmsub, riscv::OpcodeNmadd: begin
if (CVA6Cfg.FpPresent && fs_i != riscv::Off && ((CVA6Cfg.RVH && (!v_i || vfs_i != riscv::Off)) || !CVA6Cfg.RVH)) begin // only generate decoder if FP extensions are enabled (static)
instruction_o.fu = FPU;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[verible-verilog-format] reported by reviewdog 🐶

Suggested change
instruction_o.fu = FPU;
instruction_o.fu = FPU;

Copy link
Contributor

✔️ successful run, report available here.

@JeanRochCoulon
Copy link
Contributor Author

@ASintzoff ready to merge

@ASintzoff ASintzoff merged commit 8ef2859 into openhwgroup:master Aug 30, 2024
10 checks passed
@JeanRochCoulon JeanRochCoulon deleted the regaddrbits branch September 3, 2024 12:42
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.

2 participants