Skip to content

Commit

Permalink
Merge pull request #79 from pulp-platform/bump-core
Browse files Browse the repository at this point in the history
Update RI5CY to CV32E40P
  • Loading branch information
bluewww committed Apr 7, 2022
2 parents f3eaee4 + e1a9336 commit ddb66a7
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 161 deletions.
4 changes: 3 additions & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies:
cluster_interconnect: { git: "https://github.com/pulp-platform/cluster_interconnect.git", version: 1.1.1 }
fpnew: { git: "https://github.com/pulp-platform/fpnew.git", version: 0.6.6 }
jtag_pulp: { git: "https://github.com/pulp-platform/jtag_pulp.git", rev: "v0.1" }
cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: "pulpissimo-v3.4.0-rev4"}
cv32e40p: { git: "https://github.com/pulp-platform/cv32e40p.git", rev: "pulpissimo-v4.0.0"}
ibex: { git: "https://github.com/pulp-platform/ibex.git", rev: "pulpissimo-v6.1.2" }
scm: { git: "https://github.com/pulp-platform/scm.git", version: 1.0.1}
generic_FLL: { git: "https://github.com/pulp-platform/generic_FLL.git", rev: "1c92dc73a940392182fd4cb7b86f35649b349595" }
Expand Down Expand Up @@ -84,11 +84,13 @@ sources:
- rtl/fc/fc_demux.sv
- rtl/fc/fc_subsystem.sv
- rtl/fc/fc_hwpe.sv
- rtl/fc/cv32e40p_fp_wrapper.sv
- target: not(rtl)
files:
- rtl/fc/fc_demux.sv
- rtl/fc/fc_subsystem.sv
- rtl/fc/fc_hwpe.sv
- rtl/fc/cv32e40p_fp_wrapper.sv
# components
- files:
- rtl/components/apb_clkdiv.sv
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Update RI5CY to CV32E40P
- Remove PULP_TRAINING references
### Fixed
- Wire up uart char and error events
## [3.3.0] - 2022-04-04
## Changed
- Update riscv-dbg to v0.5.0 (synchronous jtag reset and bus error signaling)
Expand Down
116 changes: 116 additions & 0 deletions rtl/fc/cv32e40p_fp_wrapper.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// Copyright 2018 ETH Zurich and University of Bologna.
// Copyright and related rights are licensed under the Solderpad Hardware
// License, Version 0.51 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://solderpad.org/licenses/SHL-0.51. Unless required by applicable law
// or agreed to in writing, software, hardware and materials distributed under
// this 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.

// Wrapper for a fpnew
// Contributor: Davide Schiavone <[email protected]>

module cv32e40p_fp_wrapper import cv32e40p_apu_core_pkg::*; #(
parameter FP_DIVSQRT = 0
)
(
// Clock and Reset
input logic clk_i,
input logic rst_ni,

// APU Side: Master port
input logic apu_req_i,
output logic apu_gnt_o,

// request channel
input logic [APU_NARGS_CPU-1:0][31:0] apu_operands_i,
input logic [APU_WOP_CPU-1:0] apu_op_i,
input logic [APU_NDSFLAGS_CPU-1:0] apu_flags_i,

// response channel
output logic apu_rvalid_o,
output logic [31:0] apu_rdata_o,
output logic [APU_NUSFLAGS_CPU-1:0] apu_rflags_o
);


import cv32e40p_pkg::*;
import fpnew_pkg::*;

logic [fpnew_pkg::OP_BITS-1:0] fpu_op;
logic fpu_op_mod;
logic fpu_vec_op;

logic [fpnew_pkg::FP_FORMAT_BITS-1:0] fpu_dst_fmt;
logic [fpnew_pkg::FP_FORMAT_BITS-1:0] fpu_src_fmt;
logic [fpnew_pkg::INT_FORMAT_BITS-1:0] fpu_int_fmt;
logic [C_RM-1:0] fp_rnd_mode;



// assign apu_rID_o = '0;
assign {fpu_vec_op, fpu_op_mod, fpu_op} = apu_op_i;

assign {fpu_int_fmt, fpu_src_fmt, fpu_dst_fmt, fp_rnd_mode} = apu_flags_i;

localparam C_DIV = FP_DIVSQRT ? fpnew_pkg::MERGED : fpnew_pkg::DISABLED;

// -----------
// FPU Config
// -----------
// Features (enabled formats, vectors etc.)
localparam fpnew_pkg::fpu_features_t FPU_FEATURES = '{
Width: C_FLEN,
EnableVectors: C_XFVEC,
EnableNanBox: 1'b0,
FpFmtMask: {C_RVF, C_RVD, C_XF16, C_XF8, C_XF16ALT},
IntFmtMask: {C_XFVEC && C_XF8, C_XFVEC && (C_XF16 || C_XF16ALT), 1'b1, 1'b0}
};

// Implementation (number of registers etc)
localparam fpnew_pkg::fpu_implementation_t FPU_IMPLEMENTATION = '{
PipeRegs: '{// FP32, FP64, FP16, FP8, FP16alt
'{C_LAT_FP32, C_LAT_FP64, C_LAT_FP16, C_LAT_FP8, C_LAT_FP16ALT}, // ADDMUL
'{default: C_LAT_DIVSQRT}, // DIVSQRT
'{default: C_LAT_NONCOMP}, // NONCOMP
'{default: C_LAT_CONV}}, // CONV
UnitTypes: '{'{default: fpnew_pkg::MERGED}, // ADDMUL
'{default: C_DIV}, // DIVSQRT
'{default: fpnew_pkg::PARALLEL}, // NONCOMP
'{default: fpnew_pkg::MERGED}}, // CONV
PipeConfig: fpnew_pkg::AFTER
};

//---------------
// FPU instance
//---------------

fpnew_top #(
.Features ( FPU_FEATURES ),
.Implementation ( FPU_IMPLEMENTATION ),
.TagType ( logic )
) i_fpnew_bulk (
.clk_i ( clk_i ),
.rst_ni ( rst_ni ),
.operands_i ( apu_operands_i ),
.rnd_mode_i ( fpnew_pkg::roundmode_e'(fp_rnd_mode) ),
.op_i ( fpnew_pkg::operation_e'(fpu_op) ),
.op_mod_i ( fpu_op_mod ),
.src_fmt_i ( fpnew_pkg::fp_format_e'(fpu_src_fmt) ),
.dst_fmt_i ( fpnew_pkg::fp_format_e'(fpu_dst_fmt) ),
.int_fmt_i ( fpnew_pkg::int_format_e'(fpu_int_fmt) ),
.vectorial_op_i ( fpu_vec_op ),
.tag_i ( 1'b0 ),
.in_valid_i ( apu_req_i ),
.in_ready_o ( apu_gnt_o ),
.flush_i ( 1'b0 ),
.result_o ( apu_rdata_o ),
.status_o ( apu_rflags_o ),
.tag_o ( /* unused */ ),
.out_valid_o ( apu_rvalid_o ),
.out_ready_i ( 1'b1 ),
.busy_o ( /* unused */ )
);

endmodule // cv32e40p_fp_wrapper
Loading

0 comments on commit ddb66a7

Please sign in to comment.