mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Modify ALU to handle Zkne/K extension
This commit is contained in:
parent
7cb170c19b
commit
550f50debb
@ -2,8 +2,9 @@
|
||||
// alu.sv
|
||||
//
|
||||
// Written: David_Harris@hmc.edu, Sarah.Harris@unlv.edu, kekim@hmc.edu
|
||||
// kelvin.tran@okstate.edu, james.stine@okstate.edu
|
||||
// Created: 9 January 2021
|
||||
// Modified: 3 March 2023
|
||||
// Modified: 3 March 2023, 22 February 2024
|
||||
//
|
||||
// Purpose: RISC-V Arithmetic/Logic Unit
|
||||
//
|
||||
@ -33,9 +34,11 @@ module alu import cvw::*; #(parameter cvw_t P) (
|
||||
input logic W64, // W64-type instruction
|
||||
input logic SubArith, // Subtraction or arithmetic shift
|
||||
input logic [2:0] ALUSelect, // ALU mux select signal
|
||||
input logic [1:0] BSelect, // Binary encoding of if it's a ZBA_ZBB_ZBC_ZBS instruction
|
||||
input logic [2:0] ZBBSelect, // ZBB mux select signal
|
||||
input logic [3:0] BSelect, // Binary encoding of if it's a ZBA_ZBB_ZBC_ZBS instruction
|
||||
input logic [3:0] ZBBSelect, // ZBB mux select signal
|
||||
input logic [2:0] Funct3, // For BMU decoding
|
||||
input logic [6:0] Funct7, // For ZKNE and ZKND computation
|
||||
input logic [4:0] Rs2E, // For ZKNE and ZKND computation
|
||||
input logic [2:0] BALUControl, // ALU Control signals for B instructions in Execute Stage
|
||||
input logic BMUActive, // Bit manipulation instruction being executed
|
||||
input logic [1:0] CZero, // {czero.nez, czero.eqz} instructions active
|
||||
@ -89,10 +92,11 @@ module alu import cvw::*; #(parameter cvw_t P) (
|
||||
else assign PreALUResult = FullResult;
|
||||
|
||||
// Bit manipulation muxing
|
||||
if (P.ZBC_SUPPORTED | P.ZBS_SUPPORTED | P.ZBA_SUPPORTED | P.ZBB_SUPPORTED) begin : bitmanipalu
|
||||
if (P.ZBC_SUPPORTED | P.ZBS_SUPPORTED | P.ZBA_SUPPORTED | P.ZBB_SUPPORTED | P.ZBKB_SUPPORTED |
|
||||
P.ZBKC_SUPPORTED | P.ZBKX_SUPPORTED | P.ZKND_SUPPORTED | P.ZKNE_SUPPORTED | P.ZKNH_SUPPORTED) begin : bitmanipalu
|
||||
bitmanipalu #(P) balu(
|
||||
.A, .B, .W64, .BSelect, .ZBBSelect, .BMUActive,
|
||||
.Funct3, .LT,.LTU, .BALUControl, .PreALUResult, .FullResult,
|
||||
.Funct3, .Funct7, .Rs2E, .LT, .LTU, .BALUControl, .PreALUResult, .FullResult,
|
||||
.CondMaskB, .CondShiftA, .ALUResult);
|
||||
end else begin
|
||||
assign ALUResult = PreALUResult;
|
||||
|
Loading…
Reference in New Issue
Block a user