Skip to content

Commit

Permalink
Merge pull request #259 from chipsalliance/wsip/export_dmi
Browse files Browse the repository at this point in the history
export DMI signals
  • Loading branch information
tmichalak authored Nov 8, 2024
2 parents 78cac32 + 2d86816 commit fe63594
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
6 changes: 4 additions & 2 deletions design/dmi/dmi_mux.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

module dmi_mux (

// Core access enable
input wire core_enable,
// Uncore access enable
input wire uncore_enable,

Expand Down Expand Up @@ -33,8 +35,8 @@ module dmi_mux (
assign is_uncore_aperture = (dmi_addr[6] & (dmi_addr[5] | dmi_addr[4]));

// Core signals
assign dmi_core_en = dmi_en & ~is_uncore_aperture;
assign dmi_core_wr_en = dmi_wr_en & ~is_uncore_aperture;
assign dmi_core_en = dmi_en & ~is_uncore_aperture & core_enable;
assign dmi_core_wr_en = dmi_wr_en & ~is_uncore_aperture & core_enable;
assign dmi_core_addr = dmi_addr;
assign dmi_core_wdata = dmi_wdata;

Expand Down
7 changes: 6 additions & 1 deletion design/el2_veer_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,14 @@ import el2_pkg::*;
input logic mbist_mode, // to enable mbist

// DMI port for uncore
input logic dmi_core_enable,
input logic dmi_uncore_enable,
output logic dmi_uncore_en,
output logic dmi_uncore_wr_en,
output logic [ 6:0] dmi_uncore_addr,
output logic [31:0] dmi_uncore_wdata,
input logic [31:0] dmi_uncore_rdata
input logic [31:0] dmi_uncore_rdata,
output logic dmi_active
/* verilator coverage_on */
);

Expand Down Expand Up @@ -907,6 +909,7 @@ import el2_pkg::*;

// DMI core/uncore mux
dmi_mux dmi_mux (
.core_enable (dmi_core_enable),
.uncore_enable (dmi_uncore_enable),

.dmi_en (dmi_en),
Expand All @@ -928,6 +931,8 @@ import el2_pkg::*;
.dmi_uncore_rdata (dmi_uncore_rdata)
);

always_comb dmi_active = dmi_en;

`ifdef RV_ASSERT_ON
// to avoid internal assertions failure at time 0
initial begin
Expand Down
8 changes: 7 additions & 1 deletion testbench/tb_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ module tb_top
logic [11:0] wb_csr_dest;
logic [31:0] wb_csr_data;

logic dmi_core_enable;

always_comb dmi_core_enable = ~(o_cpu_halt_status);

`ifdef RV_OPENOCD_TEST
// SB and LSU AHB master mux
ahb_lite_2to1_mux #(
Expand Down Expand Up @@ -1302,12 +1306,14 @@ veer_wrapper rvtop_wrapper (
.scan_mode ( 1'b0 ), // To enable scan mode
.mbist_mode ( 1'b0 ), // to enable mbist

.dmi_core_enable (dmi_core_enable),
.dmi_uncore_enable (),
.dmi_uncore_en (),
.dmi_uncore_wr_en (),
.dmi_uncore_addr (),
.dmi_uncore_wdata (),
.dmi_uncore_rdata ()
.dmi_uncore_rdata (),
.dmi_active ()

);

Expand Down
7 changes: 6 additions & 1 deletion testbench/veer_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,16 @@ module veer_wrapper
input logic scan_mode, // To enable scan mode
input logic mbist_mode, // to enable mbist

input logic dmi_core_enable,
// DMI port for uncore
input logic dmi_uncore_enable,
output logic dmi_uncore_en,
output logic dmi_uncore_wr_en,
output logic [ 6:0] dmi_uncore_addr,
output logic [31:0] dmi_uncore_wdata,
input logic [31:0] dmi_uncore_rdata
input logic [31:0] dmi_uncore_rdata,

output logic dmi_active
);

el2_mem_if mem_export ();
Expand All @@ -378,6 +381,8 @@ module veer_wrapper

el2_veer_wrapper rvtop (
.el2_mem_export(mem_export.veer_sram_src),
.dmi_core_enable(dmi_core_enable),
.dmi_active(dmi_active),
.*
);

Expand Down
3 changes: 3 additions & 0 deletions verification/block/dmi/dmi_test_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module dmi_test_wrapper
logic [ 6:0] dmi_addr;
logic [31:0] dmi_wdata;
logic [31:0] dmi_rdata;
logic core_enable;

assign core_enable = '1;

assign dmi_en = reg_en;
assign dmi_wr_en = reg_wr_en;
Expand Down

0 comments on commit fe63594

Please sign in to comment.